1 line
7.1 MiB
Executable File
1 line
7.1 MiB
Executable File
{"version":3,"sources":["vs/editor/fake","vs/editor/vs/css.js","vs/editor/vs/nls.js","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/dnd.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/iframe.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/list/list.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/list/splice.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollbarState.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/arrays.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/assert.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/collections.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/color.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/decorators.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/diff/diffChange.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/diff/diff.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/errors.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/functional.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/hash.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/htmlContent.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/idGenerator.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/iterator.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/history.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/keyCodes.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/lifecycle.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/linkedList.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/event.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/browser.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/event.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/tree/indexTreeModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/tree/objectTreeModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/actions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/cancellation.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/async.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/map.ts","vs/editor/vs/base/common/marked/marked.js","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/network.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/numbers.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/platform.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/keyboardEvent.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/mouseEvent.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/dom.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/fastDomNode.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/globalMouseMoveMonitor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/touch.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/list/rowCache.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/widget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/process.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/path.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/range.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/list/rangeMap.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/scrollable.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/stopwatch.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/strings.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/octiconLabel/octiconLabel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/extpath.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/filters.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/glob.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/mime.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/types.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/objects.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/uri.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/marshalling.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/htmlContentRenderer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/resources.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/labels.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/worker/simpleWorker.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/quickopen/browser/quickOpenViewer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/tree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/treeDefaults.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/treeDnd.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/treeModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/treeViewModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/worker/defaultWorkerFactory.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/checkbox/checkbox.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/countBadge/countBadge.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/progressbar/progressbar.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/sash/sash.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/scrollbar/scrollableElement.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/list/listView.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/treeView.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/splitview/splitview.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/tree/browser/treeImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/config/charWidthReader.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/config/elementSizeObserver.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/core/editorState.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/editorDom.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/services/abstractCodeEditorService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/config/editorZoom.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/position.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/range.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/textAreaState.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/widget/diffNavigator.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/editOperation.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/commands/trimTrailingWhitespaceCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/rgba.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/selection.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/textAreaInput.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/commands/replaceCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/commands/surroundSelectionCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/stringBuilder.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/viewLayer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/token.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/uint.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/characterClassifier.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/wordCharacterClassifier.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/diff/diffComputer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/editorAction.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/editorCommon.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/editorBrowser.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/editStack.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/indentationGuesser.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/intervalTree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/textModelEvents.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/textModelSearch.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/wordHelper.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/abstractMode.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/languageConfiguration.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/languageSelector.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/linkComputer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/characterPair.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/indentRules.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/inplaceReplaceSupport.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/onEnter.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/richEditBrackets.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/electricCharacter.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/languageConfigurationRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/supports/tokenization.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/tokenizationRegistry.ts","vs/editor/vs/editor/common/standalone/promise-polyfill/polyfill.js","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/standalone/standaloneEnums.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/standalone/standaloneBase.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/overviewZoneManager.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/renderingContext.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/lines/rangeUtil.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/viewContext.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/viewEventDispatcher.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/viewEvents.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewLayout/lineDecorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewLayout/viewLineRenderer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewLayout/viewLinesViewportData.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewLayout/whitespaceComputer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewLayout/linesLayout.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/prefixSumComputer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/mirrorTextModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/editorSimpleWorker.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/viewEventHandler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/dynamicViewOverlay.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/viewPart.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/decorations/decorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/margin/margin.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/viewZones/viewZones.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/viewModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewLayout/viewLayout.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/viewModelDecorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/caretOperations/moveCaretCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/codeActionTrigger.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/codeActionWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/colorPicker/colorPickerModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/comment/blockCommentCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/comment/lineCommentCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/dnd/dragAndDropCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/findState.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/replaceAllCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/replacePattern.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/foldingRanges.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/foldingModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/hiddenRangeModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/syntaxRangeProvider.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/intializingRangeProvider.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/format/formattingEdit.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/goToDefinition/clickLinkGesture.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/hover/hoverOperation.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/hover/hoverWidgets.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/indentation/indentUtils.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/linesOperations/copyLinesCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/linesOperations/sortLinesCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/smartSelect/bracketSelections.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/smartSelect/wordSelections.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/snippet/snippetParser.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/wordDistance.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchCommon.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchCompile.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/actionbar/actionbar.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/aria/aria.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/findinput/findInputCheckboxes.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/inputbox/inputBox.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/findinput/findInput.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/list/listWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/menu/menu.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/tree/abstractTree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/tree/dataTree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/tree/objectTree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/tree/asyncDataTree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/keybindingLabels.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/common/severity.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/quickopen/browser/quickOpenModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/base/parts/quickopen/browser/quickOpenWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/config/editorOptions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/config/fontInfo.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/completionModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/standaloneStrings.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/referenceSearch/referencesModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/accessibility/common/accessibilityService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/extensions/common/extensions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/files/common/files.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/instantiation/common/descriptors.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/instantiation/common/extensions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/instantiation/common/graph.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/instantiation/common/instantiation.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/services/bulkEditService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/services/codeEditorService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/editorWorkerService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/markersDecorationService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/modeService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/modelService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/languageFeatureRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/core/lineTokens.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/nullMode.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/textModelTokens.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/model/textModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorCommon.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/commands/shiftCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorColumnSelection.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorMoveOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorDeleteOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorTypeOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorWordOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorMoveCommands.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/oneCursor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursorCollection.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/controller/cursor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/textToHtmlTokenizer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/resolverService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/resourceConfiguration.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/minimapCharRenderer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/runtimeMinimapCharRenderer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/splitLinesCollection.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/viewModel/viewModelImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/foldingDecorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/indentRangeProvider.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/linesOperations/moveLinesCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/zoneWidget/zoneWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchLexer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/colorizer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/common/standaloneThemeService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/accessibility/common/accessibility.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/clipboard/common/clipboardService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/commands/common/commands.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/services/openerService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/links/getLinks.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/contextkey/common/contextkey.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/editorContextKeys.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/suggestAlternatives.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/wordContextKey.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/actions/common/actions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/actions/common/menuService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/contextview/browser/contextView.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/dialogs/common/dialogs.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/instantiation/common/serviceCollection.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/instantiation/common/instantiationService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/abstractKeybindingService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/baseResolvedKeybinding.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/keybinding.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/keybindingResolver.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/resolvedKeybindingItem.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/label/common/label.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/layout/browser/layoutService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/contextview/browser/contextViewService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/log/common/log.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/editorWorkerServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/webWorker.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/markers/common/markers.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/markers/common/markerService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/notification/common/notification.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/opener/common/opener.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/markdown/markdownRenderer.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/hover/modesGlyphHover.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/progress/common/progress.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/registry/common/platform.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/modes/modesRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/getIconClasses.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/configuration/common/configurationRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/config/commonEditorConfig.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/config/configuration.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/viewOverlays.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/languagesRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/modeServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/configuration/common/configuration.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/modelServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/configuration/common/configurationModels.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/contextkey/browser/contextKeyService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/keybinding/common/keybindingsRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/browser/contextScopedHistoryWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/storage/common/storage.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codelens/codeLensCache.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/suggestMemory.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/telemetry/common/telemetry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/editorExtensions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/coreCommands.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/viewController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/caretOperations/caretOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/caretOperations/transpose.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/clipboard/clipboard.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/codeAction.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/codeActionModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/lightBulbWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codelens/codelens.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/colorPicker/color.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/colorPicker/colorDetector.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/comment/comment.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/contextmenu/contextmenu.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/cursorUndo/cursorUndo.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/dnd/dnd.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/folding/folding.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/fontZoom/fontZoom.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/format/format.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/format/formatActions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/goToDefinition/goToDefinition.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/hover/getHover.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/linesOperations/linesOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/parameterHints/parameterHintsModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/quickOpen/quickOpen.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/smartSelect/smartSelect.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/suggest.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/tokenization/tokenization.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/wordOperations/wordOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/wordPartOperations/wordPartOperations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/theme/common/colorRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/rename/renameInputField.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/theme/common/styler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/contextview/browser/contextMenuHandler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/theme/common/themeService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/services/codeEditorServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/lines/viewLine.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/mouseTarget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/mouseHandler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/pointerHandler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/viewOutgoingEvents.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/lines/viewLines.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/minimap/minimap.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/selections/selections.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/view/editorColorRegistry.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/controller/textAreaHandler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/rulers/rulers.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/viewParts/viewCursors/viewCursors.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/view/viewImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/widget/codeEditorWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/widget/diffReview.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/widget/diffEditorWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/common/services/markerDecorationsServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/bracketMatching/bracketMatching.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codelens/codelensWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codelens/codelensController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/colorPicker/colorPickerWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/findDecorations.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/findModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/findOptionsWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/findWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/find/findController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/links/links.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/message/messageController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/codeActionCommands.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/codeAction/codeActionContributions.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/multicursor/multicursor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/parameterHints/parameterHints.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/referenceSearch/peekViewWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/referenceSearch/referencesTree.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/rename/rename.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/suggestWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/wordHighlighter/wordHighlighter.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/quickOpen/gotoLine.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/quickOpen/quickCommand.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/quickOpen/quickOutline.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/standaloneCodeServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/common/themes.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/contextview/browser/contextMenuService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/list/browser/listService.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/referenceSearch/referencesWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/gotoError/gotoErrorWidget.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/gotoError/gotoError.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/hover/modesContentHover.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/hover/hover.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/referenceSearch/referencesController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/referenceSearch/referenceSearch.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/workspace/common/workspace.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/simpleServices.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/standaloneCodeEditor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/standaloneServices.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/standaloneEditor.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/standalone/browser/standaloneLanguages.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/editor.api.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/platform/workspaces/common/workspaces.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/snippet/snippetVariables.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/snippet/snippetSession.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/snippet/snippetController2.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/suggestModel.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/contrib/suggest/suggestController.ts","vs/editor/file:/Users/penlv/code/vscode/out-editor-src/vs/editor/editor.main.ts"],"names":["CSSLoaderPlugin","__m","__M","deps","result","i","len","length","BrowserCSSLoader","this","_pendingLoads","prototype","attachListeners","name","linkNode","callback","errorback","unbind","removeEventListener","loadEventListener","errorEventListener","e","addEventListener","_onLoad","_onLoadError","err","_insertLinkNode","head","document","getElementsByTagName","other","insertBefore","appendChild","createLinkTag","cssUrl","externalCallback","externalErrorback","_this","createElement","setAttribute","_linkTagExists","nameAttr","hrefAttr","links","getAttribute","load","CSSPlugin","_cssLoader","req","toUrl","contents","error","define","NLSLoaderPlugin","_format","message","args","env","replace","match","rest","index","arg","undefined","String","isPseudo","createScopedLocalize","scope","idx","defaultValue","restArgs","Array","slice","call","arguments","Environment","_detected","_isPseudo","Object","defineProperty","get","_detect","enumerable","configurable","location","hash","indexOf","NLSPlugin","_env","localize","data","_i","apply","concat","setPseudoTranslation","value","create","key","config","pluginConfig","language","availableLanguages","findLanguageForModule","suffix","DEFAULT_TAG","messagesLoaded_1","messages","isArray","loadBundle","exports","DataTransfers","RESOURCES","DOWNLOAD_URL","FILES","TEXT","DragAndDropData","update","getData","StaticDND","CurrentDragAndDropData","getParentWindowIfSameOrigin","w","parent","location_1","parentLocation","protocol","hostname","port","hasDifferentOriginAncestorFlag","findIframeElementInParentWindow","parentWindow","childWindow","iframe","parentWindowIframes","contentWindow","sameOriginWindowChainCache","IframeUtils","getSameOriginWindowChain","parent_1","window","push","iframeElement","hasDifferentOriginAncestor","getPositionOfChildWindowRelativeToAncestorWindow","ancestorWindow","top","left","windowChain_1","windowChainEl","boundingRect","getBoundingClientRect","ListAriaRootRole","CombinedSpliceable","spliceables","splice","start","deleteCount","elements","forEach","s","ScrollbarState","arrowSize","scrollbarSize","oppositeScrollbarSize","_scrollbarSize","Math","round","_oppositeScrollbarSize","_arrowSize","_visibleSize","_scrollSize","_scrollPosition","_computedAvailableSize","_computedIsNeeded","_computedSliderSize","_computedSliderRatio","_computedSliderPosition","_refreshComputedValues","clone","r","setVisibleSize","setScrollSize","setScrollPosition","visibleSize","iVisibleSize","scrollSize","iScrollSize","scrollPosition","iScrollPosition","_computeValues","computedAvailableSize","max","computedRepresentableSize","computedIsNeeded","computedSliderSize","computedSliderRatio","computedSliderPosition","floor","getArrowSize","getScrollPosition","getRectangleLargeSize","getRectangleSmallSize","isNeeded","getSliderSize","getSliderPosition","getDesiredScrollPositionFromOffset","offset","desiredSliderPosition","getDesiredScrollPositionFromDelta","delta","mergeSort","compare","_sort","a","lo","hi","aux","mid","leftIdx","rightIdx","_merge","firstIndex","array","fn","tail","n","tail2","arr","Error","equals","one","itemEquals","b","binarySearch","comparator","low","high","comp","findFirstInSorted","p","groupBy","currentGroup","_a","element","coalesce","filter","isFalsyOrEmpty","obj","isNonEmptyArray","distinct","keyFn","position","seen","elem","distinctES6","Set","has","add","first","notFoundValue","flatten","range","to","from","arrayInsert","target","insertIndex","insertArr","before","after","pushToStart","unshift","pushToEnd","asArray","x","ok","hasOwnProperty","roundFloat","number","decimalPoints","decimal","pow","RGBA","g","min","HSLA","h","l","fromRGBA","rgba","chroma","_hue2rgb","q","t","toRGBA","hsla","HSVA","v","m","cmax","hsva","c","abs","Color","_hsla","_hsva","fromHex","hex","Format","CSS","parseHex","red","getRelativeLuminance","_relativeLuminanceForComponent","color","isLighter","isLighterThan","another","isDarkerThan","lighten","factor","darken","transparent","isTransparent","isOpaque","opposite","toString","format","getLighterColor","of","relative","lum1","lum2","getDarkerColor","white","black","blue","cyan","lightgrey","_toTwoDigitHex","_parseHexDigit","charCode","formatRGB","formatRGBA","toFixed","formatHSL","formatHSLA","formatHex","formatHexA","compact","charCodeAt","memoize","descriptor","fnKey","console","warn","memoizeKey","writable","DiffChange","originalStart","originalLength","modifiedStart","modifiedLength","getOriginalEnd","getModifiedEnd","createStringSequence","getLength","getElementAtIndex","pos","stringDiff","original","modified","pretty","LcsDiff","ComputeDiff","Debug","Assert","condition","MyArray","Copy","sourceArray","sourceIndex","destinationArray","destinationIndex","DiffChangeHelper","m_changes","m_originalStart","Number","MAX_VALUE","m_modifiedStart","m_originalCount","m_modifiedCount","MarkNextChange","diffChange_1","AddOriginalElement","originalIndex","modifiedIndex","AddModifiedElement","getChanges","getReverseChanges","reverse","originalSequence","newSequence","continueProcessingPredicate","OriginalSequence","ModifiedSequence","ContinueProcessingPredicate","m_forwardHistory","m_reverseHistory","ElementsAreEqual","newIndex","OriginalElementsAreEqual","index1","index2","ModifiedElementsAreEqual","_ComputeDiff","originalEnd","modifiedEnd","changes","ComputeDiffRecursive","PrettifyChanges","quitEarlyArr","midOriginalArr","midModifiedArr","ComputeRecursionPoint","midOriginal","midModified","leftChanges","rightChanges","ConcatenateChanges","WALKTRACE","diagonalForwardBase","diagonalForwardStart","diagonalForwardEnd","diagonalForwardOffset","diagonalReverseBase","diagonalReverseStart","diagonalReverseEnd","diagonalReverseOffset","forwardPoints","reversePoints","deltaIsEven","diagonal","forwardChanges","reverseChanges","changeHelper","diagonalMin","diagonalMax","diagonalRelative","lastOriginalIndex","MIN_VALUE","historyIndex","originalStartPoint","modifiedStartPoint","lastForwardChange","numDifferences","maxDifferences","numDiagonals","tempOriginalIndex","furthestOriginalIndex","furthestModifiedIndex","ClipDiagonalBound","matchLengthOfLongest","temp","change","originalStop","modifiedStop","checkOriginal","checkModified","mergedChangeArr","ChangesOverlap","prevChange","bestDelta","bestScore","_boundaryScore","score","_OriginalIsBoundary","test","_OriginalRegionIsBoundary","_ModifiedIsBoundary","_ModifiedRegionIsBoundary","right","diagonalBaseIndex","diagonalsAbove","diffEven","isPromiseCanceledError","canceledName","ErrorHandler","listeners","unexpectedErrorHandler","setTimeout","stack","emit","listener","onUnexpectedError","onUnexpectedExternalError","errorHandler","transformErrorForSerialization","$isError","stacktrace","canceled","illegalArgument","illegalState","once","didCall","hashVal","numberHash","initialHashVal","reduce","item","arrayHash","keys","sort","stringHash","objectHash","booleanHash","val","length_1","isEmptyMarkdownString","oneOrMany","isMarkdownString","every","thing","MarkdownString","isTrusted","markdownStringEqual","appendText","appendCodeblock","langId","code","markedStringsEquals","arrays_1","removeMarkdownEscapes","text","IdGenerator","prefix","_prefix","_lastId","nextId","defaultGenerator","FIN","done","Iterator","iterator","next","_empty","empty","fromArray","map","collect","getSequenceIterator","ArrayIterator","items","end","current","ArrayNavigator","_super","__extends","previous","last","MappedIterator","HistoryNavigator","history","limit","_initialize","_limit","_onChange","_history","delete","_navigator","_reduceToLimit","iterator_1","_elements","history_1","entry","createSimpleKeybinding","keybinding","OS","ctrlCmd","winCtrl","SimpleKeybinding","KeyCodeStrMap","_keyCodeToStr","_strToKeyCode","keyCode","str","toLowerCase","keyCodeToStr","strToKeyCode","uiMap","userSettingsUSMap","userSettingsGeneralMap","uiLabel","usUserSettingsLabel","generalUserSettingsLabel","KeyCodeUtils","fromString","toUserSettingsUS","toUserSettingsGeneral","fromUserSettings","KeyChord","firstPart","secondPart","createKeybinding","chordPart","ChordKeybinding","ctrlKey","shiftKey","altKey","metaKey","isModifierKey","toChord","isDuplicateModifierCase","parts","errors_1","ResolvedKeybindingPart","kbLabel","kbAriaLabel","keyLabel","keyAriaLabel","ResolvedKeybinding","dispose","d","isDisposable","combinedDisposable","disposables","toDisposable","Disposable","_toDispose","_lifecycle_disposable_isDisposed","_register","None","freeze","ImmortalReference","object","Node","Undefined","prev","LinkedList","_first","_last","_size","isEmpty","clear","_insert","atTheEnd","newNode","oldLast","oldFirst","didRemove","_remove","shift","res","node","anchor","toArray","Event","event","thisArgs","didFire","snapshot","each","merge","initial","output","emitter","Emitter","onFirstListenerAdd","fire","onLastListenerRemove","latch","cache","firstCall","shouldEmit","_disposable","signal","any","events","lifecycle_1","debounce","delay","leading","leakWarningThreshold","subscription","handle","numDebouncedCalls","cur","clearTimeout","_output","stopwatch","Date","getTime","_","buffer","nextTick","_buffer","flush","onFirstListenerDidAdd","ChainableEvent","on","chain","fromNodeEventEmitter","eventName","id","removeListener","fromPromise","promise","then","toPromise","Promise","_globalLeakWarningThreshold","LeakageMonitor","customThreshold","random","_warnCountdown","_stacks","check","listenerCount","threshold","Map","split","join","count","set","topStack_1","topCount_1","options","_disposed","_options","_leakageMon","_event","_listeners","linkedList_1","firstListener","remove","onListenerDidAdd","removeMonitor","size","_noop","_deliveryQueue","iter","event_1","PauseableEmitter","_isPaused","_eventQueue","_mergeFn","pause","resume","EventMultiplexer","hasListeners","hook","functional_1","unhook","EventBufferer","buffers","wrapEvent","bufferEvents","pop","Relay","listening","inputEvent","inputEventListener","WindowManager","_zoomLevel","_lastZoomLevelChangeTime","_onDidChangeZoomLevel","onDidChangeZoomLevel","getZoomLevel","getTimeSinceLastZoomLevelChanged","now","getPixelRatio","ctx","getContext","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","INSTANCE","userAgent","navigator","isIE","isEdge","isEdgeOrIE","isFirefox","isWebKit","isChrome","isSafari","isWebkitWebView","isIPad","isEdgeWebView","hasClipboardSupport","version","parseInt","substring","domEvent","type","useCapture","stop","preventDefault","stopPropagation","isFilterResult","getVisibleState","visibility","treeNodeToElement","collapsed","children","IndexTreeModel","list","rootElement","rootRef","eventBufferer","_onDidChangeCollapseState","onDidChangeCollapseState","_onDidChangeRenderNodeCount","onDidChangeRenderNodeCount","_onDidSplice","onDidSplice","collapseByDefault","autoExpandSingleChildren","root","depth","visibleChildrenCount","visibleChildIndex","collapsible","renderNodeCount","visible","filterData","toInsert","onDidCreateNode","onDidDeleteNode","_b","getParentNodeWithListIndex","parentNode","listIndex","revealed","treeListElementsToInsert","nodesToInsertIterator","el","createTreeNode","lastIndex","visibleChildStartIndex","child","nodesToInsert","insertedVisibleChildrenCount","deletedNodes","deletedVisibleChildrenCount","deletedNodes_1","visibleDeleteCount","_updateAncestorsRenderNodeCount","visit_1","insertedNodes","rerender","getTreeNodeWithListIndex","getListIndex","getListRenderCount","getTreeNode","isCollapsed","setCollapsed","recursive","_setCollapsed","_setListNodeCollapsed","onlyVisibleChildIndex","_setNodeCollapsed","previousRenderNodeCount","updateNodeAfterCollapseChange","deep","expandTo","refilter","updateNodeAfterFilterChange","treeElement","parentVisibility","treeListElements","_filterNode","childElements","childRevealed","childNodes","_updateNodeAfterCollapseChange","_updateNodeAfterFilterChange","resultStartLength","hasVisibleDescendants","diff","getNode","getNodeLocation","getParentNodeLocation","ObjectTreeModel","nodes","model","indexTreeModel_1","sorter","setChildren","getElementLocation","_setChildren","preserveCollapseState","insertedElements","bind","__assign","Action","label","cssClass","enabled","actionCallback","_onDidChange","onDidChange","_id","_label","_cssClass","_enabled","_actionCallback","_setLabel","_tooltip","_setTooltip","tooltip","_setClass","class","_setEnabled","_checked","_setChecked","_radio","_setRadio","checked","radio","run","_data","resolve","ActionRunner","_onDidBeforeRun","onDidBeforeRun","_onDidRun","onDidRun","action","context","runAction","CancellationToken","shortcutEvent","isCancellationToken","Cancelled","MutableToken","isCancellationRequested","onCancellationRequested","_isCancelled","_emitter","cancel","CancellationTokenSource","_token","_parentListener","createCancelablePromise","source","cancellation_1","thenable","token","reject","errors","class_1","catch","finally","onfinally","timeout","millis","isThenable","Delayer","defaultDelay","completionPromise","doResolve","task","trigger","cancelTimeout","doReject","isTriggered","disposableTimeout","handler","timer","promiseFactories","shouldStop","loop","factory","TimeoutTimer","runner","setIfNotSet","cancelAndSet","IntervalTimer","clearInterval","interval","setInterval","RunOnceScheduler","timeoutToken","timeoutHandler","onTimeout","isScheduled","schedule","doRun","requestIdleCallback","cancelIdleCallback","dummyIdle_1","didTimeout","timeRemaining","runWhenIdle","disposed","IdleValue","executor","_didRun","_executor","_value","_error","_handle","getValue","ScrollbarVisibilityController","visibleClassName","invisibleClassName","_visibility","_visibleClassName","_invisibleClassName","_domNode","_isVisible","_isNeeded","_shouldBeVisible","_revealTimer","async_1","applyVisibilitySetting","shouldBeVisible","setShouldBeVisible","rawShouldBeVisible","ensureVisibility","setIsNeeded","setDomNode","domNode","setClassName","_reveal","_hide","withFadeAway","values","forEachable","StringIterator","_pos","reset","hasNext","cmp","PathIterator","_from","_to","justSeps","ch","aPos","aLen","thisPos","TernarySearchTreeNode","TernarySearchTree","segments","_iter","forPaths","forStrings","_root","segment","oldElement","findSubstr","candidate","_forEach","ResourceMap","ignoreCase","resource","toKey","LinkedMap","_map","_head","_tail","touch","addItemLast","addItemFirst","removeItem","callbackfn","thisArg","trimOld","newSize","currentSize","toJSON","LRUCache","ratio","_ratio","checkTrim","__marked_exports","Lexer","tokens","marked","defaults","rules","block","normal","pedantic","gfm","tables","InlineLexer","inline","renderer","Renderer","breaks","TextRenderer","Parser","slugger","Slugger","escape","html","encode","escapeTest","escapeReplace","replacements","escapeTestNoEncode","escapeReplaceNoEncode","unescape","charAt","fromCharCode","edit","regex","opt","getRegex","RegExp","cleanUrl","sanitize","base","href","prot","decodeURIComponent","originIndependentUrl","baseUrls","rtrim","resolveUrl","encodeURI","noop","splitCells","tableRow","cells","escaped","curr","trim","invert","suffLen","currChar","substr","src","pending","highlight","lex","out","parse","lang","silent","newline","fences","hr","heading","nptable","blockquote","def","table","lheading","paragraph","_title","bullet","_tag","_comment","loose","cap","bull","listStart","listItems","space","tag","isordered","istask","ischecked","exec","header","align","ordered","smartLists","pre","sanitizer","title","autolink","url","link","reflink","nolink","strong","em","br","del","_punctuation","_escapes","_scheme","_email","_attribute","_href","_extended_email","_backpedal","prevCapZero","inLink","inRawBlock","lastParenIndex","level","findClosingBracket","linkLen","outputLink","escapes","codespan","mangle","smartypants","image","infostring","langPrefix","quote","raw","headerIds","headerPrefix","slug","xhtml","body","listitem","checkbox","tablerow","content","tablecell","flags","baseUrl","inlineText","tok","peek","parseText","row","cell","j","errMsg","log","originalSlug","&","<",">","\"","'","setOptions","getDefaults","parser","lexer","inlineLexer","Schemas","inMemory","vscode","internal","walkThrough","walkThroughSnippet","http","https","file","mailto","untitled","command","vscodeRemote","clamp","_isWindows","_isMacintosh","_isLinux","_isNative","_isWeb","isElectronRenderer","process","versions","electron","platform","rawNlsConfig","nlsConfig","JSON","resolved","locale","_translationsConfigFile","isWindows","isMacintosh","isLinux","isNative","isWeb","_globals","self","global","globals","_setImmediate","setImmediate","KEY_CODE_MAP","INVERSE_KEY_CODE_MAP","browser","ctrlKeyMod","metaKeyMod","StandardKeyboardEvent","_standardKeyboardEventBrand","browserEvent","char","toUpperCase","keyCodes_1","extractKeyCode","_asKeybinding","_computeKeybinding","_asRuntimeKeybinding","_computeRuntimeKeybinding","toKeybinding","StandardMouseEvent","timestamp","leftButton","button","middleButton","rightButton","detail","pageX","posx","posy","pageY","clientX","scrollLeft","documentElement","clientY","scrollTop","iframeOffsets","iframe_1","view","DragMouseEvent","dataTransfer","StandardWheelEvent","deltaX","deltaY","targetNode","srcElement","e1","e2","wheelDeltaY","VERTICAL_AXIS","axis","wheelDeltaX","HORIZONTAL_AXIS","wheelDelta","addDisposableListener","DomListener","doRequestAnimationFrame","_animationFrame","requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","getComputedStyle","defaultView","isAncestor","testChild","testAncestor","createStyleSheet","container","style","media","getSharedStyleSheet","_sharedStyleSheet","removeTabIndexAndUpdateFocus","hasAttribute","activeElement","parentFocusable","attribute","HTMLElement","findParentWithAttribute","parentElement","focus","removeAttribute","clearNode","firstChild","removeChild","removeNode","isInDOM","_manualClassList","_findClassName","className","classes","classesLen","classLen","_lastStart","_lastEnd","idxEnd","hasClass","addClasses","classNames","nameValue","addClass","removeClass","removeClasses","toggleClass","shouldHaveIt","_nativeClassList","class_2","Boolean","classList","contains","toggle","_classList","_node","_type","_handler","_useCapture","addStandardDisposableListener","wrapHandler","mouseEvent_1","_wrapAsStandardMouseEvent","keyboardEvent_1","_wrapAsStandardKeyboardEvent","addDisposableNonBubblingMouseOutListener","toElement","relatedTarget","AnimationFrameQueueItem","priority","_runner","_canceled","execute","NEXT_QUEUE","CURRENT_QUEUE","animFrameRequested","inAnimationFrameRunner","animationFrameRunner","scheduleAtNextAnimationFrame","runAtThisOrScheduleAtNextAnimationFrame","MINIMUM_TIME_MS","DEFAULT_EVENT_MERGER","lastEvent","currentEvent","TimeoutThrottledDomListener","eventMerger","minimumTimeMs","lastHandlerTime","invokeHandler","elapsedTime","addDisposableThrottledListener","SizeUtils","convertToPixels","parseFloat","getDimension","cssPropertyName","jsPropertyName","computedStyle","getPropertyValue","getBorderLeftWidth","getBorderRightWidth","getBorderTopWidth","getBorderBottomWidth","getPaddingLeft","getPaddingRight","getPaddingTop","getPaddingBottom","getMarginLeft","getMarginTop","getMarginRight","getMarginBottom","Dimension","width","height","getTopLeftOffset","offsetParent","offsetTop","offsetLeft","direction","getDomNodePagePosition","bb","StandardWindow","scrollX","scrollY","class_3","getTotalWidth","margin","offsetWidth","getContentWidth","border","padding","getContentHeight","offsetHeight","getTotalHeight","findParentWithClass","clazz","stopAtClazzOrNode","createCSSRule","selector","cssText","sheet","insertRule","removeCSSRulesContainingSelector","ruleName","cssRules","getDynamicStyleSheetRules","toDelete","selectorText","deleteRule","isHTMLElement","o","nodeType","nodeName","EventType","CLICK","DBLCLICK","MOUSE_UP","MOUSE_DOWN","MOUSE_OVER","MOUSE_MOVE","MOUSE_OUT","MOUSE_ENTER","MOUSE_LEAVE","CONTEXT_MENU","WHEEL","KEY_DOWN","KEY_PRESS","KEY_UP","LOAD","UNLOAD","ABORT","ERROR","RESIZE","SCROLL","SELECT","CHANGE","SUBMIT","RESET","FOCUS","FOCUS_IN","FOCUS_OUT","BLUR","INPUT","STORAGE","DRAG_START","DRAG","DRAG_ENTER","DRAG_LEAVE","DRAG_OVER","DROP","DRAG_END","ANIMATION_START","ANIMATION_END","ANIMATION_ITERATION","EventHelper","cancelBubble","returnValue","saveParentsScrollTop","ELEMENT_NODE","restoreParentsScrollTop","state","FocusTracker","_onDidFocus","event_2","onDidFocus","_onDidBlur","onDidBlur","hasFocus","loosingFocus","trackFocus","append","SELECTOR_REGEX","$","description","attrs","createTextNode","show","elements_1","display","hide","elements_2","computeScreenAwareSize","cssPx","screenPx","windowOpenNoOpener","open","newTab","opener","animate","step","stepDisposable","FastDomNode","_maxWidth","_width","_height","_top","_left","_bottom","_right","_fontFamily","_fontWeight","_fontSize","_lineHeight","_letterSpacing","_className","_display","_position","_layerHint","setMaxWidth","maxWidth","setWidth","setHeight","setTop","unsetTop","setLeft","setBottom","bottom","setRight","setFontFamily","fontFamily","setFontWeight","fontWeight","setFontSize","fontSize","setLineHeight","lineHeight","setLetterSpacing","letterSpacing","toggleClassName","dom","setDisplay","setPosition","setVisibility","setLayerHinting","layerHint","willChange","createFastDomNode","standardMouseMoveMerger","ev","GlobalMouseMoveMonitor","hooks","mouseMoveEventMerger","mouseMoveCallback","onStopCallback","stopMonitoring","invokeStopCallback","isMonitoring","startMonitoring","windowChain","lastSameOriginAncestor","tagName","Tap","Change","Start","End","Contextmenu","Gesture","activeTouches","targets","DomUtils","onTouchStart","onTouchEnd","onTouchMove","addTarget","isTouchDevice","maxTouchPoints","msMaxTouchPoints","targetTouches","identifier","initialTarget","initialTimeStamp","initialPageX","initialPageY","rollingTimestamps","rollingPageX","rollingPageY","evt","newGestureEvent","dispatchEvent","dispatched","activeTouchCount","changedTouches","this_1","holdTime","HOLD_DELAY","arrays","finalX","finalY","deltaT","dispatchTo","inertia","createEvent","initEvent","t1","vX","dirX","vY","dirY","y","delta_pos_x","delta_pos_y","stopped","SCROLL_FRICTION","translationX","translationY","__decorate","decorators_1","RowCache","renderers","alloc","templateId","getTemplateCache","dom_1","templateData","getRenderer","renderTemplate","release","releaseRow","removeFromParent","garbageCollect","cachedRows","cachedRows_1","cachedRow","disposeTemplate","Widget","onclick","onmousedown","onmouseover","onnonbubblingmouseout","onkeydown","onkeyup","oninput","onblur","onfocus","onchange","ARROW_IMG_SIZE","ScrollbarArrow","opts","_onActivate","onActivate","bgDomNode","bgWidth","bgHeight","_mouseMoveMonitor","globalMouseMoveMonitor_1","_arrowMouseDown","_mousedownRepeatTimer","_mousedownScheduleRepeatTimer","mouseMoveData","widget_1","AbstractScrollbar","_lazyRender","lazyRender","_host","host","_scrollable","scrollable","_scrollbarState","scrollbarState","_visibilityController","scrollbarVisibilityController_1","extraScrollbarClassName","_shouldRender","fastDomNode_1","_domNodeMouseDown","_createArrow","arrow","scrollbarArrow_1","_createSlider","slider","_sliderMouseDown","_onElementSize","render","_onElementScrollSize","elementScrollSize","_onElementScrollPosition","elementScrollPosition","beginReveal","beginHide","_renderDomNode","_updateSlider","_onMouseDown","delegateMouseDown","domTop","getClientRects","sliderStart","sliderStop","mousePos","_sliderMousePosition","offsetX","offsetY","domNodePosition","_setDesiredScrollPositionNow","_mouseDownRelativePosition","onDragFinished","initialMousePosition","initialMouseOrthogonalPosition","_sliderOrthogonalMousePosition","initialScrollbarState","mouseOrthogonalPosition","mouseOrthogonalDelta","mouseDelta","onDragEnd","onDragStart","_desiredScrollPosition","desiredScrollPosition","writeScrollPosition","setScrollPositionNow","HorizontalScrollbar","scrollbarState_1","horizontalHasArrows","horizontal","horizontalScrollbarSize","vertical","verticalScrollbarSize","arrowDelta","scrollbarDelta","onMouseWheel","horizontalSliderSize","sliderSize","sliderPosition","largeSize","smallSize","onDidScroll","scrollWidth","abstractScrollbar_1","VerticalScrollbar","verticalHasArrows","verticalSliderSize","scrollHeight","safeProcess","cwd","platform_1","validateString","ErrorInvalidArgType","isPathSeparator","CHAR_FORWARD_SLASH","CHAR_BACKWARD_SLASH","isPosixPathSeparator","isWindowsDeviceRoot","CHAR_UPPERCASE_A","CHAR_UPPERCASE_Z","CHAR_LOWERCASE_A","CHAR_LOWERCASE_Z","normalizeString","path","allowAboveRoot","separator","lastSegmentLength","lastSlash","dots","CHAR_DOT","lastSlashIndex","lastIndexOf","sep","pathObject","dir","ext","expected","actual","determiner","msg","win32","pathSegments","resolvedDevice","resolvedTail","resolvedAbsolute","rootEnd","device","isAbsolute","normalize","paths","joined","needsReplace","slashCount","firstLen","fromOrig","toOrig","fromStart","fromEnd","fromLen","toStart","toEnd","toLen","lastCommonSep","fromCode","toNamespacedPath","resolvedPath","dirname","matchedSlash","basename","extIdx","firstNonSlashEnd","extname","startDot","startPart","preDotState","ret","delimiter","posix","trailingSeparator","hasRoot","Range","intersect","intersects","relativeComplement","second","groupIntersect","groups","groups_1","intersection","range_1","much","consolidate","previousGroup","groups_2","group","RangeMap","POSITIVE_INFINITY","middle","indexAt","indexAfter","positionAt","groupCount","newCount","createEaseOutCubic","completion","easeInCubic","easeOutCubic","ScrollState","withScrollDimensions","withScrollPosition","createScrollEvent","widthChanged","scrollWidthChanged","scrollLeftChanged","heightChanged","scrollHeightChanged","scrollTopChanged","Scrollable","smoothScrollDuration","_onScroll","onScroll","_smoothScrollDuration","_scheduleAtNextAnimationFrame","_state","_smoothScrolling","setSmoothScrollDuration","validateScrollPosition","getScrollDimensions","setScrollDimensions","dimensions","newState","_setState","acceptScrollDimensions","getFutureScrollPosition","getCurrentScrollPosition","setScrollPositionSmooth","validTarget","newSmoothScrolling","combine","SmoothScrollingOperation","animationFrameDisposable","_performSmoothScrolling","tick","isDone","oldState","SmoothScrollingUpdate","startTime","duration","_startTime","_initAnimations","_initAnimation","viewportSize","stop1","stop2","cut","createComposed","_tick","newScrollLeft","newScrollTop","hasPerformanceNow","performance","StopWatch","highResolution","_highResolution","_now","_stopTime","elapsed","escapeRegExpCharacters","ltrim","haystack","needle","needleLen","haystackLen","isLowerAsciiLetter","isUpperAsciiLetter","isAsciiLetter","doEqualsIgnoreCase","stopAt","codeA","codeB","isFullWidthCharacter","isFalsyOrWhitespace","pad","_formatRegexp","isNaN","convertSimple2RegExpPattern","pattern","startsWith","endsWith","createRegExp","searchString","isRegex","wholeWord","modifiers","matchCase","multiline","unicode","regExpLeadsToEndlessLoop","regexp","regExpFlags","firstNonWhitespaceIndex","chCode","getLeadingWhitespace","lastNonWhitespaceIndex","startIndex","equalsIgnoreCase","startsWithIgnoreCase","candidateLength","commonPrefixLength","commonSuffixLength","aLastIndex","bLastIndex","isHighSurrogate","isLowSurrogate","CONTAINS_RTL","containsRTL","CONTAINS_EMOJI","containsEmoji","IS_BASIC_ASCII","isBasicASCII","containsFullWidthCharacter","UTF8_BOM_CHARACTER","startsWithUTF8BOM","safeBtoa","btoa","encodeURIComponent","repeat","renderOcticons","strings_1","toSlashes","osPath","path_1","isEqualOrParent","sepOffset","isWindowsDriveLetter","char0","or","word","wordToMatchAgainst","matchesContiguousSubString","matchesSubString","_matchesSubString","isLower","isUpper","isNumber","isWhitespace","isAlphanumeric","nextAnchor","camelCaseWord","_matchesCamelCase","nextUpperIndex","matchesCamelCase","upper","lower","whitespace","isCamelCasePattern","analysis","alpha","numeric","upperPercent","lowerPercent","alphaPercent","numericPercent","analyzeCamelCaseWord","isCamelCaseWord","isUpperCaseWord","initTable","_maxLen","thisRow","printTable","patternLen","wordLen","isSeparatorAtPos","isWhitespaceAtPos","isUpperCaseAtPos","wordLow","fuzzyScore","patternLow","patternPos","wordPos","firstMatchCanBeWeak","isPatternInWord","patternStartPos","wordStartPos","_scores","diag","_table","top_1","_arrows","_debug","_matchesCount","_topScore","_patternStartPos","_firstMatchCanBeWeak","_findAllMatches2","_topMatch2","total","matches","lastMatched","simpleMatchCount","fuzzyScoreGracefulAggressive","lowPattern","lowWord","aggressive","tries","movingPatternPos","newPattern","swap1","swap2","nextTypoPermutation","fuzzyScoreWithPermutations","matchesPrefix","strings","wordSeparators","fuzzyContiguousFilter","fuzzySeparateFilter","fuzzyRegExpCache","map_1","matchesFuzzy","enableSeparateSubstringMatching","anyScore","_patternPos","_wordPos","createMatches","FuzzyScore","Default","isDefault","starsToRegExp","starCount","NO_PATH_REGEX","PATH_REGEX","splitGlobAware","splitChar","inBraces","inBrackets","curVal","pattern_1","parseRegExp","regEx","GLOB_SPLIT","GLOBSTAR","previousSegmentWasGlobStar_1","braceVal","bracketVal","segment_1","braceRegExp","parsePattern","arg1","NULL","patternKey","trimForExclusions","parsedPattern","CACHE","wrapRelativePattern","T1","base_1","T2","originalPattern","slashBase","backslashBase","basenames","patterns","allBasenames","trivia2","T3_2","T3","parsedPatterns","aggregateBasenameMatches","n_1","withBasenames","allPaths","all","trivia3","T4","trivia4and5","T5","regExp_1","toRegExp","arg2","extpath","matchPathEnds","nativePath","ALL_FORWARD_SLASHES","nativePathEnd","FALSE","isRelativePattern","parsedPattern_1","resultPattern","expression","getOwnPropertyNames","when_1","when","hasSibling","clausePattern","matched","requiresSiblings","parseExpressionPattern","some","resultExpression_1","n_2","withBasenames_1","allPaths_1","resultExpression","n_3","parsedExpression","rp","basenamePatterns","aggregate","aggregatedPatterns","registerTextMime","association","warnOnOverwrite","associationItem","mime","filename","extension","filepattern","firstline","userConfigured","filenameLowercase","extensionLowercase","filepatternLowercase","filepatternOnPath","toTextMimeAssociationItem","registeredAssociations","userRegisteredAssociations","nonUserRegisteredAssociations","guessMimeTypes","firstLine","MIME_UNKNOWN","configuredMime","guessMimeTypeByPath","MIME_TEXT","registeredMime","firstlineMime","registeredAssociations_1","guessMimeTypeByFirstline","associations","filenameMatch","patternMatch","extensionMatch","glob_1","isString","_typeof","string","isObject","isUndefined","isUndefinedOrNull","isFunction","function","validateConstraint","constraint","constructor","isBoolean","isEmptyObject","validateConstraints","constraints","getAllPropertyNames","proto","getPrototypeOf","withNullAsUndefined","withUndefinedAsNull","deepClone","_cloneAndChange","changer","types_1","changed","r1","obj_2","r2","i2","_hasOwnProperty","mixin","destination","overwrite","oneKeys","otherKeys","deepFreeze","obj_1","prop","isFrozen","cloneAndChange","assign","sources","getOrDefault","HighlightedLabel","supportOcticons","didEverRender","highlights","escapeNewLines","objects","htmlContent","substring_1","octiconLabel_1","innerHTML","extra","highlights_1","encodeURIComponentFast","uriComponent","allowSlash","nativeEncodePos","encodeTable","_makeFsPath","uri","authority","scheme","_asFormatted","skipEncoding","encoder","query","fragment","_slash","userinfo","_schemePattern","_singleSlashStart","_doubleSlashStart","_throwOnMissingSchema","_regexp","URI","schemeOrData","_strict","trace","_schemeFix","_referenceResolution","_validateUri","isUri","fsPath","with","_URI","components","revive","_fsPath","_formatted","external","$mid","uri_1","renderFormattedText","formattedText","_renderFormattedText","actionItemIndex","stream","StringStream","eos","isEscapedFormatType","formatTagType","isFormatTag","advance","newCurrent","textCurrent","parseFormattedText","actionHandler","renderMarkdown","markdown","signalInnerHTML","uris","part","marshalling_1","objects_1","stringify","_uriMassage","withInnerHTML","splitted","parameters","heightFromParams","widthFromParams","widthIsFinite","isFinite","heightIsFinite","attributes","htmlContent_1","codeBlockRenderer","idGenerator_1","strValue","span","querySelector","codeBlockRenderCallback","disposeables","DOM","dataset","markedOptions","treeNode","nodeChild","renderText","textContent","hasToIgnoreCase","network_1","isEqualAuthority","a1","a2","originalFSPath","uriPath","basenameOrAuthority","isEqual","p1","p2","joinPath","pathFragment","joinedPath","normalizePath","normalizedPath","relativePath","relativePath_1","DataUri","META_DATA_LABEL","META_DATA_DESCRIPTION","META_DATA_SIZE","META_DATA_MIME","parseMetaData","dataUri","metadata","property","hasDriveLetter","normalizeDriveLetter","tildify","userHome","normalizedUserHome","normalizedUserHomeCached","normalized","getPathLabel","userHomeProvider","rootProvider","baseResource","getWorkspaceFolder","hasMultipleRoots","getWorkspace","folders","pathLabel","resources_1","rootName","getBaseLabel","INITIALIZE","webWorkerWarningLogged","logOnceWebWorkerWarning","SimpleWorkerProtocol","_workerId","_lastSentReq","_pendingReplies","setWorkerId","workerId","sendMessage","method","_send","vsWorker","handleMessage","serializedMessage","_handleMessage","seq","replyMessage","reply","requestMessage","strMsg","SimpleWorkerClient","workerFactory","moduleId","lazyProxyReject","_worker","_protocol","postMessage","getId","loaderConfiguration","require","getConfig","requirejs","contexts","_onModuleLoaded","_lazyProxy","availableMethods","proxy","availableMethods_1","methodName","createProxyMethod","proxyMethodRequest","_onError","_request","getProxyObject","info","SimpleWorkerServer","postSerializedMessage","requestHandler","_requestHandler","onmessage","initialize","loaderConfig","methods","vs","catchError","handlerModule","DataSource","modelProvider","getModel","tree","dataSource","hasChildren","entries","getChildren","getParent","AccessibilityProvider","getAriaLabel","accessibilityProvider","getPosInSet","isVisible","getSetSize","Filter","styles","updateStyles","getHeight","getTemplateId","renderElement","ContextMenuEvent","_posx","_posy","_target","MouseContextMenuEvent","originalEvent","KeyboardContextMenuEvent","KeybindingDispatcher","_arr","dispatch","DefaultController","clickBehavior","keyboardSupport","openMode","downKeyBindingDispatcher","upKeyBindingDispatcher","onUp","onDown","onLeft","onRight","onPageUp","onPageDown","onHome","onEnd","onSpace","onEscape","onEnter","onMouseDown","origin","onLeftClick","onClick","eventish","payload","didClickOnTwistie","isClickOnTwistie","getInput","clearFocus","clearSelection","domFocus","setSelection","setFocus","shouldToggleExpansion","isExpanded","collapse","expand","isDoubleClick","openOnSingleClick","twistieStyle","backgroundImage","twistieWidth","paddingRight","onContextMenu","onTap","onKeyDown","onKey","onKeyUp","bindings","getHighlight","clearHighlight","focusPrevious","reveal","getFocus","focusPreviousPage","focusNext","focusNextPage","focusFirst","focusLast","focus_1","didCollapse","focusParent","focus_2","didExpand","focusFirstChild","toggleExpansion","getSelection","DefaultDragAndDrop","getDragURI","onDragOver","targetElement","drop","DefaultFilter","DefaultAccessibilityProvider","DefaultTreestyler","styleElement","selectorSuffix","listFocusBackground","listFocusForeground","listActiveSelectionBackground","listActiveSelectionForeground","listFocusAndSelectionBackground","listFocusAndSelectionForeground","listInactiveSelectionBackground","listInactiveSelectionForeground","listHoverBackground","listHoverForeground","listDropBackground","listFocusOutline","newStyles","ElementsDragAndDropData","ExternalElementsDragAndDropData","DesktopDragAndDropData","types","files","f","LockData","_onDispose","onDispose","_item","Lock","locks","isLocked","lock","getLock","isDisposed","ItemRegistry","_isDisposed","_onDidRevealItem","onDidRevealItem","_onExpandItem","onExpandItem","_onDidExpandItem","onDidExpandItem","_onCollapseItem","onCollapseItem","_onDidCollapseItem","onDidCollapseItem","_onDidAddTraitItem","onDidAddTraitItem","_onDidRemoveTraitItem","onDidRemoveTraitItem","_onDidRefreshItem","onDidRefreshItem","_onRefreshItemChildren","onRefreshItemChildren","_onDidRefreshItemChildren","onDidRefreshItemChildren","_onDidDisposeItem","onDidDisposeItem","register","isRegistered","disposable","onDidReveal","onExpand","onDidExpand","onCollapse","onDidCollapse","onDidAddTrait","onDidRemoveTrait","onDidRefresh","onRefreshChildren","onDidRefreshChildren","onDidDispose","deregister","getItem","Item","registry","_onDidCreate","_onDidReveal","_onExpand","_onDidExpand","_onCollapse","_onDidCollapse","_onDidAddTrait","_onDidRemoveTrait","_onDidRefresh","_onRefreshChildren","_onDidRefreshChildren","_onDidDispose","doesHaveChildren","needsChildrenRefresh","lastChild","traits","expanded","shouldAutoexpand","_getHeight","getElement","getDepth","setVisible","_setExpanded","relativeTop","eventData","refreshChildren","collapseChildrenPromise_1","forEachChild","addTrait","trait","removeTrait","hasTrait","getAllTraits","safe","force","setNeedsChildrenRefresh_1","doRefresh","isNested","staleItems","addChild","staleItemId","mapEachChild","updateVisibility","refresh","getNavigator","TreeNavigator","isAncestorOf","startItem","afterItem","atHead","atTail","isFirstChild","isLastChild","NaN","otherElement","RootItem","subTreeOnly","lastDescendantOf","TreeModel","_onSetInput","onSetInput","_onDidSetInput","onDidSetInput","_onRefresh","onRefresh","_onDidHighlight","onDidHighlight","_onDidSelect","onDidSelect","input","traitsToItems","setInput","setHighlight","registryDisposable","resolveUnknownParentChain","eventPayload","setTraits","includeHidden","getElementsWithTrait","selection","nextItem","nav","previousItem","focusNth","navItem","fromItem","removeTraits","traitItems","itemsToRemoveTrait","HeightMap","heightMap","indexes","onInsertItems","afterItemId","viewItem","totalSize","sizeDiff","boundSplice","itemsToInsert","createViewItem","onInsertItem","onRefreshItem","onRemoveItems","itemId","onRemoveItem","onRefreshItemSet","sortedItems","onRefreshItems","newHeight","cummDiff","needsRender","center","itemAtIndex","itemAfter","WebWorker","onMessageCallback","onErrorCallback","workerOrPromise","MonacoEnvironment","getWorker","getWorkerUrl","Worker","workerMain","currentUrl","currentOrigin","search","pathname","js","isPromiseLike","worker","onmessageerror","terminate","DefaultWorkerFactory","_webWorkerFailedBeforeError","LAST_WORKER_ID","simpleWorker_1","defaultOpts","inputActiveOptionBorder","color_1","Checkbox","_onKeyDown","_opts","isChecked","actionClassName","tabIndex","applyStyles","keyboardEvent","newIsChecked","borderColor","enable","disable","layout","viewSize","anchorEnd","ContextView","setContainer","toDisposeOnSetContainer","toDisposeOnSetContainer_1","BUBBLE_UP_EVENTS","onDOMEvent","BUBBLE_DOWN_EVENTS","delegate","toDisposeOnClean","doLayout","canRelayout","around","getAnchor","elementPosition","realAnchor","horizontalAnchor","viewSizeWidth","viewSizeHeight","anchorPosition","anchorAlignment","verticalAnchor","pageYOffset","innerHeight","innerWidth","containerPosition","onHide","onCapture","badgeBackground","badgeForeground","CountBadge","badgeBorder","countFormat","titleFormat","setCount","setTitleFormat","background","foreground","backgroundColor","borderWidth","borderStyle","FastLabelNode","_element","_textContent","marginLeft","IconLabel","labelDescriptionContainer","supportHighlights","labelNode","highlightedLabel_1","donotSupportOcticons","supportDescriptionHighlights","descriptionNodeFactory","setLabel","extraClasses","italic","labelEscapeNewLines","descriptionNode","descriptionMatches","descriptionTitle","progressBarBackground","ProgressBar","workedVal","showDelayedScheduler","bit","off","opacity","totalWork","doDone","delayed","DEBUG","Sash","layoutProvider","_onDidEnablementChange","onDidEnablementChange","_onDidStart","onDidStart","_onDidReset","onDidReset","_onDidEnd","onDidEnd","linkedSash","orthogonalStartSashDisposables","orthogonalEndSashDisposables","onMouseDoubleClick","touch_1","browser_1","setOrientation","orientation","hidden","orthogonalStartSash","orthogonalEndSash","_orthogonalStartSash","sash","onOrthogonalStartSashEnablementChange","_orthogonalEndSash","onOrthogonalEndSashEnablementChange","isMultisashResize","__linkedSashEvent","__orthogonalSashEvent","orthogonalSash","clientHeight","clientWidth","iframes_1","pointerEvents","mouseDownEvent","startX","startY","startEvent","currentX","currentY","updateStyle","cursor","mouseMoveEvent","iframes_2","verticalProvider","getVerticalSashLeft","getVerticalSashTop","getVerticalSashHeight","horizontalProvider","getHorizontalSashTop","getHorizontalSashLeft","getHorizontalSashWidth","resolveOptions","useShadows","handleMouseWheel","flipAxes","alwaysConsumeMouseWheel","scrollYToX","mouseWheelScrollSensitivity","fastScrollSensitivity","mouseWheelSmoothScroll","listenOnDomNode","MouseWheelClassifierItem","MouseWheelClassifier","_capacity","_memory","_front","_rear","isPhysicalMouseWheel","remainingInfluence","iteration","influence","accept","_computeScore","AbstractScrollableElement","overflow","_onDidScroll","scrollbarHost","mouseWheelEvent","_onMouseWheel","_onDragStart","_onDragEnd","_verticalScrollbar","verticalScrollbar_1","_horizontalScrollbar","horizontalScrollbar_1","_leftShadowDomNode","_topShadowDomNode","_topLeftShadowDomNode","_listenOnDomNode","_mouseWheelToDispose","_setListeningToMouseWheel","_onMouseOver","_onMouseOut","_hideTimeout","_isDragging","_mouseIsOver","_revealOnScroll","getDomNode","getOverviewRulerLayoutInfo","delegateVerticalScrollbarMouseDown","updateClassName","newClassName","updateOptions","newOptions","massagedOptions","_render","shouldListen","classifier","shiftConvert","futureScrollPosition","desiredScrollTop","desiredScrollLeft","renderNow","scrollState","enableTop","enableLeft","_scheduleHide","ScrollableElement","scrollable_1","SmoothScrollableElement","DomScrollableElement","scanDomNode","DefaultOptions","verticalScrollMode","setRowLineHeight","supportDynamicHeights","dnd","getDragElements","horizontalScrolling","ListView","virtualDelegate","domId","InstanceCount","renderWidth","scrollableElementUpdateDisposable","scrollableElementWidthDelayer","splicing","dragOverAnimationStopDisposable","canUseTranslate3d","canDrop","currentDragFeedbackDisposable","onDragLeaveTimeout","_onDidChangeContentHeight","rangeMap","rangeMap_1","renderers_1","rowCache_1","lastRenderTop","lastRenderHeight","mouseSupport","ariaSetProvider","rowsContainer","scrollableElement","scrollableElement_1","gesture","onTouchChange","toDragEvent","onDrop","onDragLeave","_splice","contentHeight","previousRenderRange","getRenderRange","deleteRange","removeRange","removeItemFromDOM","deleted","previousRestRange","previousRenderedRestRange","previousUnrenderedRestRanges","inserted","hasDynamicHeight","lastDynamicHeightWidth","dropTarget","dragStartDisposable","renderRange","renderedRestRange","updateRange","updateItemInDOM","removeRanges_1","unrenderedRestRanges","insertRanges","beforeElement","getNextToLastElement","insertRanges_1","insertItemInDOM","eventuallyUpdateScrollDimensions","_rerender","renderHeight","_scrollHeight","updateScrollWidth","eventuallyUpdateScrollWidth","domElement","elementHeight","elementTop","scrollDimensions","renderTop","renderLeft","rangesToInsert","rangesToRemove","rangesToInsert_1","rangesToRemove_1","transform","webkitTransform","draggable","measureItemWidth","paddingLeft","getElementDomId","disposeElement","getScrollTop","setScrollTop","toMouseEvent","toTouchEvent","toGestureEvent","getItemIndexFromEventTarget","effectAllowed","setData","dnd_1","setDragImage","getDragLabel","dragImage_1","currentDragData","setupDragAndDropScrollTopAnimation","currentDragFeedback","dropEffect","effect","feedback","f1","f2","equalsDragFeedback","feedback_1","feedback_2","clearDragOverFeedback","dragData","teardownDragAndDropScrollTopAnimation","dragOverAnimationDisposable","viewTop","animateDragAndDropScrollTop","dragOverMouseY","upperLimit","rawIndex","anchorElementIndex","anchorElementTopDelta","heightDiff","didChange","probeDynamicHeight","unrenderRanges_1","renderRanges_1","afterIndex","beforeRow","setDynamicHeight","ranges","lastRange","nextToLastItem","_cache","","ViewItem","unbindDragStart","Lifecycle","_styles","_draggable","_templateId","skipUserRender","accessibility","ariaLabel","base64Id","paddingOnRow","twistiePixels","indentPixels","firstElementChild","insertInDOM","afterElement","TreeView","BINDING","removeFromDOM","RootViewItem","wrapper","lastClickTimeStamp","contentWidthUpdateDelayer","isRefreshing","refreshingPreviousChildrenIds","currentDragAndDropData","currentDropTarget","currentDropTargets","currentDropDisposable","dragAndDropScrollInterval","dragAndDropScrollTimeout","dragAndDropMouseY","onHiddenScrollTop","_onDOMFocus","_onDOMBlur","counter","instance","horizontalScrollMode","controller","modelListeners","viewListeners","preventRootFocus","treeStyler","styler","treeDefaults_1","alwaysFocused","Browser","msTouchAction","msContentZooming","Touch","showTwistie","focusTracker","onFocus","onBlur","onMouseUp","onMouseMiddleClick","onMsPointerDown","onMsGestureTap","onThrottledMsGestureChange","didJustPressContextMenuKey","shouldInvalidateDropReaction","onRowsChanged","setupMSGesture","getHTMLElement","isFocused","blur","MSGesture","msGesture","isTreeVisible","viewHeight","viewWidth","renderBottom","thisRenderBottom","topItem","setModel","newModel","releaseModel","onRefreshing","onRefreshed","onClearingInput","onModelFocusChange","onItemChildrenRefreshing","onItemChildrenRefreshed","onItemRefresh","onItemExpanding","onItemExpanded","onItemCollapsing","onItemReveal","onItemAddTrait","onItemRemoveTrait","keys_1","lastPageIndex","lastPageElement","previousScrollTop","firstPageIndex","firstPageElement","inputItem","showLoading","loadingTimer","loading","LOADING_DECORATION_DELAY","childrenIds","navigator_1","childItem","previousChildrenIds_1","afterModelItems_1","navigator_2","skipDiff","doToInsertItemsAlreadyExist","Diff","diff_1","diffChange","beforeItem","onItemsRefresh","viewItemBottom","wrapperBottom","highlightedItemWasDraggable","refreshViewItem","shouldBeRendered","lastPointerType","Mouse","getItemAround","Platform","resultEvent","KeyboardEvent","Keyboard","mouseEvent","setupDragAndDropScrollInterval","scrollDiff","cancelDragAndDropScrollTimeout","cancelDragAndDropScrollInterval","currentDropElement","reaction","bubble","reactionEquals","currentDropElementReaction","autoExpand","timeoutPromise_1","pointerType","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_TOUCH","addPointer","pointerId","elementFromPoint","elementAfter","treeViewModel_1","State","defaultStyles","separatorBorder","Sizing","Distribute","Split","SplitView","contentSize","proportions","viewItems","sashItems","Idle","_onDidSashChange","onDidSashChange","_onDidSashReset","inverseAltBehavior","proportionalLayout","sashContainer","viewContainer","removeProperty","setProperty","addView","Busy","onChangeDisposable","onViewChange","containerDisposable","layoutContainer","getViewSize","minimumSize","orientation_1","getSashPosition","sash_2","sash_1","sashEventMapper","alt","onStartDisposable","onStart","onSashStart","onChangeDisposable_1","onChange","onSashChange","onEndDisposable","onSashEnd","onDidResetDisposable","disposable_1","sashItem","highPriorityIndex","relayout","distributeViewSizes","lowPriorityIndex","lowPriorityIndexes","highPriorityIndexes","resize","distributeEmptySpace","layoutViews","saveProportions","previousSize","numbers_1","maximumSize","resetSashDragState","sashDragState","sizes","minDelta","NEGATIVE_INFINITY","maxDelta","newDelta","isLastSash","newSizes","viewItemIndex","newMinDelta","newMaxDelta","resizeIndex","resizeView","downIndexes","collapseDown","expandDown","deltaDown","upIndexes","collapseUp","expandUp","deltaUp","overloadMinDelta","overloadMaxDelta","highPriorityIndexes_1","index_1","lowPriorityIndexes_1","index_2","upItems","upSizes","downItems","downSizes","minDeltaUp","maxDeltaUp","maxDeltaDown","minDeltaDown","viewDelta","emptyDelta","collapsesDown","expandsDown","reverseViews","collapsesUp","expandsUp","TreeContext","configuration","TreeDefaults","Tree","_onDidChangeFocus","onDidChangeFocus","_onDidChangeSelection","onDidChangeSelection","_onHighlightChange","Model","View","onDOMFocus","isDOMFocused","domBlur","CharWidthRequest","chr","fulfill","DomCharWidthReader","bareFontInfo","requests","_bareFontInfo","_requests","_container","_testElements","read","_createDomElements","_readFromDomElements","regularDomNode","getMassagedFontFamily","boldDomNode","italicDomNode","fontStyle","testElements","request","testElement","htmlString","testString","readCharWidths","ElementSizeObserver","referenceDomElement","changeCallback","measureReferenceDomElementToken","measureReferenceDomElement","stopObserving","getWidth","startObserving","observe","dimension","callChangeCallback","observedWidth","observedHeight","EditorState","editor","modelVersionId","getVersionId","getPosition","getScrollLeft","_equals","equalsRange","validate","EditorStateCancellationTokenSource","_listener","onDidChangeCursorPosition","onDidChangeCursorSelection","onDidScrollChange","onDidChangeModel","onDidChangeModelContent","TextModelCancellationTokenSource","onDidChangeContent","StableEditorScrollState","_visiblePosition","_visiblePositionScrollDelta","capture","visiblePosition","visiblePositionScrollDelta","visibleRanges","getVisibleRanges","getStartPosition","visiblePositionScrollTop","getTopForPosition","lineNumber","column","restore","createEditorPagePosition","editorViewDomNode","editorPos","EditorPagePosition","PageCoordinates","toClientCoordinates","ClientCoordinates","toPageCoordinates","EditorMouseEvent","EditorMouseEventFactory","_editorViewDomNode","_create","onMouseLeave","onMouseMoveThrottled","merger","GlobalEditorMouseMoveMonitor","_globalMouseMoveMonitor","_keydownListener","AbstractCodeEditorService","_onCodeEditorAdd","onCodeEditorAdd","_onCodeEditorRemove","_onDiffEditorAdd","_onDiffEditorRemove","_codeEditors","_diffEditors","addCodeEditor","removeCodeEditor","listCodeEditors","addDiffEditor","removeDiffEditor","listDiffEditors","getFocusedCodeEditor","editorWithWidgetFocus","editors_1","hasTextFocus","hasWidgetFocus","EditorZoom","setZoomLevel","zoomLevel","Position","newLineNumber","newColumn","deltaLineNumber","deltaColumn","isBefore","isBeforeOrEqual","aLineNumber","bLineNumber","lift","isIPosition","startLineNumber","startColumn","endLineNumber","endColumn","containsPosition","containsRange","otherRange","plusRange","intersectRanges","resultStartLineNumber","resultStartColumn","resultEndLineNumber","resultEndColumn","otherStartLineNumber","otherStartColumn","otherEndLineNumber","otherEndColumn","getEndPosition","position_1","setEndPosition","setStartPosition","collapseToStart","fromPositions","isIRange","areIntersectingOrTouching","areIntersecting","compareRangesUsingStarts","aStartLineNumber","bStartLineNumber","aStartColumn","bStartColumn","aEndLineNumber","bEndLineNumber","compareRangesUsingEnds","spansMultipleLines","TextAreaState","selectionStart","selectionEnd","selectionStartPosition","selectionEndPosition","readFromTextArea","textArea","getSelectionStart","getSelectionEnd","collapseSelection","writeToTextArea","reason","select","setValue","setSelectionRange","deduceEditorPosition","_finishDeduceEditorPosition","str1","str2","deltaText","signum","lineFeedCnt","lastLineFeedIndex","selectedText","deduceInput","previousState","currentState","couldBeEmojiInput","couldBeTypingAtOffset0","replaceCharCnt","previousValue","previousSelectionStart","previousSelectionEnd","currentValue","currentSelectionStart","currentSelectionEnd","previousSuffix","currentSuffix","suffixLength","previousPrefix","currentPrefix","prefixLength","potentialEmojiInput","EMPTY","PagedScreenReaderStrategy","_getPageOfLine","_LINES_PER_PAGE","_getRangeForPage","page","fromEditorSelection","trimLongText","selectionStartPage","selectionStartPageRange","selectionEndPage","selectionEndPageRange","pretextRange","pretext","getValueInRange","lastLine","getLineCount","lastLineMaxColumn","getLineMaxColumn","posttextRange","posttext","selectionRange1","selectionRange2","defaultOptions","followsCaret","ignoreCharChanges","alwaysRevealFirst","DiffNavigator","_onDidUpdate","_editor","_disposables","nextIdx","ignoreSelectionChange","revealFirst","onDidUpdateDiff","_onDiffUpdated","getModifiedEditor","_init","getLineChanges","_compute","lineChanges","lineChange","charChanges","charChange","rhs","modifiedStartLineNumber","modifiedStartColumn","modifiedEndLineNumber","modifiedEndColumn","_initIdx","fwd","found","_move","scrollType","assert","canNavigate","revealPositionInCenter","EditOperation","insert","forceMoveMarkers","replaceMove","trimTrailingWhitespace","cursors","rLen","cursorIndex","cursorLen","lineCount","lineContent","getLineContent","maxLineColumn","minEditColumn","fromColumn","editOperation_1","TrimTrailingWhitespaceCommand","getEditOperations","builder","ops","op","addEditOperation","selectionId","trackSelection","computeCursorState","helper","getTrackedSelection","RGBA8","_clamp","Empty","Selection","selectionStartLineNumber","selectionStartColumn","positionLineNumber","positionColumn","equalsSelection","selectionsEqual","getDirection","liftSelection","sel","selectionsArrEqual","isISelection","createWithDirection","CopyOptions","forceCopyWithSyntaxHighlighting","TextAreaInput","_onFocus","_onBlur","_onKeyUp","_onCut","onCut","_onPaste","onPaste","_onType","onType","_onCompositionStart","onCompositionStart","_onCompositionUpdate","onCompositionUpdate","_onCompositionEnd","onCompositionEnd","_onSelectionChangeRequest","onSelectionChangeRequest","_textArea","TextAreaWrapper","_lastTextAreaEvent","_asyncTriggerCut","_textAreaState","textAreaState_1","writeScreenReaderContent","_hasFocus","_isDoingComposition","_nextCommand","_setAndWriteTextAreaState","deduceInputFromTextAreaValue","deduceComposition","compositionDataInValid","newState_1","typeInput_1","typeInput","previousEventWasFocus","setIgnoreSelectionChangeTime","_ensureClipboardGetsEditorSelection","ClipboardEventUtils","canUseTextData","pastePlainText","getTextData","_setHasFocus","_installSelectionChangeListener","previousSelectionChangeEventTime","delta1","delta2","getIgnoreSelectionChangeTime","resetSelectionChangeTime","newValue","newSelectionStart","newSelectionEnd","_newSelectionStartPosition","newSelectionStartPosition","deduceModelPosition","_newSelectionEndPosition","newSelectionEndPosition","newSelection","selection_1","_selectionChangeListener","focusTextArea","newHasFocus","textAreaState","getScreenReaderContent","copyPlainText","getPlainTextToCopy","copyHTML","getHTMLToCopy","setTextData","clipboardData","richText","_actual","_ignoreSelectionChangeTime","currentIsFocused","ReplaceCommand","insertsAutoWhitespace","_range","_text","addTrackedEditOperation","srcRange","getInverseEditOperations","ReplaceCommandWithoutChangingPosition","ReplaceCommandWithOffsetCursorState","lineNumberDeltaOffset","columnDeltaOffset","_columnDeltaOffset","_lineNumberDeltaOffset","ReplaceCommandThatPreservesSelection","editRange","initialSelection","_initialSelection","_selectionId","SurroundSelectionCommand","charBeforeSelection","charAfterSelection","_charBeforeSelection","_charAfterSelection","inverseEditOperations","firstOperationRange","secondOperationRange","TextDecoder","createStringBuilder","capacity","StringBuilder","CompatStringBuilder","_decoder","Uint16Array","_completedStrings","_bufferLength","build","_flushBuffer","_buildBuffer","decode","bufferString","write1","remainingSpace","appendASCII","appendASCIIString","strLen","_pieces","_piecesLen","RenderedLinesCollection","createLine","_createLine","_set","rendLineNumberStart","lines","_lines","_rendLineNumberStart","_get","getStartLineNumber","getEndLineNumber","getCount","getLine","lineIndex","onLinesDeleted","deleteFromLineNumber","deleteToLineNumber","deleteCnt","deleteStartIndex","deleteAboveCount","onLinesChanged","changeFromLineNumber","changeToLineNumber","someoneNotified","changedLineNumber","onContentChanged","onLinesInserted","insertFromLineNumber","insertToLineNumber","insertCnt","newLines","beforeLines","afterLines","deletedLines","onTokensChanged","notifiedSomeone","rng","toLineNumber","fromLineNumber","VisibleLinesCollection","_createDomNode","_linesCollection","createVisibleLine","onConfigurationChanged","layoutInfo","onFlushed","lineDomNode","onScrollChanged","onZonesChanged","getVisibleLine","renderLines","viewportData","inp","ViewLayerRenderer","linesLength","resCtx","relativeVerticalOffset","inContext","stopLineNumber","deltaTop","_finishRendering","_renderUntouchedLines","_insertLinesBefore","removeCnt","_removeLinesBefore","_insertLinesAfter","_removeLinesAfter","endIndex","deltaLN","layoutLine","newLinesLen","removeCount","removeIndex","_finishRenderingNewLines","domNodeIsEmpty","newLinesHTML","wasNew","insertAdjacentHTML","currChild","line","previousSibling","_finishRenderingInvalidLines","invalidLinesHTML","wasInvalid","hugeDomNode","replaceChild","sb","_sb","hadNewLine","renderResult","renderLine","hadInvalidLine","stringBuilder_1","Token","TokenizationResult","endState","TokenizationResult2","toUint32","Uint8Matrix","rows","cols","Uint8Array","col","toUint8","toUint32Array","Uint32Array","CharacterClassifier","_defaultValue","uint_1","_asciiMap","_createAsciiMap","asciiMap","CharacterSet","WordCharacterClassifier","characterClassifier_1","getMapForWordSeparators","computeFn","computeDiff","modifiedSequence","MAXIMUM_RUN_TIME","MINIMUM_MATCHING_CHARACTER_LENGTH","LineMarkerSequence","startColumns","endColumns","_getFirstNonBlankColumn","_getLastNonBlankColumn","_startColumns","_endColumns","txt","getCharSequence","shouldIgnoreTrimWhitespace","charCodes","lineNumbers","columns","CharSequence","_charCodes","_lineNumbers","_columns","getStartColumn","getEndColumn","CharChange","originalStartLineNumber","originalStartColumn","originalEndLineNumber","originalEndColumn","createFromDiffChange","originalCharSequence","modifiedCharSequence","LineChange","createFromDiffResult","originalLineSequence","modifiedLineSequence","shouldComputeCharChanges","shouldPostProcessCharChanges","rawChanges","currChange","originalMatchingLength","modifiedMatchingLength","postProcessCharChanges","length_2","DiffComputer","originalLines","modifiedLines","shouldMakePrettyDiff","maximumRunTimeMs","computationStartTime","_continueProcessingPredicate","length_3","originalLineIndex","modifiedLineIndex","nextChange","originalLine","modifiedLine","originalChar","modifiedChar","_pushTrimWhitespaceCharChange","originalMaxColumn","modifiedMaxColumn","originalLineNumber","modifiedLineNumber","_mergeTrimWhitespaceCharChange","InternalEditorAction","alias","precondition","contextKeyService","_precondition","_run","_contextKeyService","isSupported","contextMatchesRules","isThemeColor","EditorType","ICodeEditor","IDiffEditor","Handler","ExecuteCommand","ExecuteCommands","Type","ReplacePreviousChar","CompositionStart","CompositionEnd","Paste","Cut","Undo","Redo","isCodeEditor","getEditorType","editorCommon","OverviewRulerLane","TextModelResolvedOptions","tabSize","indentSize","insertSpaces","defaultEOL","trimAutoWhitespace","createChangeEvent","newOpts","FindMatch","ApplyEditsResult","reverseEdits","trimAutoWhitespaceLineNumbers","getModelEOL","getEOL","EditStackElement","beforeVersionId","beforeCursorState","afterCursorState","afterVersionId","editOperations","undo","operations","applyEdits","redo","EOLStackElement","setEOL","eol","redoEOL","undoEOL","EditStack","currentOpenStackElement","past","future","pushStackElement","pushEOL","prevEOL","stackElement","getAlternativeVersionId","pushEditOperation","cursorStateComputer","inverseEditOperation","_computeCursorState","pastStackElement","selections","recordedVersionId","canUndo","futureStackElement","canRedo","spacesDiff","aLength","bLength","looksLikeAlignment","aCharCode","bCharCode","aSpacesCnt","aTabsCount","bSpacesCnt","bTabsCount","tabsDiff","SpacesDiffResult","guessIndentation","defaultTabSize","defaultInsertSpaces","linesCount","linesIndentedWithTabsCount","linesIndentedWithSpacesCount","previousLineText","previousLineIndentation","spacesDiffCount","tmp","currentLineLength","getLineLength","currentLineText","useCurrentLineText","currentLineHasContent","currentLineIndentation","currentLineSpacesCount","currentLineTabsCount","lenJ","getLineCharCode","currentSpacesDiff","tabSizeScore","possibleTabSize","possibleTabSizeScore","getNodeColor","setNodeColor","getNodeIsVisited","setNodeIsVisited","getNodeIsForValidation","setNodeIsForValidation","setNodeIsInOverviewRuler","_setNodeStickiness","stickiness","setCollapseOnReplaceEdit","adjustMarkerBeforeColumn","markerOffset","markerStickToPreviousCharacter","checkOffset","moveSemantics","nodeAcceptEdit","textLength","nodeStickiness","getNodeStickiness","startStickToPreviousCharacter","endStickToPreviousCharacter","deletingCnt","insertingCnt","commonLength","nodeStart","startDone","nodeEnd","endDone","getCollapseOnReplaceEdit","rbTreeInsert","T","SENTINEL","z","zAbsoluteStart","zAbsoluteEnd","intervalCompare","maxEnd","treeInsert","recomputeMaxEndWalkToRoot","leftRotate","rightRotate","rbTreeDelete","requestNormalizeDelta","leftest","detach","resetSentinel","recomputeMaxEnd","yWasRed","computeMaxEnd","leftMaxEnd","rightMaxEnd","aStart","aEnd","bStart","bEnd","getNodeIsInOverviewRuler","IntervalNode","ownerId","cachedVersionId","cachedAbsoluteStart","cachedAbsoluteEnd","versionId","overviewRuler","collapseOnReplaceEdit","setCachedOffsets","absoluteStart","absoluteEnd","IntervalTree","intervalSearch","filterOwnerId","filterOutValidation","intervalStart","intervalEnd","resultLen","include","collectNodesFromOwner","collectNodesPostOrder","_normalizeDeltaIfNecessary","resolveNode","initialNode","acceptReplace","nodesOfInterest","searchForEditing","editDelta","noOverlapReplace","normalizeDelta","righttest","calculateSize","size_left","piece","calculateLF","lf_left","updateTreeMetadata","lineFeedCntDelta","recomputeTreeMetadata","lf_delta","TreeNode","rbDelete","newSizeLeft","newLFLeft","fixInsert","ModelRawFlush","changeType","ModelRawLineChanged","ModelRawLinesDeleted","ModelRawLinesInserted","ModelRawEOLChanged","ModelRawContentChangedEvent","isUndoing","isRedoing","containsEvent","InternalModelContentChangeEvent","rawContentChangedEvent","contentChangedEvent","_mergeChangeEvents","isFlush","isMultilineRegexSource","nextChCode","createFindMatch","rawMatches","captureMatches","model_1","isValidMatch","matchStartIndex","matchLength","charBefore","firstCharInMatch","leftIsWordBounday","charAfter","lastCharInMatch","rightIsWordBounday","SearchParams","parseSearchRequest","canUseSimpleSearch","SearchData","wordCharacterClassifier_1","simpleSearch","LineFeedCounter","lineFeedsOffsets","lineFeedsOffsetsLen","textLen","_lineFeedsOffsets","findLineFeedCountBeforeOffset","TextModelSearch","findMatches","searchParams","searchRange","limitResultCount","searchData","_doFindMatchesMultiline","Searcher","_doFindMatchesLineByLine","_getMultilineMatchRange","deltaOffset","lfCounter","matchIndex","match0","startOffset","lineFeedCountBeforeMatch","endOffset","lineFeedCountInMatch","startPosition","getPositionAt","endPosition","searcher","getOffsetAt","text_1","_findMatchesInLine","text_2","searchStringLen","lastMatchIndex","findNextMatch","searchStart","_doFindNextMatchMultiline","_doFindNextMatchLineByLine","searchTextStart","_findFirstMatchInLine","text_3","r_1","findPreviousMatch","_doFindPreviousMatchMultiline","_doFindPreviousMatchLineByLine","_findLastMatchInLine","text_4","r_2","bestResult","searchRegex","_wordSeparators","_searchRegex","_prevMatchStartIndex","_prevMatchLength","createUintArray","createLineStartsFast","readonly","rLength","AverageBufferSize","LineStarts","lineStarts","cr","lf","crlf","createLineStarts","Piece","bufferIndex","StringBuffer","PieceTreeSearchCache","nodePos","nodeStartOffset","get2","nodeStartLineNumber","nodePosition","valdiate","hasInvalidVal","newArr","tmp_1","PieceTreeBase","chunks","eolNormalized","_buffers","_lastChangeBufferPos","rbTreeBase_1","_lineCnt","_length","_EOL","_EOLLength","_EOLNormalized","lastNode","rbInsertRight","_searchCache","_lastVisitedLine","computeBufferMetadata","normalizeEOL","averageBufferSize","tempChunk","tempChunkLen","iterate","getNodeContent","newEOL","leftLen","getAccumulatedValue","lfCnt","originalOffset","getIndexOf","lineStartOffset","remainder","nodeAt2","getValueInRange2","buffer_1","startOffset_1","offsetInBuffer","buffer_2","startOffset_2","getLinesContent","getContentOfSubTree","getLineRawContent","matchingNode","targetOffset","findMatchesInNode","startCursor","endCursor","startOffsetInBuffer","positionInBuffer","getLineFeedCnt","retStartColumn","retEndColumn","textModelSearch_1","findMatchesLineByLine","startPostion","currentNode","lineBreakCnt","nextLineStartOffset","startColumn_1","startColumn_2","startColumn_3","nodeAt","insertPosInBuffer","appendToNode","insertContentToNodeLeft","nodesToDel","newRightPiece","shouldCheckCRLF","endWithCR","nodeCharCodeAt","newStart","startWithLF","previousPos","deleteNodeTail","newPieces","createNewPieces","tmpNode","k","deleteNodes","insertContentToNodeRight","pieces","rbInsertLeft","cnt","startNode","endNode","startSplitPosInBuffer_1","endSplitPosInBuffer_1","validateCRLFWithPrevNode","deleteNodeHead","validateCRLFWithNextNode","shrinkNode","startSplitPosInBuffer","endSplitPosInBuffer","nPiece","adjustCarriageReturnFromNext","midStop","midStart","previousCharOffset","lastChar","splitText","lineStarts_1","lineStarts_2","endPos","newPiece","prevAccumualtedValue","accumualtedValue","accumulatedValue","lineCnt","realLineCnt","expectedLineStartIndex","originalLFCnt","originalEndOffset","newEnd","newEndOffset","newLineFeedCnt","size_delta","newLength","originalStartOffset","originalStartPos","originalEndPos","oldLength","oldLFCnt","hitCRLF","prevStartOffset","oldLineFeedCnt","nodeStartOffset_1","offsetOfNode","newOffset","nextNode","fixCRLF","prevNewLength","prevNewLFCnt","leftRet","prevNode","PieceTreeTextBuffer","BOM","_BOM","_mightContainNonBasicASCII","_mightContainRTL","_pieceTree","pieceTreeBase_1","mightContainRTL","mightContainNonBasicASCII","getBOM","getRangeAt","lineEnding","_getEndOfLine","getValueLengthInRange","getLineFirstNonWhitespaceColumn","getLineLastNonWhitespaceColumn","rawOperations","recordTrimAutoWhitespace","canReduceOperations","_isTracked","validatedRange","sortIndex","rangeOffset","rangeLength","isAutoWhitespaceEdit","_sortOpsAscending","hasTouchingRanges","rangeEnd","nextRangeStart","_reduceOperations","reverseRanges","_getInverseEditRanges","newTrimAutoWhitespaceCandidates","reverseRange","currentLineContent","oldContent","reverseOperations","contentChanges","_doApplyEdits","prevContent","_toSingleEditOperation","firstEditRange","lastEditRange","entireEditRange","lastEndLineNumber","lastEndColumn","operation","_sortOpsDescending","deletingLinesCnt","insertingLinesCnt","editingLinesCnt","newLinesContent","contentChangeRange","prevOpEndLineNumber","prevOpEndColumn","prevOp","resultRange","PieceTreeTextBufferFactory","_chunks","_bom","_cr","_lf","_crlf","_containsRTL","_isBasicASCII","_normalizeEOL","_getEOL","totalEOLCount","totalCRCount","newLineStart","pieceTreeTextBuffer_1","PieceTreeTextBufferBuilder","_hasPreviousChar","_previousChar","_tmpLineStarts","acceptChunk","chunk","_acceptChunk1","allowEmptyStrings","_acceptChunk2","finish","_finish","lastChunk","newLineStarts","USUAL_WORD_SEPARATORS","DEFAULT_WORD_REGEXP","allowInWords","USUAL_WORD_SEPARATORS_1","createWordRegExp","ensureValidWordDefinition","wordDefinition","getWordAtText","textOffset","getWordAtPosSlow","getWordAtPosFast","FrankensteinMode","languageIdentifier","_languageIdentifier","IndentAction","StandardAutoClosingPairConditional","close","_standardTokenMask","notIn","isOK","standardToken","candidateUri","candidateLanguage","candidateIsSynchronized","selector_1","hasAccessToAllModels","StateMachine","edges","maxCharCode","maxState","states","_states","_maxCharCode","nextState","_stateMachine","_classifier","LinkComputer","_createLink","linkBeginIndex","linkEndIndex","lastIncludedCharIndex","charCodeBeforeLink","lastCharCodeInLink","computeLinks","stateMachine","getClassifier","linkBeginChCode","hasOpenParens","hasOpenSquareBracket","hasOpenCurlyBracket","resetStateMachine","chClass","createScopedLineTokens","tokenCount","tokenIndex","findTokenIndexAtOffset","desiredLanguageId","getLanguageId","lastTokenIndex","firstTokenIndex","ScopedLineTokens","getStartOffset","getEndOffset","languageId","firstCharOffset","lastCharOffset","_firstTokenIndex","_lastTokenIndex","_lastCharOffset","getTokenCount","getStandardTokenType","ignoreBracketsInToken","standardTokenType","CharacterPairSupport","autoClosingPairs","_autoClosingPairs","languageConfiguration_1","brackets","_autoCloseBefore","autoCloseBefore","DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED","_surroundingPairs","surroundingPairs","getAutoClosingPairs","getAutoCloseBeforeSet","shouldAutoClosePair","character","autoClosingPair","getSurroundingPairs","IndentRulesSupport","indentationRules","_indentationRules","shouldIncrease","increaseIndentPattern","shouldDecrease","decreaseIndentPattern","shouldIndentNextLine","indentNextLinePattern","shouldIgnore","unIndentedLinePattern","getIndentMetadata","BasicInplaceReplace","_defaultValueSet","navigateValueSet","range1","text1","range2","text2","up","doNavigateValueSet","numberResult","numberReplace","textReplace","precision","n1","n2","valueSetsReplace","valueSets","valueSetReplace","valueSet","OnEnterSupport","_brackets","bracket","openRegExp","_createOpenBracketRegExp","closeRegExp","_createCloseBracketRegExp","_regExpRules","regExpRules","oneLineAboveText","beforeEnterText","afterEnterText","rule","reg","beforeText","afterText","indentAction","IndentOutdent","Indent","_safeRegExp","prepareBracketForRegExp","insertWordBoundaries","createBracketOrRegExp","regexStr","RichEditBracket","forwardRegex","reversedRegex","RichEditBrackets","getRegexForBracketPair","getReversedRegexForBracketPair","getRegexForBrackets","getReversedRegexForBrackets","textIsBracket","textIsOpenBracket","maxBracketLength","toReversedString","lastInput","lastOutput","reversedStr","BracketsUtils","_findPrevBracketInText","reversedBracketRegex","reversedText","matchOffset","absoluteMatchOffset","findPrevBracketInToken","lineText","currentTokenStart","currentTokenEnd","reversedTokenText","findNextBracketInText","bracketRegex","findNextBracketInToken","currentTokenText","BracketElectricCharacterSupport","richEditBrackets","autoClosePairs","contribution","_richEditBrackets","_complexAutoClosePairs","pair","docComment","getElectricCharacters","bracketPair","onElectricCharacter","_onElectricAutoClose","_onElectricAutoIndent","supports_1","richEditBrackets_1","bracketText","textBeforeBracket","matchOpenBracket","lastTokenStandardType","RichEditSupport","rawConf","_electricCharacter","_conf","_mergeConf","_handleOnEnter","comments","_handleComments","characterPair","characterPair_1","wordPattern","wordHelper_1","indentRulesSupport","indentRules_1","foldingRules","folding","electricCharacter_1","__electricCharacterSupport","onEnterRules","conf","onEnter_1","commentRule","lineComment","lineCommentToken","blockComment","blockStart","blockEnd","blockCommentStartToken","blockCommentEndToken","LanguageConfigurationChangeEvent","LanguageConfigurationRegistryImpl","_entries","_getRichEditSupport","_getElectricCharacterSupport","electricCharacter","electricCharacterSupport","scopedLineTokens","getComments","_getCharacterPairSupport","characterPairSupport","getWordDefinition","getFoldingRules","getIndentRulesSupport","getPrecedingValidLine","languageID","getLanguageIdAtPosition","lastLineNumber","resultLineNumber","getInheritIndentForLine","honorIntentialIndent","getLanguageIdentifier","indentation","precedingUnIgnoredLine","precedingUnIgnoredLineContent","previousLine","previousLineIndentMetadata","stopLine","getGoodIndentForLine","virtualModel","indentConverter","indent","inheritLine","onEnterSupport","_getOnEnterSupport","enterResult","removeText","shiftIndent","Outdent","unshiftIndent","getIndentForEnter","autoIndent","forceTokenization","lineTokens","getLineTokens","scopedLineText","embeddedLanguage","getScopedLineTokens","beforeEnterResult","beforeEnterIndent","beforeEnterIndentAction","currentLineIndent","afterEnterAction","beforeEnter","afterEnter","afterEnterIndent","getIndentActionForType","afterTypeText","beforeTypeText","getRawEnterActionAtPosition","getEnterAction","enterAction","getIndentationAtPosition","oneLineAboveScopedLineTokens","columnNumber","getBracketsSupport","LanguageConfigurationRegistry","parseTokenTheme","ParsedTokenThemeRule","resolveParsedTokenThemeRules","parsedThemeRules","customTokenColors","strcmp","defaultFontStyle","defaultForeground","defaultBackground","incomingDefaults","colorMap","ColorMap","customTokenColors_1","foregroundColorId","backgroundColorId","ThemeTrieElementRule","ThemeTrieElement","TokenTheme","toStandardTokenType","tokenType","STANDARD_TOKEN_TYPE_REGEXP","colorRegExp","_lastColorId","_id2color","_color2id","getColorMap","_colorMap","createFromRawTokenTheme","createFromParsedTokenTheme","_match","_fontStyle","_foreground","_background","acceptOverwrite","mainRule","_mainRule","_children","dotIndex","generateTokensCSSForColorMap","TokenizationRegistryImpl","_promises","languages","changedLanguages","changedColorMap","support","registerPromise","supportPromise","registration","getPromise","setColorMap","getDefaultBackground","module","amd","finallyConstructor","TypeError","_handled","_deferreds","deferred","_immediateFn","cb","onFulfilled","onRejected","finale","_unhandledRejectionFn","ex","setTimeoutFunc","prom","remaining","race","globalNS","MarkerTag","MarkerSeverity","KeyCode","SelectionDirection","ScrollbarVisibility","EndOfLinePreference","DefaultEndOfLine","EndOfLineSequence","TrackedRangeStickiness","ScrollType","CursorChangeReason","RenderMinimap","WrappingIndent","TextEditorCursorBlinkingStyle","TextEditorCursorStyle","RenderLineNumbersType","ContentWidgetPositionPreference","OverlayWidgetPositionPreference","MouseTargetType","CompletionItemKind","CompletionItemInsertTextRule","CompletionTriggerKind","SignatureHelpTriggerKind","DocumentHighlightKind","SymbolKind","KeyMod","chord","CtrlCmd","Shift","Alt","WinCtrl","createMonacoBaseAPI","standaloneEnums","Uri","token_1","ColorZone","colorId","OverviewRulerZone","_colorZone","setColorZone","colorZone","getColorZones","OverviewZoneManager","getVerticalOffsetForLine","_getVerticalOffsetForLine","_zones","_colorZonesInvalid","_domWidth","_domHeight","_outerHeight","_pixelRatio","_lastAssignedId","_color2Id","_id2Color","getId2Color","setZones","newZones","setPixelRatio","pixelRatio","getDOMWidth","getCanvasWidth","setDOMWidth","getDOMHeight","getCanvasHeight","setDOMHeight","getOuterHeight","setOuterHeight","outerHeight","resolveColorZones","colorZonesInvalid","totalHeight","heightRatio","halfMinimumHeight","allColorZones","zone","colorZone_1","y1","y2","ycenter","halfHeight","RestrictedRenderingContext","viewLayout","_viewLayout","getScrollWidth","getScrollHeight","visibleRange","bigNumbersDelta","vInfo","getCurrentViewport","viewportWidth","viewportHeight","getScrolledTopFromAbsoluteTop","absoluteTop","getVerticalOffsetForLineNumber","getDecorationsInViewport","RenderingContext","viewLines","_viewLines","linesVisibleRangesForRange","includeNewLines","visibleRangeForPosition","LineVisibleRanges","HorizontalRange","FloatHorizontalRange","RangeUtil","_createRange","_handyReadyRange","createRange","_detachRange","selectNodeContents","_readClientRects","startElement","endElement","setStart","setEnd","_mergeAdjacentRanges","renderingContext_1","prevLeft","prevWidth","myLeft","myWidth","_createHorizontalRangesFromClientRects","clientRects","clientRectDeltaLeft","clientRect","readHorizontalRanges","startChildIndex","endChildIndex","ViewContext","theme","privateViewEventBus","addEventHandler","eventHandler","removeEventHandler","ViewEventDispatcher","eventHandlerGateKeeper","_eventHandlerGateKeeper","_eventHandlers","_isConsumingQueue","consumeQueue","emitMany","_doConsumeQueue","eventHandlers","handleEvents","ViewConfigurationChangedEvent","canUseLayerHinting","editorClassName","readOnly","accessibilitySupport","emptySelectionClipboard","copyWithSyntaxHighlighting","fontInfo","viewInfo","wrappingInfo","ViewCursorStateChangedEvent","ViewDecorationsChangedEvent","ViewFlushedEvent","ViewFocusChangedEvent","ViewLineMappingChangedEvent","ViewLinesChangedEvent","ViewLinesDeletedEvent","ViewLinesInsertedEvent","ViewRevealRangeRequestEvent","verticalType","revealHorizontal","ViewScrollChangedEvent","ViewTokensChangedEvent","ViewThemeChangedEvent","ViewTokensColorsChangedEvent","ViewZonesChangedEvent","ViewLanguageConfigurationEvent","ViewEventEmitter","_collector","_collectorCnt","_beginEmit","ViewEventsCollector","_endEmit","finalize","_emit","safeInvokeListener","_eventsLen","_events","LineDecoration","equalsArr","lineDecorations","minLineColumn","inlineClassName","DecorationSegment","Stack","stopOffsets","consumeLowerThan","maxStopOffset","nextStartOffset","stopOffset","LineDecorationsNormalizer","charCodeBefore","currentStartOffset","currentEndOffset","renderViewLine","containsForeignElements","lineDecoration","RenderLineOutput","CharacterMapping","fontIsMonospace","canUseHalfwidthRightwardsArrow","isOverflowing","spaceWidth","renderWhitespace","renderControlCharacters","characterMapping","charIndex","tabsCharDelta","charOffsetInPart","prevPartContentCnt","partAbsoluteOffset","partIndex","tokensLen","partEndIndex","partType","partRendersWhitespace","partContentCnt","_charIndex","_tabsCharDelta","insertSpacesCount","setPartData","_renderLine","useMonospaceOptimizations","stopRenderingLineAfter","fauxIndentLength","LinePart","getClassName","transformAndRemoveOverflowing","continuesWithWrappedLine","onlyBoundary","tokenEndIndex","tokensLength","tmpIndent","wasInWhitespace","isInWhitespace","generateWhitespace","lastCharCode","prevCharCode","_applyRenderWhitespace","len_1","_lineDecorations","lineDecorations_1","lineDecorationsLen","lineDecorationIndex","lastResultEndIndex","len_2","lastTokenEndIndex","_applyInlineDecorations","onlyAtSpaces","lastSpaceOffset","currTokenStart","piecesCount","ceil","pieceEndIndex","splitLargeTokens","fontLigatures","ResolvedRenderLineInput","resolveRenderLineInput","RenderLineInput","partCount","_absoluteOffsets","getPartIndex","partData","getCharIndex","charOffset","getAbsoluteOffsets","charOffsetToPartData","partDataToCharOffset","partLength","searchEntry","midEntry","minEntry","maxEntry","minPartIndex","RenderLineOutput2","renderViewLine2","ViewportData","partialData","whitespaceViewportData","_model","getLineMinColumn","getViewLineRenderingData","WhitespaceComputer","_heights","_minWidths","_ids","_afterLineNumbers","_ordinals","_prefixSum","_prefixSumValidIndex","_whitespaceId2Index","_lastWhitespaceId","_minWidth","findInsertionIndex","sortedArray","ordinals","valueOrdinal","insertWhitespace","afterLineNumber","ordinal","heightInPx","minWidth","insertionIndex","_insertWhitespaceAtIndex","sid","oldIndex","changeWhitespace","newAfterLineNumber","hasChanges","changeWhitespaceHeight","changeWhitespaceAfterLineNumber","newHeightInPx","removeWhitespace","_removeWhitespaceAtIndex","getAccumulatedHeight","getAccumulatedHeightBeforeLineNumber","lastWhitespaceBeforeLineNumber","_findLastWhitespaceBeforeLineNumber","afterLineNumbers","_findFirstWhitespaceAfterLineNumber","firstWhitespaceAfterLineNumber","getFirstWhitespaceIndexAfterLineNumber","getMinWidth","getAfterLineNumberForWhitespaceIndex","getIdForWhitespaceIndex","getHeightForWhitespaceIndex","getWhitespaces","deviceLineHeight","heightInLines","LinesLayout","_lineCount","_whitespaces","whitespaceComputer_1","getLinesTotalHeight","getWhitespaceAccumulatedHeightBeforeLineNumber","getWhitespaceMinWidth","isAfterLines","verticalOffset","getLineNumberAtOrAfterVerticalOffset","minLineNumber","maxLineNumber","midLineNumber","midLineNumberVerticalOffset","getLinesViewportData","verticalOffset1","verticalOffset2","currentWhitespaceHeight","currentWhitespaceAfterLineNumber","startLineNumberVerticalOffset","whitespaceIndex","whitespaceCount","currentVerticalOffset","currentLineRelativeOffset","linesOffsets","verticalCenter","centeredLineNumber","currentLineTop","endLineNumberVerticalOffset","completelyVisibleStartLineNumber","completelyVisibleEndLineNumber","getVerticalOffsetForWhitespaceIndex","previousLinesHeight","previousWhitespacesHeight","getWhitespaceIndexAtOrAfterVerticallOffset","midWhitespaceIndex","midWhitespaceVerticalOffset","midWhitespaceHeight","minWhitespaceIndex","maxWhitespaceIndex","getWhitespaceAtVerticalOffset","candidateIndex","candidateTop","candidateHeight","getWhitespaceViewportData","PrefixSumIndexOfResult","PrefixSumComputer","prefixSum","prefixSumValidIndex","Int32Array","insertValues","oldValues","oldPrefixSum","insertValuesLen","subarray","changeValue","removeValues","maxCnt","getTotalValue","_getAccumulatedValue","PrefixSumComputerWithCache","_cacheAccumulatedValueStart","_bustCache","cacheIndex","warmUpCache","accumulatedValueStart","accumulatedValueEnd","newCache","MirrorTextModel","_uri","_eol","_versionId","_lineStarts","getText","onEvents","changes_1","_acceptDeleteRange","_acceptInsertText","_ensureLineStarts","eolLength","lineStartValues","prefixSumComputer_1","_setLineText","insertText","insertLines","newLengths","MirrorModel","getWordAtPosition","wordAtText","getWordUntilPosition","wordAtPosition","createWordIterator","wordRangesIdx","wordRanges","_wordenize","getLineWords","words","ranges_1","_validateRange","startLineIndex","endLineIndex","resultLines","offsetAt","_validatePosition","lineLength","hasChanged","maxCharacter","mirrorTextModel_1","BaseEditorSimpleWorker","foreignModuleFactory","_foreignModuleFactory","_foreignModule","originalUrl","modifiedUrl","ignoreTrimWhitespace","_getModel","diffComputer_1","identical","_modelsAreIdentical","originalLineCount","computeMoreMinimalEdits","modelUrl","edits","lastEol","edits_1","_diffLimit","editOffset","newEdit","linkComputer_1","textualSuggest","wordDef","wordDefFlags","suggestions","wordDefRegExp","wordUntil","wordAt","_suggestionsLimit","kind","computeWordRanges","words_1","selectionText","wordRange","inplaceReplaceSupport_1","loadForeignModule","createData","getMirrorModels","_getModels","foreignModule","fmr","EditorSimpleWorkerImpl","_models","acceptNewModel","EOL","acceptModelChanged","strURL","acceptRemovedModel","importScripts","monaco","standaloneBase_1","ViewEventHandler","shouldRender","forceShouldRender","setShouldRender","onDidRender","onCursorStateChanged","onDecorationsChanged","onFocusChanged","onLanguageConfigurationChanged","onLineMappingChanged","onRevealRangeRequest","onTokensColorsChanged","onThemeChanged","DynamicViewOverlay","viewEventHandler_1","ViewPart","_context","PartFingerprints","write","partId","Coordinate","ViewContentWidgets","viewDomNode","_viewDomNode","_widgets","viewPart_1","overflowingContentWidgetsDomNode","widgetId","keys_2","addWidget","_widget","myWidget","allowEditorOverflow","setWidgetPosition","widget","preference","removeWidget","shouldSuppressMouseDownOnWidget","suppressMouseDown","onBeforeRender","keys_3","prepareRender","keys_4","keys_5","_fixedOverflowWidgets","fixedOverflowWidgets","_contentWidth","contentWidth","_contentLeft","contentLeft","_setPosition","_preference","_cachedDomNodeClientWidth","_cachedDomNodeClientHeight","_getMaxWidth","_renderData","_viewPosition","_viewRange","validModelPosition","validateModelPosition","coordinatesConverter","modelPositionIsVisible","convertModelPositionToViewPosition","validModelRange","validateModelRange","convertModelRangeToViewRange","_layoutBoxInViewport","topLeft","bottomLeft","aboveLineTop","heightAboveLine","underLineTop","aboveTop","fitsAbove","belowTop","fitsBelow","actualAboveLeft","actualBelowLeft","aboveLeft","belowLeft","_layoutBoxInPage","aboveLeft0","belowLeft0","absoluteAboveTop","absoluteBelowTop","absoluteAboveLeft","absoluteBelowLeft","INNER_WIDTH","_prepareRenderWidgetAtExactPositionOverflowing","_getTopAndBottomLeft","topForPosition","largestLineNumber","smallestLeft","visibleRangesForRange","visibleRangesForLine","topForBottomLine","_prepareRenderWidget","placement","pass","pref","DecorationsOverlay","_typicalHalfwidthCharacterWidth","typicalHalfwidthCharacterWidth","_renderResult","_decorations","decorations","decorationsLen","zIndex","aClassName","bClassName","visibleStartLineNumber","visibleEndLineNumber","_renderWholeLineDecorations","_renderNormalDecorations","lenI","isWholeLine","decorationOutput","prevClassName","prevShowIfCollapsed","prevRange","showIfCollapsed","_renderNormalDecoration","linesVisibleRanges","lineVisibleRanges","singleVisibleRange","lenK","dynamicViewOverlay_1","DecorationToRender","DedupOverlay","prevEndLineIndex","i_1","GlyphMarginOverlay","_glyphMargin","glyphMargin","_glyphMarginLeft","glyphMarginLeft","_glyphMarginWidth","glyphMarginWidth","_getDecorations","glyphMarginClassName","toRender","common","LinesDecorationsOverlay","_decorationsLeft","decorationsLeft","_decorationsWidth","decorationsWidth","linesDecorationsClassName","glyphMargin_1","lineOutput","Margin","_canUseLayerHinting","OUTER_CLASS_NAME","_glyphMarginBackgroundDomNode","CLASS_NAME","adjustedScrollTop","MarginViewLineDecorationsOverlay","marginClassName","ViewOverlayWidgets","_verticalScrollbarWidth","verticalScrollbarWidth","_minimapWidth","minimapWidth","_horizontalScrollbarHeight","horizontalScrollbarHeight","_editorHeight","_editorWidth","widgetData","_renderWidget","widgetHeight","OverviewRuler","cssClassName","_zoneManager","overviewZoneManager_1","setLayout","zones","colorZones","id2Color","clearRect","_renderOneLane","currentColorId","currentFrom","currentTo","colorZones_1","zoneColorId","zoneFrom","zoneTo","fillRect","fillStyle","ViewZones","marginDomNode","_recomputeWhitespacesProps","hadAChange","props","_computeWhitespaceProps","afterViewLineNumber","_safeCallOnComputedHeight","onHeightMaybeChanged","_getZoneOrdinal","afterColumn","_heightInPixels","minWidthInPx","_minWidthInPixels","zoneAfterModelPosition","validAfterLineNumber","getModelLineMaxColumn","zoneBeforeModelPosition","viewPosition","addZone","myZone","whitespaceId","addWhitespace","removeZone","layoutZone","shouldSuppressMouseDownOnViewZone","onComputedHeight","_safeCallOnDomNodeTop","onDomNodeTop","visibleWhitespaces","visibleZones","hasVisibleZone","newTop","newDisplay","Viewport","MinimapLinesRenderingData","ViewLineData","minColumn","maxColumn","ViewLineRenderingData","inlineDecorations","InlineDecoration","ViewModelDecoration","ViewLayout","_configuration","_linesLayout","linesLayout_1","_configureSmoothScrollDuration","_updateHeight","smoothScrolling","_getHorizontalScrollbarHeight","scrollbar","_getTotalHeight","scrollBeyondLastLine","currentScrollPosition","viewModel_1","getFutureViewport","_computeScrollWidth","maxLineWidth","isViewportWrapping","extraHorizontalSpace","scrollBeyondLastColumn","whitespaceMinWidth","onMaxLineWidthChanged","newScrollWidth","saveState","firstLineNumberInViewport","scrollTopWithoutViewZones","getLineNumberAtVerticalOffset","visibleBox","getLinesViewportDataAtScrollTop","getCurrentScrollLeft","getCurrentScrollTop","deltaScrollNow","deltaScrollLeft","deltaScrollTop","ViewModelDecorations","editorId","linesCollection","_coordinatesConverter","_decorationsCache","_clearCachedModelDecorationsResolver","_cachedModelDecorationsResolver","_cachedModelDecorationsResolverViewRange","onModelDecorationsChanged","_getOrCreateViewModelDecoration","modelDecoration","modelRange","viewRange","getDecorationsViewportData","cacheIsValid","_getDecorationsViewportData","viewportRange","modelDecorations","getDecorationsInRange","decorationsInViewport","decorationsInViewportLen","decorationOptions","viewModelDecoration","inlineDecoration","inlineClassNameAffectsLetterSpacing","intersectedStartLineNumber","intersectedEndLineNumber","beforeContentClassName","afterContentClassName","MoveCaretCommand","isMovingLeft","_selection","_isMovingLeft","newLineContent","_cutStartIndex","_cutEndIndex","_moved","CodeActionKind","QuickFix","Refactor","Source","SourceOrganizeImports","SourceFixAll","mayIncludeActionsOfKind","providedKind","includeSourceActions","filtersAction","actionKind","onlyIncludePreferredActions","isPreferred","CodeActionContextMenu","_contextMenuService","_onApplyCodeAction","_onDidExecuteCodeAction","onDidExecuteCodeAction","actionsToShow","at","codeActions","sent","_visible","actions","codeActionToAction","showContextMenu","_toCoords","getActions","autoSelectFirstItem","actions_1","hasModel","revealPosition","cursorCoords","getScrolledVisiblePosition","editorCoords","ColorPickerModel","availableColorPresentations","presentationIndex","_onColorFlushed","onColorFlushed","_onDidChangeColor","onDidChangeColor","_onDidChangePresentation","onDidChangePresentation","originalColor","_color","_colorPresentations","colorPresentations","presentation","selectNextColorPresentation","flushColor","guessColorPresentation","originalText","BlockCommentCommand","_usedEndToken","_haystackHasNeedleAtOffset","needleLength","_createOperationsForBlockComment","startToken","endToken","startLineText","endLineText","startTokenIndex","endTokenIndex","startLineAfterStartToken","endLineBeforeEndToken","_createRemoveBlockCommentOperations","_createAddBlockCommentOperations","ops_1","tokenizeIfCheap","languageConfigurationRegistry_1","startTokenEditOperation","endTokenEditOperation","LineCommentCommand","_tabSize","_deltaColumn","_gatherPreflightCommentStrings","commentStr","ignore","commentStrOffset","commentStrLength","_analyzeLines","shouldRemoveComments","onlyWhitespaceLines","lineData","lineContentStartOffset","blockCommentCommand_1","commentStrEndOffset","supported","_gatherPreflightData","_executeLineComments","_createRemoveLineCommentsOperations","_normalizeInsertionPoint","_createAddLineCommentsOperations","cursorPosition","_attemptRemoveBlockComment","startTokenAllowedBeforeColumn","_executeBlockComment","_moveEndPositionDown","nextVisibleColumn","currentVisibleColumn","isTab","columnSize","minVisibleColumn","j_1","lenJ_1","DragAndDropCommand","targetPosition","copy","targetSelection","effectiveOptionValue","override","FindReplaceState","_searchString","_replaceString","_isRevealed","_isReplaceRevealed","_isRegex","_isRegexOverride","_wholeWord","_wholeWordOverride","_matchCase","_matchCaseOverride","_searchScope","_matchesPosition","_currentMatch","_onFindReplaceStateChange","changeMatchInfo","matchesPosition","matchesCount","currentMatch","changeEvent","moveCursor","updateHistory","replaceString","isRevealed","isReplaceRevealed","searchScope","somethingChanged","oldEffectiveIsRegex","oldEffectiveWholeWords","oldEffectiveMatchCase","isRegexOverride","wholeWordOverride","matchCaseOverride","ReplaceAllCommand","editorSelection","replaceStrings","_editorSelection","_ranges","_replaceStrings","o1","o2","resultOps","previousOp","resultOps_1","_trackedEditorSelectionId","StaticValueReplacePattern","staticValue","DynamicPiecesReplacePattern","ReplacePattern","fromStaticValue","ReplacePiece","buildReplaceString","_substitute","ReplacePieceBuilder","_source","_lastCharIndex","_result","_resultLen","_currentStaticPiece","emitUnchanged","toCharIndex","_emitStatic","emitStatic","emitMatchIndex","parseReplaceString","nextNextChCode","MAX_FOLDING_REGIONS","MAX_LINE_NUMBER","FoldingRegions","startIndexes","endIndexes","_startIndexes","_endIndexes","_collapseStates","_types","ensureParentIndices","_parentsComputed","parentIndexes_1","isInsideLast","parentIndex","getType","hasTypes","arrayIndex","toRegion","FoldingRegion","getParentIndex","findIndex","findRange","containedBy","containsLine","FoldingModel","textModel","decorationProvider","_updateEventEmitter","_textModel","_decorationProvider","_regions","foldingRanges_1","_editorDecorationIds","_isInitialized","toggleCollapseState","regions","processed","changeDecorations","accessor","regions_1","regionIndex","editorDecorationId","newCollapseState","changeDecorationOptions","getDecorationOption","collapseStateChanged","newRegions","blockedLineNumers","newEditorDecorations","initRange","blockedLineNumers_1","blockedLineNumber","isBlocked","decorationRange","nextCollapsed","collapsedIndex","decRange","getDecorationRange","collapsedStartLineNumber","deltaDecorations","getMemento","collapsedRanges","applyMemento","toToogle","state_1","region","getRegionAtLine","getAllRegionsAtLine","getRegionsInside","levelStack","setCollapseStateLevelsDown","foldingModel","doCollapse","levels","toToggle","lineNumbers_1","regionsInside","setCollapseStateLevelsUp","lineNumbers_2","setCollapseStateAtLevel","foldLevel","blockedLineNumbers","setCollapseStateForMatchingLines","regExp","editorModel","setCollapseStateForType","HiddenRangeModel","_foldingModel","_foldingModelListener","updateHiddenRanges","_hiddenRanges","updateHiddenAreas","newHiddenAreas","lastCollapsedStart","lastCollapsedEnd","applyHiddenRanges","hiddenRanges","hasRanges","isHidden","adjustSelections","adjustLine","isInside","adjustedStartLine","adjustedEndLine","sanitizeRanges","rangeData","sorted","d1","d2","rank","collector","RangesCollector","sorted_1","toIndentRanges","foldingContext","ID_SYNTAX_PROVIDER","SyntaxRangeProvider","providers","compute","cancellationToken","promises","provider","provideFoldingRanges","nLines","collectSyntaxRanges","foldingRangesLimit","_nestingLevels","_nestingLevelCounts","_foldingRangesLimit","nestingLevel","maxLevel","ID_INIT_PROVIDER","InitializingRangeProvider","initialRanges","timeoutTime","toDecorationRange","decorationIds","cancelationToken","foldingRangeData","syntaxRangeProvider_1","FormattingEdit","_handleEolEdits","newEol","singleEdits","_isFullModelReplaceEdit","validateRange","getFullModelRange","_edits","pushUndoStop","executeEdits","hasModifier","modifier","createOptions","multiCursorModifier","ClickLinkOptions","ClickLinkMouseEvent","hasTriggerModifier","triggerModifier","hasSideBySideModifier","triggerSideBySideModifier","isNoneOrSingleMouseDown","ClickLinkKeyboardEvent","keyCodeIsTriggerKey","triggerKey","keyCodeIsSideBySideKey","triggerSideBySideKey","ClickLinkGesture","_onMouseMoveOrRelevantKeyDown","onMouseMoveOrRelevantKeyDown","_onExecute","onExecute","_onCancel","onCancel","getConfiguration","lastMouseMoveEvent","hasTriggerKeyOnMouseDown","onDidChangeConfiguration","onMouseMove","onEditorMouseMove","onEditorMouseDown","onEditorMouseUp","onEditorKeyDown","onEditorKeyUp","onMouseDrag","resetHandler","HoverOperation","computer","success","progress","hoverTime","_computer","_hoverTime","_firstWaitScheduler","_triggerAsyncComputation","_secondWaitScheduler","_triggerSyncComputation","_loadingMessageScheduler","_showLoadingMessage","_asyncComputationPromise","_asyncComputationPromiseDone","_completeCallback","_errorCallback","_progressCallback","setHoverTime","_firstWaitTime","_secondWaitTime","_loadingMessageTime","computeAsync","asyncResult","_withAsyncResult","computeSync","onResult","_onComplete","getResult","_onProgress","getResultWithLoadingMessage","mode","ContentHoverWidget","_containerDomNode","updateFont","onDidLayoutChange","addContentWidget","_showAtPosition","_showAtRange","showAt","layoutContentWidget","_stoleFocus","removeContentWidget","getElementsByClassName","applyFontInfo","updateContents","onContentsChange","getLayoutInfo","maxHeight","GlyphHoverWidget","_showAtLineNumber","addOverlayWidget","editorLayout","topForLineNumber","getTopForLineNumber","editorScrollTop","removeOverlayWidget","codeTags","codeClasses","InPlaceReplaceCommand","originalSelection","_editRange","_originalSelection","getSpaceCnt","spacesCnt","generateIndent","tabsCnt","CopyLinesCommand","isCopyingDown","_isCopyingDown","_startLineNumberDelta","_endLineNumberDelta","sourceLines","sourceText","_selectionDirection","getSortData","descending","linesToSort","localeCompare","SortLinesCommand","sortLines","canRun","BracketSelectionRangeProvider","provideSelectionRanges","positions","bucket","_bracketsRightYield","_bracketsLeftYield","positions_1","counts","_maxRounds","findNextBracket","_maxDuration","isOpen","findPrevBracket","closing","innerBracket","outerBracket","_addBracketLeading","startLine","aboveLine","column_1","WordSelectionRangeProvider","_addInWordRanges","_addWordRanges","_addWhitespaceLine","lastCh","walk","marker","visitor","marker_1","Scanner","isDigitCharacter","isVariableCharacter","tokenText","Marker","Text","others","newChildren","_fixParent","children_1","child_1","TextmateSnippet","_this_1","TransformableMarker","Placeholder","compareByIndex","isFinalTabstop","Choice","Transform","didMatch","_replace","FormatString","elseValue","shorthandName","ifValue","toLocaleUpperCase","toLocaleLowerCase","_toPascalCase","Variable","resolver","_placeholders","last_1","all_1","placeholderInfo","fullLen","enclosingPlaceholders","placeholder","resolveVariables","SnippetParser","_scanner","insertFinalTabstop","enforceFinalTabstop","snippet","_parse","placeholderDefaultValues","incompletePlaceholders","placeholderCount","incompletePlaceholders_1","defaultValues","defaultValues_1","_accept","_backTo","_until","_parseEscaped","_parseTabstopOrVariableName","_parseComplexPlaceholder","_parseComplexVariable","_parseAnything","_parseTransform","choice","_parseChoiceElement","variable","regexValue","regexOptions","_parseFormatString","complex","shorthand","WordDistance","service","contribInfo","suggest","localityBonus","canComputeWordRanges","bracketSelections_1","distance","suggestion","wordLines","bestWordRange","blockDistance","isFuzzyActionArr","what","fixCase","isFuzzyAction","isIAction","createError","substituteMatches","stateMatches","full","sub","dollar","attr","ofs","findRules","inState","tokenizer","stateExists","stateNames","bool","defValue","createKeywordMatcher","caseInsensitive","array_1","arrayToHash","compileRegExp","monarchCommon","createGuard","tkey","scrut","oppat","pat","tester","elemType","inWords_2","re_1","patx_1","patx_2","patexp","inWords_1","scrutinee","num","selectScrutinee","compileAction","newAction","tokenSubst","goBack","switchTo","nextEmbedded","usesEmbedded","results","cases","cases_1","def_1","defaultToken","_case","Rule","matchOnlyAtLineStart","setRegex","re","sregex","setAction","act","compile","json","addRules","newrules","newrule","lexerMin","rule1","matchOnlyAtStart","noThrow","maxStack","tokenPostfix","bracketIdx","desc","nls","BaseActionItem","_action","handleActionChangeEvent","updateEnabled","updateChecked","updateClass","updateLabel","updateTooltip","_actionRunner","actionRunner","getAction","isEnabled","setActionContext","newContext","enableDragging","isMenu","Separator","ID","ActionItem","icon","triggerKeys","keyDown","ActionBar","_onDidCancel","focusedItem","animated","previousKey","nextKey","eventHandled","isTriggerKeyEvent","doTrigger","updateFocusedItem","actionsList","getContainer","actionItemElement","actionItemProvider","selectFirst","updateFocus","fromRight","actionItem","context_1","alert","disableRepeat","insertMessage","alertContainer","ariaContainer","prevText","repeatedTimes","statusContainer","setARIAContainer","status","NLS_CASE_SENSITIVE_CHECKBOX_LABEL","NLS_WHOLE_WORD_CHECKBOX_LABEL","NLS_REGEX_CHECKBOX_LABEL","CaseSensitiveCheckbox","appendTitle","checkbox_1","WholeWordsCheckbox","RegexCheckbox","inputBackground","inputForeground","inputValidationInfoBorder","inputValidationInfoBackground","inputValidationWarningBorder","inputValidationWarningBackground","inputValidationErrorBorder","inputValidationErrorBackground","InputBox","contextViewProvider","_onDidHeightChange","cachedHeight","inputBorder","inputValidationInfoForeground","inputValidationWarningForeground","inputValidationErrorForeground","validationOptions","validation","flexibleHeight","mirror","setPlaceHolder","onValueChange","Bal","updateMirror","actionbar","actionbar_1","_hideMessage","_showMessage","placeHolder","setAriaLabel","disabled","setEnabled","showMessage","classForType","stylesForType","alertText","aria","hideMessage","errorMsg","inputElement","div","showContextView","renderOptions","spanElement","formatContent","htmlContentRenderer_1","hideContextView","previousHeight","HistoryInputBox","addToHistory","getCurrentValue","showNextValue","getNextValue","showPreviousValue","getPreviousValue","NLS_DEFAULT_LABEL","FindInput","_showOptionButtons","fixFocusOnOptionClickEnabled","_onDidOptionChange","onDidOptionChange","_onInput","_onCaseSensitiveKeyDown","onCaseSensitiveKeyDown","_onRegexKeyDown","_lastHighlightFindOptions","buildDomNode","appendCaseSensitiveLabel","appendWholeWordsLabel","appendRegexLabel","inputBox","wholeWords","caseSensitive","setFocusInputOnOptionClick","checkBoxStyles","inputBoxStyles","getCaseSensitive","setCaseSensitive","getWholeWords","setWholeWords","focusOnCaseSensitive","highlightFindOptions","inputBox_1","findInputCheckboxes_1","viaKeyboard","mirrorElement","controls","clearMessage","isInputElement","mightProducePrintableCharacter","isSelectionSingleChangeEvent","isSelectionRangeChangeEvent","isMouseRightClick","MouseEvent","disjunction","TypeLabelControllerState","TraitRenderer","renderedElements","renderedElementIndex","rendered","unrender","renderIndex","insertCount","renderedElement","renderIndexes","Trait","_trait","sortedIndexes","numericSort","sortedResult","FocusTrait","TraitSpliceable","identityProvider","pastElementsWithTrait","elementsWithTrait","KeyboardController","multipleSelectionSupport","openController","DefaultOpenController","onUpArrow","onDownArrow","onPageUpArrow","onPageDownArrow","onCtrlA","shouldOpen","TypeLabelController","keyboardNavigationLabelProvider","automaticKeyboardNavigation","triggered","enabledDisposables","enableKeyboardNavigation","onChar","onClear","onInput","Typing","getKeyboardNavigationLabel","labelStr","filters_1","DOMFocusController","onTab","focusedDomElement","tabIndexElement","DefaultMultipleSelectionController","MouseController","multipleSelectionController","onMouseDblClick","onDoubleClick","onMouseClick","onPointer","isSelectionChangeEvent","reference","changeSelection","pin","rangeSelection","contiguousRange","getContiguousRangeContaining","DefaultStyleController","listInactiveFocusBackground","listSelectionOutline","listInactiveFocusOutline","listHoverOutline","listFilterWidgetBackground","listFilterWidgetOutline","listFilterWidgetNoMatchesOutline","listMatchesShadow","ariaRootRole","list_1","TREE","PipelineRenderer","dynamicHeightProbing","AccessibiltyRenderer","ariaLevel","getAriaLevel","ListViewDragAndDrop","getSelectedElements","targetIndex","List","_onDidOpen","onDidOpen","_onPin","baseRenderers","viewOptions","listView_1","ariaRole","styleController","spliceable","splice_1","typeLabelController","createMouseController","onFocusChange","_onFocusChange","onSelectionChange","_onSelectionChange","nls_1","toListEvent","fromKeydown","fromKeyup","fromMouse","optionsUpdate","indexes_1","indexes_2","findNextIndex","findPreviousIndex","currentlyFocusedElement","getFocusedElements","lastGoodPageIndex","firstGoodPageIndex","getRelativeTop","indexes_3","indexes_4","cleanMnemonic","MENU_MNEMONIC_REGEX","mnemonicInText","createMenuMnemonicRegExp","MENU_ESCAPED_MNEMONIC_REGEX","createMenuEscapedMnemonicRegExp","SubmenuAction","Menu","menuElement","doGetActionItem","parentData","menuDisposables","enableMnemonics","mnemonics","actions_2","SubmenuActionItem","focusItemByElement","scrollTopHold","lastFocusedItem","setFocusedItem","MenuSeparatorActionItem","updatePositionInSet","fgColor","foregroundColor","bgColor","shadow","shadowColor","boxShadow","MenuActionItem","menuActionItem","mnemonic","getMnemonic","actionItems","menuItemOptions","getKeyBinding","keybindingLabel","getLabel","applyStyle","setSize","cleanLabel","menuStyle","isSelected","selectionForegroundColor","selectionBackgroundColor","selectionBorderColor","submenuActions","submenuOptions","submenuDisposables","showScheduler","mouseOver","cleanupExistingSubmenu","createSubmenu","hideScheduler","submenu","mysubmenu","submenuIndicator","submenuContainer","selectFirstItem","childBoundingRect","computedStyles","paddingTop","scrollOffset","onDidCancel","borderBottomColor","separatorColor","asTreeDragAndDropData","asTreeEvent","dfs","TreeNodeListDragAndDrop","autoExpandDisposable","didChangeAutoExpandNode","autoExpandNode","ref","ComposedTreeDelegate","TreeRenderer","renderedNodes","DefaultIndent","onDidChangeNodeTwistieState","onDidChangeTwistieState","twistie","renderTwistie","TypeFilter","_filter","_totalCount","_matchCount","onWillRefilter","_pattern","_lowercasePattern","simpleKeyboardNavigation","filterOnType","TypeFilterController","_onDidChangeEmptyState","positionClassName","_onDidChangePattern","messageDomNode","labelDomNode","_filterOnType","filterOnTypeDomNode","updateFilterOnTypeTitle","onDidChangeFilterOnType","clearDomNode","keyboardNavigationEventFilter","onDidSpliceModel","onEventOrInput","isPrintableCharEvent","listWidget_1","containerWidth","midContainerWidth","updatePosition","screenX","noMatches","totalCount","matchCount","shouldAllowFocus","_nodeSet","createNodeSet","that","nodeSet","onDidModelSplice","set_1","deletedNodesIdSet","deletedNodesVisitor","insertedNodesMap","insertedNodesVisitor","insertedNode","TreeNodeListMouseController","onTwistie","expandOnlyOnTwistieClick","TreeNodeList","focusTrait","selectionTrait","additionalFocus","additionalSelection","fromAPI","AbstractTree","_onWillRefilter","_onDidUpdateOptions","treeDelegate","onDidChangeCollapseStateRelay","asListOptions","createModel","onLeftArrow","onRightArrow","typeFilterController","focusNavigationFilter","parentListIndex","firstChildIndex","DataTree","objectTreeModel_1","abstractTree_1","ObjectTree","createAsyncDataTreeNode","stale","slow","ancestor","descendant","asAsyncDataTreeDragAndDropData","asTreeElement","viewStateContext","viewState","ChildrenResolutionReason","AsyncDataTreeNodeWrapper","DataTreeRenderer","twistieElement","AsyncDataTreeNodeListDragAndDrop","AsyncDataTree","subTreeRefreshPromises","refreshPromises","_onDidRender","_onDidChangeNodeSlowState","objectTreeDelegate","objectTreeRenderers","objectTreeOptions","asObjectTreeOptions","objectTree_1","updateChildren","refreshAndRenderNode","getDataNode","Refresh","refreshNode","Expand","visibleChildren","refreshPromise","doRefreshSubTree","doRefreshNode","childrenToRefresh","slowTimeout_1","childrenPromise","doGetChildren","err_1","__awaiter","childrenElements","nodesToForget","childrenTreeNodesById","childNode","asyncDataTreeNode","childAsyncDataTreeNode","_c","_d","_e","ModifierLabelProvider","mac","windows","linux","modifierLabels","toLabel","keyLabelProvider","labels","_simpleAsString","UILabelProvider","AriaLabelProvider","KeybindingLabel","os","areSame","getParts","renderPart","renderUnboundKeybindings","renderUnbound","keybindingLabels_1","renderKey","Severity","_warning","_warn","_info","_displayStrings","Warning","Info","fromValue","Ignore","default","IDS","QuickOpenEntry","labelHighlights","descriptionHighlights","getLabelOptions","getDescription","getDetail","getIcon","getTooltip","getDescriptionTooltip","getKeybinding","setHighlights","detailHighlights","getHighlights","QuickOpenEntryGroup","groupLabel","withBorder","getGroupLabel","setGroupLabel","showBorder","setShowBorder","NoActionProvider","hasActions","actionProvider","entryContainer","row1","row2","iconLabel_1","keybindingContainer","keybindingLabel_1","detailContainer","actionBarContainer","actionBar","groupData","pickerGroupBorder","borderTopColor","pickerGroupForeground","iconClass","QuickOpenModel","_dataSource","_renderer","_accessibilityProvider","QuickOpenController","widgetShadow","DEFAULT_INPUT_ARIA_LABEL","QuickOpenWidget","callbacks","gainingFocus","stops","currentTarget","querySelectorAll","progressBar","progressbar_1","inputContainer","inputPlaceHolder","shouldOpenInBackground","navigateInTree","elementSelected","resultCount","treeContainer","createTree","treeCreator","treeImpl_1","quickOpenViewer_1","elementFocused","quickNavigateConfiguration","quickNavKeys","keybindings","layoutDimensions","helpText","isShift","oldFocus","newFocus","arivaActiveDescendant","keymods","extractKeyMods","preferredMode","param","isLoosingFocus","doShowWithPrefix","restoreLastInput","doShowWithInput","autoFocus","inputSelection","onShow","setInputAndLayout","isElementVisible","updateResultCount","autoFocusPrefixMatch","caseSensitiveMatch","caseInsensitiveMatch","lowerCasePrefix","entries_1","entryToFocus","autoFocusFirstEntry","autoFocusIndex","autoFocusSecondEntry","autoFocusLastEntry","itemHeight","minItemsToShow","preferredItemsHeight","MAX_ITEMS_HEIGHT","maxEntries","maxItemsToShow","entryHeight","onOk","onInputChanging","inputChangingTimeoutHandle","quickOpenWidth","MAX_WIDTH","onFocusLost","_boolean","_string","_stringSet","allowedValues","_clampedInt","minimum","maximum","_float","_scrollbarVisibilityFromString","blinkingStyleToString","blinkingStyle","cursorStyleToString","cursorStyle","Line","Block","Underline","LineThin","BlockOutline","UnderlineThin","InternalEditorOptions","multiCursorMergeOverlapping","autoClosingBrackets","autoClosingQuotes","autoSurround","useTabStops","tabFocusMode","dragAndDrop","showUnused","_equalsLayoutInfo","_equalsViewOptions","_equalsWrappingInfo","_equalsContribOptions","glyphMarginHeight","lineNumbersLeft","lineNumbersWidth","lineNumbersHeight","decorationsHeight","renderMinimap","minimapLeft","viewportColumn","_equalsOverviewRuler","extraEditorClassName","disableMonospaceOptimizations","rulers","renderLineNumbers","renderCustomLineNumbers","renderFinalNewline","selectOnLineNumbers","revealHorizontalRightPadding","roundedSelection","overviewRulerLanes","overviewRulerBorder","cursorBlinking","mouseWheelZoom","cursorSmoothCaretAnimation","cursorWidth","hideCursorInOverviewRuler","renderIndentGuides","highlightActiveIndentGuide","renderLineHighlight","_equalsScrollbarOptions","_equalsMinimapOptions","minimap","side","showSlider","renderCharacters","_equalFindOptions","seedSearchStringFromSelection","autoFindInSelection","globalFindClipboard","addExtraSpaceOnTop","_equalsParameterHintOptions","cycle","_equalsHoverOptions","sticky","_equalsSuggestOptions","filterGraceful","snippets","snippetsPreventQuickSuggestions","shareSuggestSelections","showIcons","maxVisibleSuggestions","filteredTypes","_equalsGotoLocationOptions","multiple","inDiffEditor","isDominatedByLongLines","isWordWrapMinified","wrappingColumn","wrappingIndent","wordWrapBreakBeforeCharacters","wordWrapBreakAfterCharacters","wordWrapBreakObtrusiveCharacters","selectionClipboard","hover","contextmenu","_equalsQuickSuggestions","quickSuggestions","quickSuggestionsDelay","parameterHints","formatOnType","formatOnPaste","suggestOnTriggerCharacters","acceptSuggestionOnEnter","acceptSuggestionOnCommitCharacter","wordBasedSuggestions","suggestSelection","suggestFontSize","suggestLineHeight","tabCompletion","gotoLocation","selectionHighlight","occurrencesHighlight","codeLens","foldingStrategy","showFoldingControls","matchBrackets","find","colorDecorators","codeActionsOnSave","codeActionsOnSaveTimeout","lightbulbEnabled","EditorOptionsValidator","wordWrap","_sanitizeViewInfo","_sanitizeContribInfo","configuredMulticursorModifier","lineNumbersMinChars","lineDecorationsWidth","mouseStyle","disableLayerHinting","automaticLayout","wordWrapColumn","wordWrapMinified","_wrappingIndentFromString","_sanitizeScrollbarOpts","_sanitizeMinimapOpts","_sanitizeFindOpts","_sanitizeParameterHintOpts","_sanitizeHoverOpts","_sanitizeSuggestOpts","suggestOpts","snippetSuggestions","_sanitizeGotoLocationOpts","_sanitizeTabCompletionOpts","cursorBlinkingStyle","_cursorBlinkingStyleFromString","_cursorStyleFromString","lightbulb","_booleanMap","InternalEditorOptionsFactory","_tweakValidatedOptions","accessibilityIsOn","accessibilityIsOff","createInternalEditorOptions","EditorLayoutProvider","outerWidth","showGlyphMargin","showLineNumbers","lineNumbersDigitCount","maxDigitWidth","scrollbarArrowSize","verticalScrollbarHasArrows","minimapSide","minimapRenderCharacters","minimapMaxColumn","bareWrappingInfo","digitCount","remainingWidth","minimapCharWidth","verticalArrowSize","EDITOR_FONT_DEFAULTS","EDITOR_MODEL_DEFAULTS","detectIndentation","largeFileOptimizations","EDITOR_DEFAULTS","safeParseFloat","GOLDEN_LINE_HEIGHT_RATIO","BareFontInfo","createFromRawSettings","ignoreEditorZoom","editorOptions_1","safeParseInt","editorZoomLevelMultiplier","editorZoom_1","FontInfo","isMonospace","typicalFullwidthCharacterWidth","LineContext","CompletionModel","lineContext","wordDistance","_snippetCompareFn","_compareCompletionItems","_items","_column","_wordDistance","_refilterKind","_lineContext","_compareCompletionItemsSnippetsUp","_compareCompletionItemsSnippetsDown","leadingLineContent","characterCountDelta","_filteredItems","_ensureCachedState","_isIncomplete","adopt","except","_stats","_createCachedState","suggestionCount","snippetCount","textCount","scoreFn","incomplete","overwriteBefore","filterText","filterTextLow","labelLow","AccessibilityHelpNLS","noSelection","singleSelectionRange","singleSelection","multiSelectionRange","multiSelection","emergencyConfOn","openingDocs","readonlyDiffEditor","editableDiffEditor","readonlyEditor","editableEditor","changeConfigToOnMac","changeConfigToOnWinLinux","auto_on","auto_off","tabFocusModeOnMsg","tabFocusModeOnMsgNoKb","tabFocusModeOffMsg","tabFocusModeOffMsgNoKb","openDocMac","openDocWinLinux","outroMsg","showAccessibilityHelpAction","InspectTokensNLS","inspectTokensAction","GoToLineNLS","gotoLineLabelValidLineAndColumn","gotoLineLabelValidLine","gotoLineLabelEmptyWithLineLimit","gotoLineLabelEmptyWithLineAndColumnLimit","gotoLineAriaLabel","gotoLineActionInput","gotoLineActionLabel","QuickCommandNLS","ariaLabelEntryWithKey","ariaLabelEntry","quickCommandActionInput","quickCommandActionLabel","QuickOutlineNLS","entryAriaLabel","quickOutlineActionInput","quickOutlineActionLabel","_symbols_","_modules_","_class_","_interface_","_method_","_function_","_property_","_variable_","_variable2_","_constructor_","_call_","StandaloneCodeEditorNLS","editorViewAccessibleLabel","accessibilityHelpMessageIE","accessibilityHelpMessage","ToggleHighContrastNLS","toggleHighContrast","SimpleServicesNLS","bulkEditServiceSummary","OneReference","isProviderFirst","_onRefChanged","onRefChanged","getAriaMessage","FilePreview","_modelReference","preview","textEditorModel","beforeRange","afterRange","inside","FileReferences","_parent","_preview","_loadFailure","textModelResolverService","_resolved","createModelReference","modelReference","ReferencesModel","references","_onDidChangeReferenceRange","onDidChangeReferenceRange","providersFirst","_compareReferences","references_1","oneRef","targetSelectionRange","nextOrPreviousReference","childCount","nearestReference","nearest","prefixLen","offsetDist","firstReference","auri","buri","BrowserAccessibilityService","_accessibilitySupport","_onDidChangeAccessibilitySupport","onDidChangeAccessibilitySupport","getAccessibilitySupport","ExtensionIdentifier","_lower","FileKind","SyncDescriptor","ctor","staticArguments","supportsDelayedInstantiation","_registry","registerSingleton","descriptors_1","Graph","_hashFn","_nodes","roots","collections_1","outgoing","insertEdge","fromNode","lookupOrInsertNode","toNode","incoming","_key","storeServiceDependency","optional","_util","DI_TARGET","DI_DEPENDENCIES","createDecorator","serviceId","serviceIds","getServiceDependencies","IInstantiationService","serviceIdentifier","IBulkEditService","instantiation_1","ICodeEditorService","ID_EDITOR_WORKER_SERVICE","IEditorWorkerService","IMarkerDecorationsService","IModeService","IModelService","shouldSynchronizeModel","isTooLargeForSyncing","isForSimpleWidget","isExclusive","exclusive","LanguageFeatureRegistry","_clock","_score","_time","_lastCandidate","_updateScores","_orderedForEach","orderedGroups","lastBucket","lastBucketScore","languageSelector_1","modelService_1","_compareByScoreAndTime","LanguageIdentifier","TokenMetadata","getTokenType","getFontStyle","getForeground","getBackground","getClassNameFromMetadata","getInlineStyleFromMetadata","completionKindToCssClass","completionKindFromString","strict","isLocationLink","originSelectionRange","symbolKindToCssClass","_fromMapping","FoldingRangeKind","Comment","Imports","Region","isResourceTextEdit","ReferenceProviderRegistry","languageFeatureRegistry_1","RenameProviderRegistry","CompletionProviderRegistry","SignatureHelpProviderRegistry","HoverProviderRegistry","DocumentSymbolProviderRegistry","DocumentHighlightProviderRegistry","DefinitionProviderRegistry","DeclarationProviderRegistry","ImplementationProviderRegistry","TypeDefinitionProviderRegistry","CodeLensProviderRegistry","CodeActionProviderRegistry","DocumentFormattingEditProviderRegistry","DocumentRangeFormattingEditProviderRegistry","OnTypeFormattingEditProviderRegistry","LinkProviderRegistry","ColorProviderRegistry","SelectionRangeRegistry","FoldingRangeProviderRegistry","TokenizationRegistry","tokenizationRegistry_1","LineTokens","_tokens","_tokensCount","slicedEquals","sliceFromTokenIndex","sliceTokenCount","modes_1","getInlineStyle","findIndexInTokensArray","inflate","sliceAndInflate","SlicedLineTokens","convertToEndOffset","lineTextLength","desiredIndex","_startOffset","_endOffset","_deltaOffset","tokenEndOffset","NullStateImpl","NULL_STATE","NULL_MODE_ID","NULL_LANGUAGE_IDENTIFIER","nullTokenize","modeId","nullTokenize2","getDefaultMetadata","topLevelLanguageId","EMPTY_LINE_TOKENS","ModelLineTokens","_lineTokens","_invalid","deleteBeginning","toChIndex","deleteEnding","fromChIndex","tokensCount","fromTokenIndex","lineTokens_1","fromTokenStartOffset","delta_1","dest","lastEnd","_otherTokens","myTokens","otherTokens","otherTokensCount","chIndex","ModelLinesTokens","tokenizationSupport","initialState","getInitialState","_invalidLineStartIndex","_lastState","getTokens","rawLineTokens","isCheapToTokenize","hasLinesToTokenize","invalidateLine","_setIsInvalid","invalid","_isInvalid","_getState","_setTokens","hasDifferentLanguageId","eolCount","firstLineLength","firstLineIndex","lastLineIndex","lastLineTokens","_tokenizeOneLine","eventBuilder","_updateTokensUntilLine","_tokenizeText","tokenize2","nullMode_1","endStateIndex","lineStartState","freshState","registerChangedTokens","previousEndState","nextInvalidLineIndex","ModelTokensChangedEventBuilder","rangesLength","previousRange","tokenizationSupportChanged","createTextBufferFactory","pieceTreeTextBufferBuilder_1","createTextBuffer","cleanClassName","_normalizeOptions","ModelDecorationOptions","createDynamic","MODEL_ID","LONG_LINE_BOUNDARY","invalidFunc","TextModel","creationOptions","associatedResource","_onWillDispose","onWillDispose","_onDidChangeDecorations","DidChangeDecorationsEmitter","onDidChangeDecorations","_onDidChangeLanguage","onDidChangeLanguage","_onDidChangeLanguageConfiguration","onDidChangeLanguageConfiguration","_onDidChangeTokens","onDidChangeTokens","_onDidChangeOptions","onDidChangeOptions","_eventEmitter","DidChangeContentEmitter","_associatedResource","_attachedEditorCount","bufferLineCount","bufferTextLength","_isTooLargeForTokenization","LARGE_FILE_SIZE_THRESHOLD","LARGE_FILE_LINE_COUNT_THRESHOLD","_isTooLargeForSyncing","MODEL_SYNC_LIMIT","_setVersionId","_isDisposing","_tokenizationListener","_resetTokenizationState","emitModelTokensChangedEvent","_shouldAutoTokenize","_warmUpTokens","_revalidateTokensTimeout","_languageRegistryListener","_instanceId","singleLetter","_lastDecorationId","_decorationsTree","DecorationsTrees","_commandManager","editStack_1","_isUndoing","_isRedoing","_trimAutoWhitespaceLines","createFromString","DEFAULT_CREATION_OPTIONS","textBuffer","guessedIndentation","indentationGuesser_1","onDidChangeRawContentFast","fastEvent","onDidChangeRawContent","slowEvent","_clearTimers","_assertNotDisposed","_emitContentChangedEvent","rawChange","textModelEvents_1","setValueFromTextBuffer","_createContentChanged2","oldFullModelRange","oldModelValueLength","_increaseVersionId","_onBeforeEOLChange","_onAfterEOLChange","allDecorations","_ensureNodesHaveRanges","intervalTree_1","textModelTokens_1","_beginBackgroundTokenization","onBeforeAttached","onBeforeDetached","isAttachedToEditor","getAttachedEditorCount","isTooLargeForTokenization","smallLineCharCount","longLineCharCount","getOptions","getFormattingOptions","_newOpts","_normalizeIndentationFromWhitespace","normalizeIndentation","_alternativeVersionId","rawPosition","rawOffset","newVersionId","_overwriteAlternativeVersionId","newAlternativeVersionId","preserveBOM","fullModelRange","fullModelValue","getValueLength","rawRange","_validateRangeRelaxedNoAllocations","initialStartLineNumber","initialStartColumn","initialEndLineNumber","initialEndColumn","_isValidPosition","_lineNumber","validatePosition","_isValidRange","charCodeBeforeStart","charCodeBeforeEnd","startInsideSurrogatePair","endInsideSurrogatePair","modifyPosition","rawSearchScope","rawSearchStart","beginDeferredEmit","endDeferredEmit","pushEditOperations","_pushEditOperations","incomingEdits","editsAreNearCursors","foundEditNearSel","selIsAbove","selIsBelow","trimLineNumber","allowTrimLine","editText","_applyEdits","_eolCount","oldLineCount","newLineCount","rawContentChanges","changeLineCountDelta","editLineNumber","currentEditLineNumber","spliceStartLineNumber","spliceLineNumber","_undo","_redo","_changeDecorations","changeAccessor","addDecoration","_deltaDecorationsImpl","changeDecoration","newRange","_changeDecorationImpl","_changeDecorationOptionsImpl","removeDecoration","oldDecorations","newDecorations","_getTrackedRange","_setTrackedRange","newStickiness","TRACKED_RANGE_OPTIONS","removeAllDecorationsWithOwnerId","getDecorationOptions","decorationId","_getRangeAt","getLineDecorations","getLinesDecorations","_startLineNumber","_endLineNumber","_getDecorationsInRange","getOverviewRulerDecorations","getAllDecorations","filterRange","oldDecorationsIds","oldDecorationsLen","oldDecorationIndex","newDecorationsLen","newDecorationIndex","internalDecorationId","newDecoration","tokenizeViewport","inValidLineStartIndex","nonWhitespaceColumn","fakeLines","newNonWhitespaceIndex","flushTokens","_getLineTokens","getModeId","setMode","oldLanguage","newLanguage","_revalidateTokensNow","sw","stopwatch_1","_findLanguageBoundaries","rbStartOffset","rbEndOffset","rightBiasedWord","lbStartOffset","lbEndOffset","leftBiasedWord","findMatchingBracketUp","_bracket","bracketsSupport","_findMatchingBracketUp","matchBracket","_matchBracket","currentModeBrackets","searchStartOffset","searchEndOffset","foundBracket","foundBracketText","_matchFoundBracket","prevModeBrackets","_findMatchingBracketDown","searchStopOffset","tokenLanguageId","tokenStartOffset","hitText","modeBrackets","_toFoundBracket","computeIndentLevel","_computeIndentLevel","getActiveIndentGuide","offSide","up_aboveContentLineIndex","up_aboveContentLineIndent","up_belowContentLineIndex","up_belowContentLineIndent","up_resolveIndents","indent_1","indent_2","down_aboveContentLineIndex","down_aboveContentLineIndent","down_belowContentLineIndex","down_belowContentLineIndent","down_resolveIndents","indent_3","indent_4","goUp","goDown","upLineNumber","downLineNumber","upLineIndentLevel","currentIndent","_getIndentLevelForWhitespaceLine","downLineIndentLevel","getLinesIndentGuides","aboveContentLineIndex","aboveContentLineIndent","belowContentLineIndex","belowContentLineIndent","resultIndex","_decorationsTree0","_decorationsTree1","r0","overviewRulerOnly","ModelDecorationOverviewRulerOptions","darkColor","Center","_resolvedColor","getColor","_resolveColor","invalidateCachedColor","hoverMessage","glyphMarginHoverMessage","_deferredCnt","_shouldFire","_fastEmitter","_slowEmitter","_deferredEvent","autoCloseAlways","autoCloseNever","autoCloseBeforeWhitespace","CursorConfiguration","modelOptions","pageSize","autoClosingPairsOpen","autoClosingPairsClose","_electricChars","shouldAutoCloseBefore","_getShouldAutoClose","_getAutoClosingPairs","autoClosingPairs_1","_getSurroundingPairs","surroundingPairs_1","shouldRecreate","electricChars","_getElectricCharacters","electricChars_1","textModel_1","autoCloseConfig","_getLanguageDefinedShouldAutoClose","autoCloseBeforeSet_1","SingleCursorState","selectionStartLeftoverVisibleColumns","leftoverVisibleColumns","_computeSelection","hasSelection","move","inSelectionMode","CursorContext","viewModel","validateViewPosition","modelPosition","validateViewRange","expectedModelRange","convertViewRangeToModelRange","convertViewPositionToModelPosition","getCompletelyVisibleViewRange","getCompletelyVisibleModelRange","getCompletelyVisibleViewRangeAtScrollTop","getVerticalOffsetForViewLine","viewLineNumber","PartialModelCursorState","modelState","PartialViewCursorState","CursorState","fromModelState","fromViewState","fromModelSelection","modelSelection","fromModelSelections","modelSelections","EditOperationResult","commands","shouldPushStackElementBefore","shouldPushStackElementAfter","CursorColumns","isInsideSurrogatePair","visibleColumnFromColumn","nextRenderTabStop","visibleColumnFromColumn2","columnFromVisibleColumn","visibleColumn","beforeVisibleColumn","afterVisibleColumn","columnFromVisibleColumn2","nextIndentTabStop","prevRenderTabStop","prevIndentTabStop","isQuote","cachedStringRepeat","repeatCache","ShiftCommand","_useLastEditRangeForCursorEndPosition","_selectionStartColumnStaysPut","contentStartVisibleColumn","cursorCommon_1","indentCount","desiredTabStop","_addEditOperation","endLine","shouldIndentEmptyLines","previousLineExtraSpaces","extraSpaces","indentationEndIndex","isUnshift","desiredIndent","oneIndent","lastOp","ColumnSelection","_columnSelect","fromVisibleColumn","toVisibleColumn","reversed","isRTL","isLTR","visibleStartColumn","visibleEndColumn","viewStates","toVisualColumn","columnSelect","fromViewSelection","toViewLineNumber","toViewVisualColumn","fromViewPosition","fromViewVisibleColumn","columnSelectLeft","columnSelectRight","maxVisualViewColumn","minViewLineNumber","maxViewLineNumber","lineMaxViewColumn","lineMaxVisualViewColumn","columnSelectUp","isPaged","columnSelectDown","CursorPosition","MoveOperations","moveLeft","noOfColumns","moveRight","down","allowMoveOnLastLine","moveDown","translateDown","allowMoveOnFirstLine","moveUp","translateUp","moveToBeginningOfLine","firstNonBlankColumn","moveToEndOfLine","moveToBeginningOfBuffer","moveToEndOfBuffer","lastColumn","DeleteOperations","deleteRight","prevEditOperationType","deleteSelection","rightOfPosition","cursorMoveOperations_1","replaceCommand_1","_isAutoClosingPairDelete","_runAutoClosingPairDelete","deleteLeft","lastIndentationColumn","toColumn","leftOfPosition","TypeOperations","shiftCommand_1","outdent","_distributedPaste","_simplePaste","pasteOnNewLine","typeSelection","_distributePasteToCursors","multicursorText","paste","distributedPaste","_goodIndentForLine","expectedIndentAction","expectedEnterAction","_replaceJumpToNextIndent","typeText","tab","goodIndent","possibleTypeText","lineMaxColumn","replacePreviousChar","_typeCommand","keepPosition","_enter","lineText_1","indentation_1","indentation_2","normalIndent","increasedIndent","actualIndentation","lineText_2","indentation_3","ir","oldEndViewColumn","oldEndColumn","firstNonWhitespace","_isAutoIndentType","_runAutoIndentType","currentIndentation","_isAutoClosingCloseCharType","isEqualPair","lineTextBeforeCursor","_countNeedlesInHaystack","_runAutoClosingCloseCharType","_isBeforeClosingBrace","characterAfter","thisBraceIsSymmetric","isBeforeCloseBrace","otherCloseBrace","otherBraceIsSymmetric","_isAutoClosingOpenCharType","chIsQuote","characterBeforeCode","_runAutoClosingOpenCharType","closeCharacter","_shouldSurroundChar","_isSurroundSelectionType","isTypingAQuoteCharacter","selectionContainsOnlyWhitespace","_runSurroundSelectionType","surroundSelectionCommand_1","_isTypeInterceptorElectricChar","_typeInterceptorElectricChar","electricAction","matchLine","matchLineIndentation","newIndentation","lineFirstNonBlankColumn","compositionEndWithInterceptors","typeWithInterceptors","commands_1","commands_2","autoIndentFails","typeWithoutInterceptors","lineInsertBefore","lineInsertAfter","lineBreakInsert","enforceDefined","WordOperations","_createWord","wordType","nextCharClass","_findPreviousWordOnLine","_doFindPreviousWordOnLine","_findEndOfWord","_findNextWordOnLine","_doFindNextWordOnLine","_findStartOfWord","moveWordLeft","wordNavigationType","movedToPreviousLine","prevWordOnLine","_moveWordPartLeft","rightRight","moveWordRight","movedDown","nextWordOnLine","_moveWordPartRight","_deleteWordLeftWhitespace","lastNonWhitespace","deleteWordLeft","whitespaceHeuristics","_deleteWordPartLeft","toPosition","_findFirstNonWhitespaceChar","_deleteWordRightWhitespace","deleteWordRight","_deleteWordPartRight","prevWord","nextWord","endColumn_1","possiblePosition","WordPartOperations","deleteWordPartLeft","candidates","deleteWordPartRight","moveWordPartLeft","moveWordPartRight","CursorMoveCommands","addCursorDown","useLogicalLine","addCursorUp","_moveToLineStart","currentViewStateColumn","isFirstLineOfWrappedLine","currentViewStatelineNumber","_moveToLineStartByModel","_moveToLineStartByView","_moveToLineEnd","viewStatePosition","viewModelMaxColumn","isEndOfViewLine","modelStatePosition","modelMaxColumn","isEndLineOfWrappedLine","_moveToLineEndByModel","_moveToLineEndByView","expandLineSelection","viewSelection","selectAll","selectToLineNumber","selectToColumn","enteringLineNumber","selectToViewLineNumber","selectToViewColumn","endPositionOfSelectionStart","cursorWordOperations_1","cancelSelection","moveTo","unit","_moveHalfLineLeft","_moveLeft","_moveHalfLineRight","_moveRight","_moveUpByViewLines","_moveUpByModelLines","_moveDownByViewLines","_moveDownByModelLines","_moveToViewMinColumn","_moveToViewFirstNonWhitespaceColumn","_moveToViewCenterColumn","_moveToViewMaxColumn","_moveToViewLastNonWhitespaceColumn","visibleModelRange","modelLineNumber","_firstLineNumberInRange","modelColumn","_moveToModelPosition","_lastLineNumberInRange","visibleViewRange","findPositionInViewportIfOutside","viewColumn","_moveToViewPosition","newViewState","halfLine","toViewColumn","toModelLineNumber","toModelColumn","CursorMove","cursorMoveArg","by","schema","required","properties","enum","RawDirection","Left","Right","Up","Down","WrappedLineStart","WrappedLineFirstNonWhitespaceCharacter","WrappedLineColumnCenter","WrappedLineEnd","WrappedLineLastNonWhitespaceCharacter","ViewPortTop","ViewPortCenter","ViewPortBottom","ViewPortIfOutside","RawUnit","WrappedLine","Character","HalfLine","OneCursor","_selTrackedRange","_trackSelection","_removeTrackedRange","startTrackingSelection","_updateTrackedRange","stopTrackingSelection","asCursorState","readSelectionFromMarkers","ensureValidState","setState","viewSelectionStart","viewSelectionStart1","viewSelectionStart2","CursorCollection","primaryCursor","oneCursor_1","secondaryCursors","lastAddedCursorIndex","killSecondaryCursors","startTrackingSelections","stopTrackingSelections","updateContext","getAll","getViewPositions","getSelections","getViewSelections","setSelections","setStates","getPrimaryCursor","_setSecondaryStates","secondaryStates","secondaryCursorsLength","secondaryStatesLength","createCnt","_addSecondaryCursor","_removeSecondaryCursor","getLastAddedCursorIndex","_getAll","sortedCursors","sortedCursorIndex","currentSelection","nextSelection","winnerSortedCursorIndex","looserSortedCursorIndex","looserIndex","winnerIndex","looserSelection","winnerSelection","resultingRange","looserSelectionIsLTR","winnerSelectionIsLTR","resultingSelectionIsLTR","resultingSelection","resultingState","sortedCursors_1","sortedCursor","CursorStateChangedEvent","CursorModelState","cursorState","Cursor","_onDidReachMaxCursorCount","onDidReachMaxCursorCount","_onDidAttemptReadOnlyEdit","onDidAttemptReadOnlyEdit","_knownModelVersionId","_viewModel","_cursors","cursorCollection_1","_isHandling","_columnSelectData","_prevEditOperationType","hadFlushEvent","_onModelContentChanged","containsLineMappingChanged","updateCursorContext","MAX_CURSOR_COUNT","_emitStateChangedIfNecessary","setColumnSelectData","columnSelectData","_revealRange","revealRange","emitCursorRevealRange","scrollTo","restoreState","desiredSelections","selectionsFromMarkers","getColumnSelectData","primaryPos","getPrevEditOperationType","setPrevEditOperationType","_executeEditOperation","opResult","CommandExecutor","executeCommands","_interpretCommandResult","viewSelections","viewEvents","newCursorState","revealTarget","viewPositions","handlerId","H","cursorChangeReason","_replacePreviousChar","_paste","_cut","_externalExecuteCommand","_externalExecuteCommands","_interpretCompositionEnd","cursorTypeOperations_1","cursorDeleteOperations_1","selectionsBefore","trackedRanges","trackedRangesDirection","_innerExecuteCommands","_arrayIsEmpty","commandsData","_getEditOperations","loserCursorsMap","_getLoserCursorMap","filteredOperations","major","hadTrackedEditOperation","selectionsAfter","groupedInverseEditOperations","inverseEditOperations_1","minorBasedSorter","minor","cursorSelections","losingCursors","losingCursorIndex","losingCursors_1","losingCursor","_getEditOperationsFromCommand","majorIdentifier","operationMinor","editOperationBuilder","trackPreviousOnEmpty","currentOp","loserMajor","tokenizeToString","fallback","tokenizationResult","viewLineTokens","_tokenizeToString","tokenizeLineToHTML","partContent","ITextModelService","ITextResourceConfigurationService","ITextResourcePropertiesService","MinimapTokensColorTracker","_updateColorMap","getInstance","_INSTANCE","_colors","rgba_1","_backgroundIsLight","backgroundLuminosity","backgroundIsLight","MinimapCharRenderer","x2CharData","x1CharData","x2charData","x1charData","x2charDataLight","soften","x1charDataLight","Uint8ClampedArray","_getChIndex","x2RenderChar","dx","dy","useLighterFont","outWidth","backgroundR","backgroundG","backgroundB","deltaR","deltaG","deltaB","sourceOffset","destOffset","x1RenderChar","x2BlockRenderChar","colorR","colorG","colorB","x1BlockRenderChar","toUint8ClampedArrat","minimapCharRenderer","getOrCreateMinimapCharRenderer","_x1Data","x1Data","_x2Data","x2Data","minimapCharRenderer_1","createSplitLine","linePositionMapperFactory","columnsForFullWidthChar","positionMapper","createLineMapping","VisibleIdentitySplitLine","InvisibleIdentitySplitLine","SplitLine","OutputPosition","outputLineIndex","outputOffset","CoordinatesConverter","expectedModelPosition","validViewStart","validViewEnd","SplitLinesCollection","_validModelVersionId","_constructLines","hiddenAreasIds","createCoordinatesConverter","_ensureValidState","resetHiddenAreas","linesContent","hiddenAreas","areaId","hiddenAreaStart","hiddenAreaEnd","hiddenAreaIdx","nextLineNumberToUpdateHiddenArea","isInHiddenArea","getViewLineCount","prefixSumComputer","getHiddenAreas","decId","_reduceRanges","currentRangeStart","currentRangeEnd","setHiddenAreas","newRanges","oldRanges","hasDifference","newRanges_1","hasVisibleLine","lineChanged","newOutputLineCount","_modelColumn","setTabSize","newTabSize","setWrappingSettings","onModelFlushed","onModelLinesDeleted","outputFromLineNumber","outputToLineNumber","onModelLinesInserted","_toLineNumber","testPosition","hiddenAreas_1","totalOutputLineCount","insertPrefixSumValues","outputLineCount","onModelLineChanged","newText","oldOutputLineCount","lineMappingChanged","changeFrom","changeTo","insertFrom","insertTo","deleteFrom","deleteTo","acceptVersionId","_toValidViewLineNumber","viewLineCount","warmUpLookupCache","viewStartLineNumber","viewEndLineNumber","getViewLineMinColumn","modelMinPosition","modelMaxPosition","viewStartPosition","viewEndPosition","getViewLinesIndentGuides","modelStart","modelEnd","getViewLineMaxColumn","resultRepeatCount","resultRepeatOption","modelStartLineIndex","modelEndLineIndex","reqStart","modelLineIndex","viewLineStartIndex","getViewLineNumberOfModelPosition","viewLineEndIndex","option","viewIndents","currIndex","blockAtIndex","getViewLineContent","getViewLineLength","getViewLineData","getViewLinesData","needed","startModelLineIndex","startRemainder","fromViewLineIndex","remainingViewLineCount","toViewLineIndex","computedModelColumn","getModelColumnOfViewPosition","inputColumn","_modelLineNumber","validPosition","inputLineNumber","lineIndexChanged","getViewPositionOfModelPosition","_getViewLineNumberForModelPosition","deltaLineNumber_1","getAllOverviewRulerDecorations","OverviewRulerDecorations","decorations_1","decoration","lane","finalResult","finalResultLen","prevDecId","result_1","dec","_outputLineIndex","_fromOuputLineIndex","_toOutputLineIndex","globalStartIndex","outputColumn","_inputColumn","_globalStartIndex","_needed","_outputColumn","_deltaLineNumber","wrappedIndent","getWrappedLinesIndent","wrappedIndentLength","getOutputLineCount","getInputStartOffsetOfOutputLineIndex","getInputOffsetOfOutputPosition","getInputEndOffsetOfOutputLineIndex","deltaStartIndex","fromOuputLineIndex","toOutputLineIndex","globalIndex","adjustedColumn","getOutputPositionOfInputOffset","IdentityCoordinatesConverter","_validPosition","_validRange","IdentityLinesCollection","_newTabSize","_wrappingIndent","_wrappingColumn","_columnsForFullWidthChar","_newText","_viewStartLineNumber","_viewEndLineNumber","_minLineNumber","_maxLineNumber","decorations_2","prevLane","prevEndLineNumber","WrappingCharacterClassifier","BREAK_BEFORE","BREAK_AFTER","BREAK_OBTRUSIVE","CharacterHardWrappingLineMapperFactory","breakBeforeChars","breakAfterChars","breakObtrusiveChars","breakingColumn","hardWrappingIndent","wrappedTextIndentVisibleColumn","wrappedTextIndent","numberOfAdditionalTabs","lastBreakingOffset","breakingLengths","breakingLengthsIndex","niceBreakOffset","niceBreakVisibleColumn","obtrusiveBreakOffset","obtrusiveBreakVisibleColumn","charCodeIsTab","charCodeClass","prevCode","charColumnSize","breakBeforeOffset","restoreVisibleColumnFrom","nextCode","CharacterHardWrappingLineMapping","prefixSums","wrappedLinesIndent","_prefixSums","_wrappedLinesIndent","inputOffset","splitLinesCollection_1","USE_IDENTITY_LINES_COLLECTION","ViewModel","_tokenizeViewportSoon","viewportStartLine","viewportStartLineTrackedRange","viewportStartLineDelta","hardWrappingLineMapperFactory","characterHardWrappingLineMapper_1","viewLayout_1","viewModelDecorations_1","_registerModelEvents","eventsCollector","_onConfigurationChanged","linesViewportData","setHasFocus","previousViewportStartModelPosition","previousViewportStartViewPosition","restorePreviousViewportStart","viewPositionTop","hadOtherModelChange","hadModelLineChangeThatChangedLineMapping","linesDeletedEvent","linesInsertedEvent","linesChangedEvent","setMaxLineNumber","viewRanges","hiddenStartLineNumber","hiddenEndLineNumber","startViewLineNumber","endViewLineNumber","compatViewState","firstViewLineNumber","firstPosition","firstPositionDeltaTop","reduceRestoreState","_reduceRestoreStateCompatibility","getTabSize","setViewport","viewportStartLineTop","getMinimapLinesRenderingData","invalidateOverviewRulerColorCache","deduceModelPositionRelativeToViewPosition","viewAnchorPosition","modelAnchor","resultOffset","forceCRLF","newLineCharacter","nonEmptyRanges","modelLineNumbers","viewLineStart","nonEmptyRanges_1","nonEmptyRange","_getColorMap","_getHTMLToCopy","textToHtmlTokenizer_1","FoldingDecorationProvider","autoHideFoldingControls","COLLAPSED_VISUAL_DECORATION","EXPANDED_AUTO_HIDE_VISUAL_DECORATION","EXPANDED_VISUAL_DECORATION","computeRanges","markers","MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT","previousRegions","insertFirst","ID_INDENT_PROVIDER","IndentRangeProvider","_indentOccurrences","maxIndent","MoveLinesCommand","isMovingDown","_isMovingDown","_autoIndent","_moveEndLineSelectionShrink","modelLineCount","buildIndentConverter","otherLineNumber","movingLineNumber_1","movingLineText","insertingText_1","shouldAutoIndent","movingLineMatchResult","matchEnterRule","oldIndentation","newSpaceCnt","indentUtils","trimLeft","indentOfMovingLine","oldSpaceCnt","getIndentEditsOfMovingBlock","newIndentatOfMovingBlock","spaceCntOffset","indentOfFirstLine","oldIndent","oneLineAbove","validPrecedingLine","enter","enterPrefix","indentMetadataOfMovelingLine","languageAtSelectionStart","originalIndent","newSpacesCnt","newIndent","defaultColor","showArrow","showFrame","frameColor","arrowColor","keepEditorSelection","ViewZoneDelegate","_onDomNodeTop","_onComputedHeight","OverlayWidgetDelegate","Arrow","_ruleName","_IdGenerator","_updateStyle","where","ZoneWidget","_positionMarkerId","_isShowing","isAccessible","_getWidth","_getLeft","_onWidth","_overlayWidget","_viewZone","changeViewZones","_arrow","_fillContainer","_initSash","_applyStyles","_onViewZoneTop","_onViewZoneHeight","containerHeight","_decoratingElementsHeight","_doLayout","_resizeSash","rangeOrPos","_showImpl","viewZoneDomNode","maxHeightInLines","arrowHeight","frameThickness","width_1","frameWidth","borderTopWidth","borderBottomWidth","revealLineNumber","revealLine","setCssClass","classToReplace","widthInPixel","heightInPixel","_relayout","newHeightInLines","isResizeable","lineDelta","roundedLineDelta","MonarchStackElementFactory","maxCacheDepth","_maxCacheDepth","MonarchStackElement","stackElementId","getStackElementId","popall","EmbeddedModeData","MonarchLineStateFactory","embeddedModeData","MonarchLineState","MonarchClassicTokensCollector","_language","_lastTokenType","_lastTokenLanguage","enterMode","nestedModeTokenize","embeddedModeLine","offsetDelta","nestedModeId","embeddedModeState","nestedModeTokenizationSupport","modes","nestedResult","tokenize","MonarchModernTokensCollector","modeService","_modeService","_theme","_prependTokens","_currentLanguageId","_lastTokenMetadata","bLen","cLen","MonarchTokenizer","standaloneThemeService","_standaloneThemeService","_modeId","_lexer","_embeddedModes","embeddedLoaded","emitting","_tokenizationRegistryListener","isOneOfMyEmbeddedModes","getLoadStatus","nestedModeStatus","loaded","tokenizationSupportPromise","rootState","lineState","tokensCollector","endLineState","_tokenize","getTheme","tokenTheme","_nestedTokenize","_myTokenize","_findLeavingNestedModeOffset","popOffset","hasEmbeddedPopRule","regexSource","nestedEndState","nestedModeLine","restOfTheLine","_safeRuleName","groupMatching","forceEvaluation","pos0","stackLen0","groupLen0","enteringEmbeddedMode","groupEntry","restOfLine","rule_1","totalLen","brackets_1","bracketType","findBracket","enteringEmbeddedModeId","getModeIdForLanguageName","embeddedModeData_1","_getNestedEmbeddedModeData","mimetypeOrModeId","_locateMode","isRegisteredMode","triggerMode","createTokenizationSupport","_colorize","tokenizeResult","viewLineRenderer_1","_actualColorize","monarchLexer_1","status_1","_fakeColorize","Colorizer","colorizeElement","themeService","mimeType","setTheme","nodeValue","colorize","colorizeLine","colorizeModelLine","inflatedTokens","IStandaloneThemeService","IAccessibilityService","IClipboardService","ICommandService","CommandsRegistry","_commands","_onDidRegisterCommand","onDidRegisterCommand","registerCommand","idOrCommand","constraints_1","actualHandler_1","removeFn","registerCommandAlias","oldId","newId","executeCommand","getCommand","getCommands","OpenerService","_editorService","_commandService","_opener","opener_1","handled","_doOpen","resources","openCodeEditor","openToSide","__param","codeEditorService_1","getLinks","lists","provideLinks","LinksList","Link","_link","_provider","resolveLink","tuples","newLinks","_union","tuples_1","oldLinks","oldLen","newLen","oldLink","newLink","aType","bType","ContextKeyExpr","ContextKeyDefinedExpr","ContextKeyEqualsExpr","ContextKeyRegexExpr","not","ContextKeyNotExpr","and","expr","ContextKeyAndExpr","deserialize","serialized","_deserializeOne","serializedOne","ContextKeyNotEqualsExpr","_deserializeValue","_deserializeRegexValue","serializedValue","caseIgnoreFlag","evaluate","thisSource","otherSource","_normalizeArr","RawContextKey","bindTo","createKey","getContextKeyValue","toNegated","IContextKeyService","SET_CONTEXT_COMMAND_ID","EditorContextKeys","editorTextFocus","contextkey_1","textInputFocus","hasNonEmptySelection","hasOnlyEmptySelection","hasMultipleSelections","hasSingleSelection","tabMovesFocus","tabDoesNotMoveFocus","isInEmbeddedEditor","hasCompletionItemProvider","hasCodeActionsProvider","hasCodeLensProvider","hasDefinitionProvider","hasDeclarationProvider","hasImplementationProvider","hasTypeDefinitionProvider","hasHoverProvider","hasDocumentHighlightProvider","hasDocumentSymbolProvider","hasReferenceProvider","hasRenameProvider","hasSignatureHelpProvider","hasDocumentFormattingProvider","hasDocumentSelectionFormattingProvider","hasMultipleDocumentFormattingProvider","hasMultipleDocumentSelectionFormattingProvider","SuggestAlternatives","_ckOtherSuggestions","OtherSuggestions","_acceptNext","_ignore","acceptNext","_moveIndex","_index","additionalTextEdits","WordContextKey","_ckAtEnd","AtEnd","_confListener","_update","_selectionListener","checkForWordEnd","isIMenuItem","IMenuService","MenuRegistry","_menuItems","_onDidChangeMenu","onDidChangeMenu","addCommand","appendMenuItem","getMenuItems","_appendImplicitItems","temp_1","ExecuteCommandAction","SubmenuItemAction","MenuItemAction","commandService","toggled","runArgs","shouldForwardArgs","MenuService","createMenu","_build","menuId","onDidChangeContext","affectsSome","_contextKeys","_menuGroups","menuItems","_compareMenuItems","menuItems_1","groupName","_fillInKbExprKeys","activeActions","items_1","exp","aGroup","bGroup","aPrio","order","bPrio","aTitle","bTitle","IContextViewService","IContextMenuService","IDialogService","ServiceCollection","instanceOrDescriptor","_canUseProxy","Proxy","InstantiationService","services","serviceCollection_1","_services","createChild","invokeFunction","_trace","Trace","traceInvocation","_done","isOptional","_getOrCreateServiceInstance","createInstance","ctorOrDescriptor","traceCreation","_createInstance","serviceDependencies","serviceArgs","serviceDependencies_1","dependency","firstServiceArgPos","_setServiceInstance","_getServiceInstanceOrDescriptor","instanceOrDesc","_createAndCacheServiceInstance","branch","throwCycleError","graph","graph_1","dependencies_1","roots_1","_createServiceInstanceWithOwner","_createServiceInstance","_supportsDelayedInstantiation","idle_1","_start","_dep","_None","printChild","causedCreation","nested","dur","_totals","AbstractKeybindingService","telemetryService","notificationService","statusService","_telemetryService","_statusService","_notificationService","_currentChord","_currentChordChecker","_currentChordStatusMessage","_onDidUpdateKeybindings","lookupKeybinding","commandId","_getResolver","lookupPrimaryKeybinding","resolvedKeybinding","softDispatch","resolveKeyboardEvent","isChord","getDispatchParts","contextValue","currentChord","keypress","_enterChordMode","keypressLabel","setStatusMessage","chordEnterTime","_documentHasFocus","_leaveChordMode","_dispatch","_doDispatch","shouldPreventDefault","resolveResult","enterChord","commandArgs","publicLog","BaseResolvedKeybinding","_os","_parts","_getLabel","_getAriaLabel","_getPart","_getDispatchPart","IKeybindingService","KeybindingResolver","defaultKeybindings","overrides","_defaultKeybindings","_defaultBoundCommands","_lookupMap","_keybindings","keypressParts","_addKeyPress","_isTargetedForRemoval","defaultKb","keypressFirstPart","keypressChordPart","rawOverrides","rawOverrides_1","conflicts","_addToLookupMap","conflict","conflictIsChord","itemIsChord","whenIsEntirelyIncluded","_removeFromLookupMap","aExpressions","aIndex","bExpressions_1","bExpr","bExprMatched","lookupMap","_findCommand","removeElementsAfterNulls","ResolvedKeybindingItem","USLayoutResolvedKeybinding","_keyCodeToUILabel","getDispatchStr","baseResolvedKeybinding_1","ILabelService","ILayoutService","ContextViewService","layoutService","contextView","contextview_1","onLayout","layoutService_1","ILogService","NullLogService","canSyncModel","modelService","STOP_SYNC_MODEL_DELTA_TIME_MS","STOP_WORKER_DELTA_TIME_MS","EditorWorkerServiceImpl","configurationService","logService","_modelService","_workerManager","WorkerManager","_logService","withWorker","client","WordBasedCompletionItemProvider","canComputeDiff","sw_1","canNavigateValueSet","resourceConfiguration_1","log_1","workerManager","_configurationService","provideCompletionItems","_editorWorkerClient","_checkStopIdleWorker","onModelRemoved","_checkStopEmptyWorker","getModels","_lastWorkerUsedTime","EditorWorkerClient","EditorModelManager","keepIdleModels","_syncedModels","_syncedModelsLastUsedTime","_proxy","_checkStopModelSync","esureSyncedResources","resourceStr","_beginModelSync","currentTime","toRemove","toRemove_1","_stopModelSync","toDispose","SynchronousWorkerClient","_instance","_proxyObj","_workerFactory","defaultWorkerFactory_1","_modelManager","_getOrCreateWorker","editorSimpleWorker_1","_getProxy","_getOrCreateModelManager","_withSyncedResources","createWebWorker","MonacoWebWorkerImpl","_foreignModuleId","_foreignModuleCreateData","_foreignProxy","_getForeignProxy","foreignMethods","foreignProxy","foreignMethods_1","foreignMethod","getProxy","withSyncedResources","editorWorkerServiceImpl_1","fromSeverity","severity","severity_1","Hint","IMarkerData","emptyString","makeKey","markerData","IMarkerService","MapMap","key1","key2","MarkerStats","infos","warnings","unknowns","_service","_subscription","onMarkerChanged","oldStats","_substract","newStats","_resourceStats","_add","markers_1","MarkerService","_onMarkerChanged","_onMarkerChangedEvent","_debouncer","_byResource","_byOwner","owner","changeOne","markerData_1","_toMarker","relatedInformation","tags","severities","take","data_1","_dedupeMap","INotificationService","NoOpNotification","IOpenerService","NullOpenerService","_serviceBrand","registerOpener","MarkdownRenderer","_openerService","_onDidRenderCodeBlock","onDidRenderCodeBlock","languageAlias","modeService_1","MarginComputer","setLineNumber","clearResult","toHoverMessage","isFromSynchronousComputation","ModesGlyphHoverWidget","openerService","_lastLineNumber","_markdownRenderer","markdownRenderer_1","_hoverOperation","hoverOperation_1","_withResult","_renderDisposeables","startShowingAt","_messages","_renderMessages","createDocumentFragment","renderedContents","hoverWidgets_1","IProgressService","RegistryImpl","Types","as","Registry","Extensions","ModesRegistry","EditorModesRegistry","_onDidChangeLanguages","onDidChangeLanguages","_languages","_dynamicLanguages","registerLanguage","getLanguages","PLAINTEXT_MODE_ID","PLAINTEXT_LANGUAGE_IDENTIFIER","extensions","aliases","mimetypes","getConfiguredLangId","configuredLangId","modesRegistry_1","cssEscape","getIconClasses","fileKind","files_1","ROOT_FOLDER","FOLDER","name_1","dotSegments","getModeIdByFilepathOrFirstLine","JSONContribution","jsonContributionRegistry","JSONContributionRegistry","_onDidChangeSchema","schemasById","registerSchema","unresolvedSchemaContent","normalizeId","notifySchemaChanged","getDefaultValue","validateProperty","OVERRIDE_PROPERTY_PATTERN","configurationRegistry","getConfigurationProperties","Configuration","allSettings","patternProperties","applicationSettings","machineSettings","windowSettings","resourceSettings","editorConfigurationSchemaId","contributionRegistry","jsonContributionRegistry_1","ConfigurationRegistry","overrideIdentifiers","_onDidSchemaChange","_onDidUpdateConfiguration","defaultOverridesConfigurationNode","configurationContributors","editorConfigurationSchema","additionalProperties","errorMessage","configurationProperties","excludedConfigurationProperties","computeOverridePropertyPattern","registerConfiguration","registerConfigurations","configurations","validateAndRegisterProperties","registerJSONConfiguration","updateSchemaForOverrideSettingsConfiguration","registerOverrideIdentifiers","updateOverridePropertyPatternKey","overridable","propertyKeys","included","subNodes","allOf","subNodes_1","SETTINGS_OVERRRIDE_NODE_ID","overridePropertyPattern","$ref","subNode","OVERRIDE_PATTERN_WITH_SUBSTITUTION","OVERRIDE_PROPERTY","getEditorConfigurationKeys","cachedEditorConfigurationKeys","editorConfiguration","editorOptions","TabFocus","_tabFocus","_onDidChangeTabFocus","onDidChangeTabFocus","getTabFocusMode","setTabFocusMode","CommonEditorConfiguration","isSimpleWidget","_rawOptions","_validatedOptions","_isDominatedByLongLines","_lineNumbersDigitCount","_recomputeOptions","observeReferenceElement","oldOptions","_computeInternalOptions","getRawOptions","partialEnv","_getEnvConfiguration","fontInfo_1","readConfiguration","_primitiveArrayEquals","_subsetEquals","subset","subsetValue","baseValue","setIsDominatedByLongLines","_digitCount","configurationRegistry_1","editor.fontFamily","editor.fontWeight","editor.fontSize","editor.lineHeight","editor.letterSpacing","editor.lineNumbers","enumDescriptions","editor.renderFinalNewline","editor.rulers","editor.wordSeparators","editor.tabSize","markdownDescription","editor.insertSpaces","editor.detectIndentation","editor.roundedSelection","editor.scrollBeyondLastLine","editor.scrollBeyondLastColumn","editor.smoothScrolling","editor.minimap.enabled","editor.minimap.side","editor.minimap.showSlider","editor.minimap.renderCharacters","editor.minimap.maxColumn","editor.hover.enabled","editor.hover.delay","editor.hover.sticky","editor.find.seedSearchStringFromSelection","editor.find.autoFindInSelection","editor.find.globalFindClipboard","editor.find.addExtraSpaceOnTop","editor.wordWrap","markdownEnumDescriptions","editor.wordWrapColumn","editor.wrappingIndent","editor.mouseWheelScrollSensitivity","editor.fastScrollSensitivity","editor.multiCursorModifier","editor.multiCursorMergeOverlapping","editor.quickSuggestions","anyOf","editor.quickSuggestionsDelay","editor.parameterHints.enabled","editor.parameterHints.cycle","editor.autoClosingBrackets","editor.autoClosingQuotes","editor.autoSurround","editor.formatOnType","editor.formatOnPaste","editor.autoIndent","editor.suggestOnTriggerCharacters","editor.acceptSuggestionOnEnter","editor.acceptSuggestionOnCommitCharacter","editor.snippetSuggestions","editor.emptySelectionClipboard","editor.copyWithSyntaxHighlighting","editor.wordBasedSuggestions","editor.suggestSelection","editor.suggestFontSize","editor.suggestLineHeight","editor.tabCompletion","editor.suggest.filterGraceful","editor.suggest.localityBonus","editor.suggest.shareSuggestSelections","editor.suggest.snippetsPreventQuickSuggestions","editor.suggest.showIcons","editor.suggest.maxVisibleSuggestions","editor.suggest.filteredTypes","keyword","field","struct","interface","operator","constant","enumMember","customcolor","folder","typeParameter","editor.gotoLocation.multiple","editor.selectionHighlight","editor.occurrencesHighlight","editor.overviewRulerLanes","editor.overviewRulerBorder","editor.cursorBlinking","editor.mouseWheelZoom","editor.cursorSmoothCaretAnimation","editor.cursorStyle","editor.cursorWidth","editor.fontLigatures","editor.hideCursorInOverviewRuler","editor.renderWhitespace","editor.renderControlCharacters","editor.renderIndentGuides","editor.highlightActiveIndentGuide","editor.renderLineHighlight","editor.codeLens","editor.folding","editor.foldingStrategy","editor.showFoldingControls","editor.matchBrackets","editor.glyphMargin","editor.useTabStops","editor.trimAutoWhitespace","editor.stablePeek","editor.dragAndDrop","editor.accessibilitySupport","editor.showUnused","editor.links","editor.colorDecorators","editor.lightbulb.enabled","editor.maxTokenizationLineLength","editor.codeActionsOnSave","source.organizeImports","source.fixAll","editor.codeActionsOnSaveTimeout","editor.selectionClipboard","diffEditor.renderSideBySide","diffEditor.ignoreTrimWhitespace","editor.largeFileOptimizations","diffEditor.renderIndicators","isEditorConfigurationKey","isDiffEditorConfigurationKey","CSSBasedConfigurationCache","_keys","_values","put","getValues","clearAllFontInfos","CSSBasedConfiguration","clearCache","_evictUntrustedReadingsTimeout","_writeToCache","_evictUntrustedReadings","somethingRemoved","readConfig","_actualReadConfiguration","createRequest","monospace","charWidthReader_1","typicalHalfwidthCharacter","typicalFullwidthCharacter","digit0","digit1","digit2","digit3","digit4","digit5","digit6","digit7","digit8","digit9","rightwardsArrow","halfwidthRightwardsArrow","referenceWidth","canTrustBrowserZoomLevel","accessibilityService","_elementSizeObserver","elementSizeObserver_1","_onReferenceDomElementSizeChanged","_onCSSBasedConfigurationChanged","applyFontInfoSlow","_getExtraEditorClassName","commonEditorConfig_1","ViewOverlays","_visibleLines","viewLayer_1","_dynamicOverlays","_isFocused","ViewOverlayLine","addDynamicOverlay","overlay","dynamicOverlay","_viewOverlaysRender","dynamicOverlays","_renderedContent","ContentViewOverlays","MarginViewOverlays","configuration_1","ViewCursorRenderData","textContentClassName","ViewCursor","_cursorStyle","_lineCursorWidth","_lastRenderedContent","onCursorPositionChanged","_prepareRender","visibleRangeForCharacter","newPosition","LanguagesRegistry","useModesRegistry","_warnOnOverwrite","_nextLanguageId2","_languageIdToLanguage","_languageToLanguageId","_mimeTypesMap","_nameMap","_lowercaseNameMap","_initializeFromRegistry","_registerLanguages","desc_1","_registerLanguage","mimetype","_getLanguageId","resolvedLanguage","filenames","configurationFiles","_mergeLanguage","primaryMime","filenamePatterns","_f","filenamePattern","firstLineRegexStr","firstLineRegex","langAliases","_g","langAliases_1","langAlias","containsAliases","bestName","getModeIdForLanguageNameLowercase","languageNameLower","extractModeIds","commaSeparatedMimetypesOrCommaSeparatedIds","mimeTypeOrId","getModeIdsFromFilepathOrFirstLine","filepath","mimeTypes","LanguageSelection","onLanguagesMaybeChanged","_selector","_evaluate","ModeServiceImpl","_onDidCreateMode","onDidCreateMode","_onLanguagesMaybeChanged","_instantiatedModes","languagesRegistry_1","modeIds","_createModeAndGetLanguageIdentifier","createByFilepathOrFirstLine","_getOrCreateMode","abstractMode_1","addToValueTree","settingsTreeRoot","conflictReporter","doRemoveFromValueTree","valueTree","IConfigurationService","toValuesTree","removeFromValueTree","getConfigurationValue","settingPath","component","accessSetting","getConfigurationKeys","getDefaultValues","valueTreeRoot","overrideIdentifierFromKey","getMigratedSettingValue","currentSettingName","legacySettingName","setting","inspect","legacySetting","user","workspace","workspaceFolder","ModelData","_languageSelection","_languageSelectionListener","_modelEventListeners","_disposeLanguageSelection","setLanguage","languageSelection","DEFAULT_EOL","ModelServiceImpl","resourcePropertiesService","_onModelAdded","onModelAdded","_onModelRemoved","_onModelModeChanged","onModelModeChanged","_resourcePropertiesService","_modelCreationOptionsByLanguageAndResource","_configurationServiceSubscription","_updateModelOptions","_readModelOptions","parsedTabSize","parsedIndentSize","newDefaultEOL","getCreationOptions","overrideIdentifier","oldOptionsByLanguageAndResource","modelId","modelData","_setModelOptionsForModel","currentOptions","_createModelData","oldModeId","newModeId","ConfigurationModel","_contents","_overrides","checkAndFreeze","section","overrideContents","getContentsForOverrideIdentifer","contentsForKey","overrideContentsForKey","mergeContents","others_1","otherOverride","identifiers","addKey","removeValue","removeKey","DefaultConfigurationModel","_defaultConfiguration","_localUserConfiguration","_remoteUserConfiguration","_workspaceConfiguration","_folderConfigurations","_memoryConfiguration","_memoryConfigurationByResource","_freeze","_workspaceConsolidatedConfiguration","_foldersConsolidatedConfigurations","getConsolidateConfigurationModel","updateValue","memoryConfiguration","consolidateConfigurationModel","folderConfigurationModel","getFolderConfigurationModelForResource","memoryConfigurationModel","userConfiguration","userLocal","localUserConfiguration","userRemote","remoteUserConfiguration","memory","_userConfiguration","configurationModel","getConsolidatedConfigurationModelForResource","consolidateConfiguration","getWorkspaceConsolidatedConfiguration","getFolder","getFolderConsolidatedConfiguration","memoryConfigurationForResource","folderConsolidatedConfiguration","workspaceConsolidateConfiguration","folderConfiguration","KEYBINDING_CONTEXT_ATTR","Context","NullContext","ConfigAwareContextValuesContainer","allKeys","ArrayContextKeyChangeEvent","changedKeys","affectedKeys","contextKey","_keyPrefix","configKey","configValue","ContextKey","setContext","removeContext","SimpleContextKeyChangeEvent","CompositeContextKeyChangeEvent","AbstractContextKeyService","myContextId","_onDidChangeContext","_myContextId","bufferChangeEvents","createScoped","ScopedContextKeyService","getContextValuesContainer","keybindingResolver_1","myContext","findContextAttr","ContextKeyService","_contexts","_lastContextId","contextId","createChildContext","parentContextId","disposeContext","weight1","weight2","KeybindingsRegistryImpl","_coreKeybindings","_extensionKeybindings","_cachedMergedKeybindings","bindToCurrentPlatform","kb","win","registerKeybindingRule","actualKb","primary","kk","_registerDefaultKeybinding","weight","secondary","registerCommandAndKeybindingRule","_mightProduceChar","_assertNoCtrlAlt","getDefaultKeybindings","KeybindingsRegistry","EditorModes","platform_2","getContextScopedWidget","createAndBindHistoryNavigationWidgetScopedContextKeyService","scopedContextKeyService","createWidgetScopedContextKeyService","bindContextScopedWidget","HistoryNavigationWidgetContext","historyNavigationEnablement","HistoryNavigationEnablementContext","ContextScopedHistoryInputBox","historyNavigator","ContextScopedFindInput","showFindOptions","findInput_1","keybindingsRegistry_1","IStorageService","InMemoryStorageService","_onDidChangeStorage","onWillSaveState","globalCache","workspaceCache","getCache","fallbackValue","getBoolean","store","valueStr","ICodeLensCache","CacheItem","CodeLensCache","storageService","_fakeProvider","provideCodeLenses","_deserialize","_serialize","symbol","symbols","storage_1","extensions_1","Memory","topScore","preselect","NoMemory","memorize","fromJSON","LRUMemory","_seq","lineSuffix","PrefixMemory","_trie","data_2","SuggestMemoryService","_storageService","_configService","_storagePrefix","share","_persistSoon","_saveState","affectsConfiguration","onDidChangeStorage","_mode","_shareMem","shareMem","_strategy","ISuggestMemoryService","ITelemetryService","registerLanguageCommand","Command","_kbOpts","kbOpts","_menubarOpts","menubarOpts","_description","kbWhen","kbExpr","runCommand","EditorCommand","bindToContribution","controllerGetter","EditorControllerCommandImpl","_callback","runEditorCommand","codeEditorService","getActiveCodeEditor","invokeWithinContext","editorAccessor","EditorAction","menuOpts","reportTelemetry","telemetry_1","getTelemetryData","registerDefaultLanguageCommand","editorPosition","resolverService_1","registerEditorCommand","editorCommand","EditorContributionRegistry","registerEditorAction","registerInstantiatedEditorAction","editorAction","registerEditorContribution","EditorExtensionsRegistry","getEditorCommand","getEditorActions","getEditorContributions","editorContributions","editorActions","editorCommands","registerOverwritableCommand","EditorHandlerCommand","CORE_WEIGHT","CoreEditorCommand","_getCursors","runCoreEditorCommand","editorExtensions_1","EditorScroll_","scrollArg","revealCursor","Page","HalfPage","RevealLine_","reveaLineArg","RawAtArgument","Top","Bottom","CoreNavigationCommands","BaseMoveToCommand","_inSelectionMode","cursorMoveCommands_1","MoveTo","MoveToSelect","ColumnSelectCommand","_getColumnSelectResult","ColumnSelect","prevColumnSelectData","validatedViewPosition","validatedPosition","cursorColumnSelection_1","mouseColumn","CursorColumnSelectLeft","editorContextKeys_1","CursorColumnSelectRight","ColumnSelectUpCommand","_isPaged","CursorColumnSelectUp","CursorColumnSelectPageUp","ColumnSelectDownCommand","CursorColumnSelectDown","CursorColumnSelectPageDown","CursorMoveImpl","parsed","_runCursorMove","CursorMoveBasedCommand","_staticArgs","dynamicArgs","CursorLeft","CursorLeftSelect","CursorRight","CursorRightSelect","CursorUp","CursorUpSelect","CursorPageUp","CursorPageUpSelect","CursorDown","CursorDownSelect","CursorPageDown","CursorPageDownSelect","CreateCursor","class_4","wholeLine","newModelPosition","newViewPosition","LastCursorMoveToSelect","class_5","newStates","HomeCommand","CursorHome","CursorHomeSelect","CursorLineStart","class_6","_exec","EndCommand","CursorEnd","CursorEndSelect","CursorLineEnd","class_7","TopCommand","CursorTop","CursorTopSelect","BottomCommand","CursorBottom","CursorBottomSelect","EditorScrollImpl","_runEditorScroll","_computeDesiredScrollTop","desiredVisibleViewRange","desiredTopModelLineNumber","desiredTopViewPosition","noOfLines","deltaLines","EditorScroll","ScrollLineUp","class_8","ScrollPageUp","class_9","ScrollLineDown","class_10","ScrollPageDown","class_11","WordCommand","WordSelect","WordSelectDrag","LastCursorWordSelect","class_12","lastAddedState","LineCommand","LineSelect","LineSelectDrag","LastCursorLineCommand","LastCursorLineSelect","LastCursorLineSelectDrag","ExpandLineSelection","class_13","CancelSelection","class_14","RemoveSecondaryCursors","class_15","RevealLine","class_16","revealLineArg","revealAt","SelectAll","class_17","SetSelection","class_18","CoreEditingCommands","CoreEditingCommand","runCoreEditingCommand","LineBreakInsert","class_19","class_20","Tab","class_21","DeleteLeft","class_22","DeleteRight","class_23","EditorOrNativeTextInputCommand","_editorHandler","editorHandler","_inputHandler","inputHandler","focusedEditor","_runEditorHandler","activeEditor","execCommand","HANDLER","_handlerId","editorCommon_1","ViewController","outgoingEvents","commandDelegate","_execMouseCommand","executeEditorCommand","compositionStart","compositionEnd","coreCommands_1","_validateViewColumn","_hasMulticursorModifier","_hasNonMulticursorModifier","dispatchMouse","startedOnLineNumbers","_lastCursorLineSelect","_createCursor","_lineSelectDrag","_lineSelect","mouseDownCount","_selectAll","_lastCursorLineSelectDrag","_lastCursorWordSelect","_wordSelectDrag","_wordSelect","_lastCursorMoveToSelect","_moveToSelect","_usualArgs","_convertViewToModelPosition","emitKeyDown","emitKeyUp","emitContextMenu","emitMouseMove","emitMouseLeave","emitMouseUp","emitMouseDown","emitMouseDrag","emitMouseDrop","emitMouseWheel","MoveCaretAction","selections_1","moveCaretCommand_1","MoveCaretLeftAction","MoveCaretRightAction","TransposeLettersAction","positionLeftOf","positionRightOf","middlePosition","beginPosition","leftChar","rightChar","replaceRange","CLIPBOARD_CONTEXT_MENU_GROUP","supportsCut","queryCommandSupported","supportsCopy","supportsCopyWithSyntaxHighlighting","supportsPaste","ExecCommandAction","browserCommand","ExecCommandCutAction","ExecCommandCopyAction","ExecCommandPasteAction","ExecCommandCopyWithSyntaxHighlightingAction","textAreaInput_1","getCodeActions","rangeOrSelection","codeActionContext","only","cts","editorState_1","providedCodeActionKinds","codeActionTrigger_1","getCodeActionProviders","provideCodeActions","providedCodeActions","newProviders","CodeActionSet","codeActionsComparator","diagnostics","fix","SUPPORTED_CODE_ACTIONS","CodeActionOracle","_markerService","_signalChange","_delay","_progressService","_autoTriggerTimer","_onMarkerChanges","_onCursorChange","_getRangeOfSelectionUnlessWhitespaceEnclosed","_createEventAndSignalChange","_getRangeOfMarker","CodeActionsState","markerRange","codeAction_1","showWhile","Triggered","CodeActionModel","_onDidChangeState","_supportedCodeActions","onDidChangeModelLanguage","_codeActionOracle","supportedActions","LightBulbWidget","_onClick","codeActionModel_1","_futureFixes","buttons","monitor","tryShow","fixes","_show","isFolded","effectiveLineNumber","_posPref","hasAutoFix","getCodeLensData","itemResolveCount","resolveCodeLens","value_1","getColors","colors","provideDocumentColors","colorInfo","getColorPresentations","provideColorPresentations","rawCIs","result_2","ci","green","presentations","ColorDetector","_codeEditorService","_globalToDispose","_localToDispose","_decorationsIds","_colorDatas","_colorDecoratorIds","_decorationsTypes","_isEnabled","onModelChanged","prevIsEnabled","removeAllDecorations","_timeoutTimer","_computePromise","deprecatedConfig","getContribution","beginCompute","RECOMPUTE_TIME","color_2","colorInfos","updateDecorations","updateColorDecorators","colorDatas","colorData","newDecorationsTypes","subKey","hash_1","registerDecorationType","contentText","dark","resolveDecorationOptions","subType","removeDecorationType","getColorData","CommentLineAction","lineCommentCommand_1","ToggleCommentLineAction","AddLineCommentAction","RemoveLineCommentAction","BlockCommentAction","selections_2","ContextMenuController","_contextViewService","_keybindingService","_menuService","_contextMenuIsBeingShownCount","_onContextMenu","menuActions","_getMenuActions","_doShowContextMenu","contextMenu","oldHoverSetting","getActionItem","_keybindingFor","customActionItem","wasCancelled","contextView_1","keybinding_1","ShowContextMenu","thisLen","CursorUndoController","_isCursorUndo","_undoStack","_prevState","_readState","cursorUndo","currState","prevState","revealRangeInCenterIfOutsideViewport","CursorUndo","DragAndDropController","_toUnhook","_onEditorMouseDown","_onEditorMouseUp","_onEditorMouseDrag","onMouseDrop","_onEditorMouseDrop","onDidBlurEditorWidget","onEditorBlur","_dndDecorationIds","_mouseDown","_modifierPressed","_dragSelection","_removeDecoration","TRIGGER_KEY_VALUE","possibleSelections","_hitContent","_hitMargin","newCursorPosition_1","newSelections","primarySelection","dragAndDropCommand_1","_DECORATION_OPTIONS","foldingArgumentsConstraint","foldingArgs","selectionLines","FoldingController","_autoHideFoldingControls","_useFoldingProviders","globalToDispose","localToDispose","foldingDecorationProvider","foldingDecorations_1","oldIsEnabled","oldShowFoldingControls","onModelContentChanged","oldUseFoldingProviders","onFoldingStrategyChanged","saveViewState","collapsedRegions","isInitialized","hiddenRangeModel","rangeProvider","restoreViewState","intializingRangeProvider_1","foldingStateMemento","getFoldingModel","foldingModel_1","hiddenRangeModel_1","onHiddenRangesChanges","updateScheduler","cursorChangedScheduler","onDidChangeModelLanguageConfiguration","foldingRegionPromise","foldingModelPromise","getRangeProvider","indentRangeProvider_1","foldingProviders","foldingRanges","selectionLineNumbers","mouseDownInfo","iconClicked","offsetLeftInGutter","isCollapsed_1","revealPositionInCenterIfOutsideViewport","FoldingAction","foldingController","invoke","getSelectedLines","getLineNumbers","_accessor","UnfoldAction","_foldingController","UnFoldRecursivelyAction","_args","FoldAction","FoldRecursivelyAction","selectedLines","FoldAllBlockCommentsAction","FoldAllRegionsAction","UnfoldAllRegionsAction","FoldAllAction","UnfoldAllAction","FoldLevelAction","getFoldingLevel","ID_PREFIX","EditorFontZoomIn","EditorFontZoomOut","EditorFontZoomReset","alertFormattingEdits","aria_1","getRealAndSyntheticDocumentFormattersOrdered","docFormatter_1","formatter","extensionId","displayName","provideDocumentFormattingEdits","provideDocumentRangeFormattingEdits","rangeFormatter_1","formatDocumentRangeWithProvider","editorOrModel","workerService","editorWorkerService_1","editorBrowser_1","versionNow_1","rawEdits","formattingEdit_1","range_2","initialSelection_1","undoEdits","undoEdits_1","range_3","formatDocumentWithProvider","initialSelection_2","undoEdits_2","range_4","getDocumentRangeFormattingEditsUntilResult","providers_1","getDocumentFormattingEditsUntilResult","providers_2","getOnTypeFormattingEdits","autoFormatTriggerCharacters","provideOnTypeFormattingEdits","FormattingConflicts","_selectors","formatDocumentRangeWithSelectedProvider","instaService","selected","formatDocumentWithSelectedProvider","FormatOnType","_workerService","_callOnDispose","_callOnModel","triggerChars","onDidType","_trigger","format_1","FormatOnPaste","_instantiationService","onDidPaste","FormatDocumentAction","FormatSelectionAction","getDefinitions","provide","getDefinitionsAtPosition","provideDefinition","getDeclarationsAtPosition","provideDeclaration","getImplementationsAtPosition","provideImplementation","getTypeDefinitionsAtPosition","provideTypeDefinition","getHover","provideHover","hasRange","hasHtmlContent","isValid","AbstractCopyLinesAction","copyLinesCommand_1","CopyLinesUpAction","CopyLinesDownAction","AbstractMoveLinesAction","moveLinesCommand_1","MoveLinesUpAction","MoveLinesDownAction","AbstractSortLinesAction","selections_3","sortLinesCommand_1","SortLinesAscendingAction","SortLinesDescendingAction","TrimTrailingWhitespaceAction","trimTrailingWhitespaceCommand_1","DeleteLinesAction","_getLinesToRemove","linesDeleted","mergedOperations","previousOperation","IndentLinesAction","OutdentLinesAction","InsertLineBeforeAction","InsertLineAfterAction","AbstractDeleteAllToBoundaryAction","rangesToDelete","_getRangesToDelete","effectiveRanges","nextRange","endCursorState","_getEndCursorState","DeleteAllLeftAction","endPrimaryCursor","newStartLine","deleteFromLine","deleteFromColumn","DeleteAllRightAction","JoinLinesAction","reducedSelections","lastSelection","lineOffset","selectionEndPositionOffset","trimmedLinesContent","firstNonWhitespaceIdx","insertSpace","lineTextWithoutIndent","resultSelection","TransposeAction","chars","AbstractCaseAction","_modifyText","UpperCaseAction","LowerCaseAction","TitleCaseAction","excludedChars","startUpperCase","currentChar","provideSignatureHelp","supports","Visible","MultipleSignatures","triggerKind","Invoke","isRetrigger","triggerCharacter","ParameterHintState","Pending","Active","hints","ParameterHintsModel","DEFAULT_DELAY","_onChangedHints","onChangedHints","retriggerChars","triggerId","throttledDelayer","onEditorConfigurationChange","onCursorChange","onModelContentChange","activeSignatureHelp","signatures","activeSignature","updateActiveSignature","triggerContext","provideSignatureHelp_1","signatureHelpTriggerCharacters","signatureHelpRetriggerCharacters","lastCharIndex","triggerCharCode","TriggerCharacter","ContentChange","getDocumentSymbols","flat","provideDocumentSymbols","flatEntries","compareEntriesUsingStart","overrideContainerLabel","containerName","selectionRange","work","allRawRanges","allProviderRanges","oneProviderRanges","oneRawRanges","oneRanges","oneRawRanges_1","oneRangesWithTrivia","rangeNoWhitespace","rangeFull","SelectionRanges","mov","SmartSelectController","_ignoreSelection","forward","AbstractSmartSelect","_forward","GrowSelectionAction","ShrinkSelectionAction","wordSelections_1","provideSuggestionItems","CompletionOptions","allSuggestions","defaultRange","kindFilter","_snippetSuggestSupport","hasResult","providerFilter","CompletionItem","getSuggestionComparator","snippetSortOrder","defaultComparator","sortTextLow","snippetConfig","_snippetComparators","MultipleSuggestions","MakesTextEdit","AcceptSuggestionsOnEnter","sortText","resolveCompletionItem","cached_1","isDone_1","getSnippetSuggestSupport","resolving","maxItemsToResolve","onlyOnceSuggestions","showSimpleSuggestions","triggerSuggest","ToggleTabFocusModeAction","ForceRetokenizeAction","MoveWordCommand","_wordNavigationType","inPosition","outPosition","_moveTo","WordLeftCommand","WordRightCommand","CursorWordStartLeft","CursorWordEndLeft","CursorWordLeft","CursorWordStartLeftSelect","CursorWordEndLeftSelect","CursorWordLeftSelect","CursorWordStartRight","CursorWordEndRight","CursorWordRight","CursorWordStartRightSelect","CursorWordEndRightSelect","CursorWordRightSelect","DeleteWordCommand","_whitespaceHeuristics","_delete","DeleteWordLeftCommand","DeleteWordRightCommand","DeleteWordStartLeft","DeleteWordEndLeft","DeleteWordLeft","DeleteWordStartRight","DeleteWordEndRight","DeleteWordRight","DeleteWordPartLeft","wordOperations_1","DeleteWordPartRight","WordPartLeftCommand","CursorWordPartLeft","CursorWordPartLeftSelect","WordPartRightCommand","CursorWordPartRight","CursorWordPartRightSelect","IPadShowKeyboard","shouldHaveWidget","ShowKeyboardWidget","ToggleHighContrast","standaloneStrings_1","_originalThemeName","standaloneThemeService_1","themeName","registerColor","needsTransparency","deprecationMessage","colorRegistry","colorValue","resolveColorValue","lessProminent","backgroundColorValue","transparency","ColorContribution","ColorRegistry","onDidChangeSchema","colorSchema","colorReferenceSchema","colorsById","colorContribution","propertySchema","resolveDefaultColor","colorDesc","getColorSchema","cat1","cat2","light","hc","errorForeground","focusBorder","contrastBorder","activeContrastBorder","textLinkForeground","textCodeBlockBackground","selectBackground","selectForeground","listHighlightForeground","scrollbarShadow","scrollbarSliderBackground","scrollbarSliderHoverBackground","scrollbarSliderActiveBackground","menuBorder","menuForeground","menuBackground","menuSelectionForeground","menuSelectionBackground","menuSelectionBorder","menuSeparatorBackground","editorBackground","editorForeground","editorWidgetBackground","editorWidgetBorder","editorWidgetResizeBorder","editorSelectionBackground","editorSelectionForeground","editorInactiveSelection","editorSelectionHighlight","editorSelectionHighlightBorder","editorFindMatch","editorFindMatchHighlight","editorFindRangeHighlight","editorFindMatchBorder","editorFindMatchHighlightBorder","editorFindRangeHighlightBorder","editorHoverHighlight","editorHoverBackground","editorHoverBorder","editorHoverStatusBarBackground","editorActiveLinkForeground","defaultInsertColor","defaultRemoveColor","diffInserted","diffRemoved","diffInsertedOutline","diffRemovedOutline","diffBorder","snippetTabstopHighlightBackground","snippetTabstopHighlightBorder","snippetFinalTabstopHighlightBackground","snippetFinalTabstopHighlightBorder","findMatchColorDefault","overviewRulerFindMatchForeground","overviewRulerSelectionHighlightForeground","oneOf","colorValues","colorValues_1","workbenchColorsSchemaId","schemaRegistry","delayer","CONTEXT_RENAME_INPUT_VISIBLE","RenameInputField","_currentAcceptInput","_currentCancelInput","_visibleContextKey","onThemeChange","_inputField","colorRegistry_1","widgetShadowColor","acceptInput","cancelInput","focusEditor","disposeOnDone","always","revealLineInCenterIfOutsideViewport","computeStyles","styleMap","attachStyler","widgetOrCallback","attachBadgeStyler","attachQuickOpenStyler","attachListStyler","defaultListStyles","defaultMenuStyles","attachMenuStyler","QuickOpenEditorWidget","codeEditor","quickOpenWidget","quickOpenWidget_1","inputAriaLabel","styler_1","destroy","layoutOverlayWidget","ContextMenuHandler","contextViewService","keybindingService","blockMouse","configure","focusToReturn","menu","getMenuClassName","onActionRun","onDidActionRun","menu_1","getActionsContext","didCancel","IThemeService","themeColorFromId","DARK","HIGH_CONTRAST","getThemeTypeSelector","ThemingContribution","themingRegistry","ThemingRegistry","themingParticipants","onThemingParticipantAddedEmitter","participant","getThemingParticipants","registerThemingParticipant","CodeEditorServiceImpl","styleSheet","_styleSheet","_decorationOptionProviders","_themeService","parentTypeKey","providerArgs","DecorationSubTypeOptionsProvider","DecorationTypeOptionsProvider","refCount","ed","removeDecorations","decorationTypeKey","themeService_1","abstractCodeEditorService_1","_parentTypeKey","_beforeContentRules","DecorationCSSRules","_afterContentRules","createCSSRules","hasContent","inlineData","hasLetterSpacing","createInlineCSSRules","rangeBehavior","lightOverviewRulerColor","overviewRulerColor","darkOverviewRulerColor","overviewRulerLane","_CSS_MAP","outline","outlineColor","outlineStyle","outlineWidth","borderRadius","borderSpacing","textDecoration","gutterIconPath","gutterIconSize","contentIconPath","ruleType","_ruleType","_providerArgs","_usesThemeColors","_hasContent","_hasLetterSpacing","CSSNameHelper","_unThemedSelector","getSelector","_buildCSS","_themeListener","_removeCSS","unthemedCSS","lightCSS","darkCSS","getCSSTextForModelDecorationClassName","getCSSTextForModelDecorationInlineClassName","getCSSTextForModelDecorationGlyphMarginClassName","getCSSTextForModelDecorationContentClassName","cssTextArr","collectCSSText","collectBorderSettingsCSSText","lenBefore","properties_1","resolveValue","parentKey","EditorScrollbar","overflowGuardDomNode","configScrollbarOpts","scrollbarOptions","scrollbarDomNode","_setLayout","onBrowserDesperateReveal","lookAtScrollTop","lookAtScrollLeft","newScrollPosition","deltaLeft","createWebKitRenderedLine","renderLineInput","WebKitRenderedViewLine","createNormalRenderedLine","RenderedViewLine","canUseFastRenderedViewLine","alwaysRenderInlineSelection","DomReadingContext","_clientRectDeltaLeft","_clientRectDeltaLeftRead","ViewLineOptions","themeType","ViewLine","_isMaybeInvalid","_renderedViewLine","onOptionsChanged","onSelectionChanged","actualInlineDecorations","renderedViewLine","FastRenderedViewLine","createRenderedLine","getWidthIsFast","getVisibleRangesForRange","getColumnOfNodeOffset","spanNode","_characterMapping","_charWidth","_getCharPosition","spanNodeTextContentLength","spanIndex","_isWhitespaceOnly","_containsForeignElements","_cachedWidth","_pixelOffsetCache","_getReadingTarget","_readPixelOffset","_readVisibleRangesForRange","pixelOffset","_readRawVisibleRangesForRange","cachedPixelOffset","_actualReadPixelOffset","rangeUtil_1","startPartData","startPartIndex","startCharOffsetInPart","endPartData","endPartIndex","endCharOffsetInPart","endPixelOffset","createEmptyContentDataInLines","horizontalDistanceToText","MouseTarget","_typeToString","ElementPath","isTextArea","isChildOfViewLines","isStrictChildOfViewLines","isChildOfScrollableElement","isChildOfMinimap","isChildOfContentWidgets","isChildOfOverflowingContentWidgets","isChildOfOverlayWidgets","HitTestContext","viewHelper","lastViewCursorsRenderData","_viewHelper","getZoneAtCoord","mouseVerticalOffset","viewZoneWhitespace","viewZoneMiddle","positionBefore","positionAfter","viewZoneId","getFullLineRangeAtCoord","lineNumber_1","maxLineColumn_1","findAttribute","_findAttribute","getLineWidth","visibleRangeForPosition2","getPositionFromDOMInfo","HitTestRequest","_ctx","targetPath","mouseContentHorizontalOffset","outerHTML","withTarget","isInMarginArea","isInContentArea","MouseTargetFactory","_getMouseColumn","EMPTY_CONTENT_AFTER_LINES","mouseTargetIsWidget","createMouseTarget","_createMouseTarget","domHitTestExecuted","hitTestResult","_doHitTest","createMouseTargetFromHitTestPosition","hitTarget","resolvedRequest","_hitTestContentWidget","_hitTestOverlayWidget","_hitTestMinimap","_hitTestScrollbarSlider","_hitTestViewZone","_hitTestMargin","_hitTestViewCursor","_hitTestTextArea","_hitTestViewLines","_hitTestScrollbar","lastViewCursorsRenderData_1","lastViewCursorsRenderData_2","cursorVerticalOffset","viewZoneData","mouseTargetType","lineWidth","possibleLineNumber","getMouseColumn","detail_1","columnHorizontalOffset","points","visibleRange_1","visibleRange_2","_doHitTestWithCaretRangeFromPoint","lineCenteredVerticalOffset","adjustedPageY","adjustedPage","editorDom_1","_actualDoHitTestWithCaretRangeFromPoint","coords","caretRangeFromPoint","startContainer","TEXT_NODE","parent3","parent2","parent1","viewLine_1","_doHitTestWithCaretPositionFromPoint","hitResult","caretPositionFromPoint","offsetNode","_doHitTestWithMoveToPoint","resultPosition","resultHitTarget","textRange","createTextRange","moveToPoint","rangeToContainEntireSpan","duplicate","moveToElementText","setEndPoint","createMouseMoveEventMerger","mouseTargetFactory","targetIsWidget","MouseHandler","viewController","mouseTarget_1","_mouseDownOperation","MouseDownOperation","testEventTarget","_asyncFocus","lastMouseLeaveTime","mouseEvents","_onMouseMove","MOUSE_MOVE_MINIMUM_TIME","_onMouseUp","_onMouseLeave","getTargetAtClientPoint","getLastViewCursorsRenderData","isActive","targetIsContent","targetIsGutter","targetIsLineNumbers","targetIsViewZone","shouldHandle","_viewController","_onScrollTimeout","_mouseState","MouseDownState","_currentSelection","_isActive","_lastMouseEvent","_onMouseDownThenMove","setModifiers","_findMousePosition","isDragAndDrop","_dispatchMouse","targetType","setStartedOnLineNumbers","setStartButtons","trySetCount","_stop","_getPositionOutsideEditor","editorContent","_helpPositionJumpOverViewZone","aboveLineNumber","belowLineNumber","positionOutsideEditor","_altKey","_ctrlKey","_metaKey","_shiftKey","_leftButton","_middleButton","_startedOnLineNumbers","_lastMouseDownPosition","_lastMouseDownPositionEqualCount","_lastMouseDownCount","_lastSetMouseDownCountTime","setMouseDownCount","newMouseDownPosition","CLEAR_MOUSE_DOWN_COUNT_TIME","gestureChangeEventMerger","MsPointerHandler","linesContentDomNode","_installGestureHandlerTimeout","touchGesture_1","penGesture_1","_lastPointerType","_onGestureChange","_onCaptureGestureTap","rawEvent","fromElement","mouseHandler_1","StandardPointerHandler","touchAction","touchGesture_2","penGesture_2","TouchHandler","PointerHandler","msPointerEnabled","TouchEvent","pointerEnabled","PointerEvent","ViewOutgoingEvents","onDidGainFocus","onDidLoseFocus","emitScrollChanged","emitViewFocusGained","emitViewFocusLost","_convertViewToModelMouseEvent","_convertViewToModelMouseTarget","ExternalMouseTarget","_convertViewToModelRange","LastRenderedData","_currentVisibleRange","getCurrentVisibleRange","setCurrentVisibleRange","currentVisibleRange","HorizontalRevealRequest","startScrollTop","stopScrollTop","ViewLines","_linesContent","_textRangeRestingSpot","_isViewportWrapping","_revealHorizontalRightPadding","_viewLineOptions","_maxLineWidth","_asyncUpdateLineWidths","_updateLineWidthsSlow","_lastRenderedData","_horizontalRevealRequest","_onOptionsMaybeChanged","newViewLineOptions","rendStartLineNumber","rendEndLineNumber","_computeScrollTopToRevealRange","scrollTopDelta","viewLineDomNode","_getViewLineDomNode","_getLineNumberFor","visibleRangesLen","domReadingContext","nextLineModelLineNumber","visibleRangesForRange2","updateLineWidths","_updateLineWidths","_updateLineWidthsFast","fast","localMaxLineWidth","allWidthsComputed","visibleLine","_ensureMaxLineWidth","revealStartColumn","revealEndColumn","_computeScrollLeftToRevealRange","maxHorizontalOffset","iLineWidth","viewport","boxStartY","boxEndY","viewportStartY","viewportEndY","boxMiddleY","_computeMinimumScrolling","viewportStartX","viewportEndX","boxStartX","boxEndX","visibleRanges_1","HORIZONTAL_EXTRA_PX","viewportStart","viewportEnd","boxStart","boxEnd","revealAtStart","revealAtEnd","viewportLength","getMinimapLineHeight","getMinimapCharWidth","MOUSE_DRAG_RESET_DISTANCE","MinimapOptions","minimapHeight","canvasInnerWidth","canvasInnerHeight","canvasOuterWidth","canvasOuterHeight","MinimapLayout","sliderTop","sliderHeight","getDesiredScrollTopFromDelta","viewportStartLineNumber","viewportEndLineNumber","viewportContainsWhitespaceGaps","previousLayout","minimapLineHeight","minimapLinesFitting","viewportLineCount","expectedViewportLineCount","maxMinimapSliderTop","MinimapLine","INVALID","RenderData","renderedLayout","imageData","_imageData","_renderedLines","linesEquals","MinimapBuffers","WIDTH","HEIGHT","_backgroundFillData","_createBackgroundFillData","createImageData","_lastUsedBuffer","getBuffer","Minimap","_lastRenderData","_getMinimapDomNodeClassName","_shadow","_canvas","_slider","_sliderHorizontal","_tokensColorTracker","_applyLayout","_mouseDownListener","internalOffsetY","_sliderMouseMoveMonitor","_sliderMouseDownListener","initialMousePosition_1","initialMouseOrthogonalPosition_1","initialSliderState_1","_getBuffer","renderingCtx","scrollLeftChars","horizontalSliderLeft","_lastData","_dirtyY1","_dirtyY2","lineInfo","renderedLines","runtimeMinimapCharRenderer_1","dirtyY1","dirtyHeight","putImageData","lastRenderData","lastTargetData","lastStartLineNumber","lastLines","lastLinesLength","targetData","maxDestPixel","dirtyPixel1","dirtyPixel2","copySourceStart","copySourceEnd","copyDestStart","copyDestEnd","dest_dy","source_dy","sourceStart","sourceEnd","destStart","destEnd","colorTracker","charWidth","maxDx","tokenColorId","tokenColor","sliderBackground","halfSliderBackground","addRule","sliderHoverBackground","halfSliderHoverBackground","sliderActiveBackground","halfSliderActiveBackground","ScrollDecorationViewPart","_scrollTop","_updateWidth","_shouldShow","_useShadows","_updateShouldShow","newShouldShow","newWidth","toStyledRange","HorizontalRangeWithStyle","toStyled","LineVisibleRangesWithStyle","startStyle","endStyle","isIEWithZoomingIssuesNearRoundedBorders","SelectionsOverlay","_previousFrameVisibleRangesWithStyle","_roundedSelection","_selections","_visibleRangesHaveGaps","_enrichVisibleRangesWithStyle","previousFrame","epsilon","previousFrameTop","previousFrameBottom","topLineNumber","bottomLineNumber","curLineRange","curLeft","curRight","prevRight","nextLeft","nextRight","_getVisibleRangesWithStyle","visibleRangesHaveGaps","_createSelectionPiece","_actualRenderOneSelection","output2","visibleRangesHaveStyle","fullLineHeight","reducedLineHeight","firstLineNumber","SELECTION_CLASS_NAME","ROUNDED_PIECE_WIDTH","className_1","EDITOR_BACKGROUND_CLASS_NAME","SELECTION_TOP_RIGHT","SELECTION_BOTTOM_RIGHT","className_2","SELECTION_TOP_LEFT","SELECTION_BOTTOM_LEFT","thisFrameVisibleRangesWithStyle","visibleRangesWithStyle","editorSelectionColor","editorInactiveSelectionColor","editorSelectionForegroundColor","editorLineHighlight","editorLineHighlightBorder","editorRangeHighlight","editorRangeHighlightBorder","editorCursorForeground","editorCursorBackground","editorWhitespaces","editorIndentGuides","editorActiveIndentGuides","editorLineNumbers","deprecatedEditorActiveLineNumber","editorActiveLineNumber","editorRuler","editorCodeLensForeground","editorBracketMatchBackground","editorBracketMatchBorder","editorOverviewRulerBorder","editorGutter","editorErrorForeground","editorErrorBorder","editorWarningForeground","editorWarningBorder","editorInfoForeground","editorInfoBorder","editorHintForeground","editorHintBorder","editorUnnecessaryCodeBorder","editorUnnecessaryCodeOpacity","overviewRulerError","overviewRulerWarning","overviewRulerInfo","gutter","rangeHighlight","rangeHighlightBorder","invisibles","CurrentLineHighlightOverlay","_renderLineHighlight","_selectionIsEmpty","_primaryCursorLineNumber","_scrollWidth","primaryCursorLineNumber","selectionIsEmpty","_shouldShowCurrentLine","_willRenderMarginCurrentLine","lineHighlight","editorColorRegistry_1","defines","lineHighlightBorder","CurrentLineMarginHighlightOverlay","_willRenderContentCurrentLine","IndentGuidesOverlay","_primaryLineNumber","_spaceWidth","_activeIndentEnabled","newPrimaryLineNumber","indentWidth","indents","activeIndentStartLineNumber","activeIndentEndLineNumber","activeIndentLevel","activeIndentInfo","containsActiveIndentGuide","leftMostVisiblePosition","editorIndentGuidesColor","editorActiveIndentGuidesColor","LineNumbersOverlay","_readConfig","_lastCursorModelPosition","_renderLineNumbers","_renderCustomLineNumbers","_renderFinalNewline","_lineNumbersLeft","_lineNumbersWidth","primaryViewPosition","_getLineRenderLineNumber","lineHeightClassName","renderLineNumber","activeLineNumber","measureText","font","doCreateFontString","createFontString","metrics","VisibleTextAreaData","canUseZeroSizeTextarea","LocalClipboardMetadataManager","pastedText","lastCopiedValue","TextAreaHandler","_primaryCursorVisibleRange","_contentHeight","_scrollLeft","_fontInfo","_emptySelectionClipboard","_copyWithSyntaxHighlighting","_visibleTextArea","textAreaCover","simpleModel","textAreaInputHost","rawWhatToCopy","isFromEmptySelection","whatToCopy","textBefore","_getWordBeforePosition","_getCharacterBeforePosition","_textAreaInput","visibleRangeForPositionRelativeToEditor","primaryCursorPosition","_renderInsideEditor","_renderAtTopLeft","useEditorFont","ta","tac","margin_1","Settings","renderBorder","hideCursor","cursorColor","minimapEnabled","domWidth","domHeight","canvasWidth","canvasHeight","_initLanes","canvasLeftOffset","laneCount","centerWidth","leftWidth","rightWidth","centerOffset","leftOffset","rightOffset","DecorationsOverviewRuler","_updateSettings","_tokensColorTrackerListener","_cursorPositions","newSettings","_settings","editorCtx","minDecorationHeight","halfMinDecorationHeight","canvasCtx","cIndex","colorDecorations","prevY1","prevY2","yCenter","cursorHeight","halfCursorHeight","cursorX","cursorW","beginPath","strokeStyle","lineTo","stroke","Rulers","_renderedRulers","_rulers","_ensureRulersCount","currentCount","desiredCount","rulerWidth","addCount","rulerColor","ViewCursors","_readOnly","_cursorBlinking","_cursorSmoothCaretAnimation","_primaryCursor","viewCursor_1","_secondaryCursors","_updateDomClassName","_startCursorBlinkAnimation","_cursorFlatBlinkInterval","_blinkingEnabled","_editorHasFocus","_updateBlinking","_onCursorPositionChanged","secondaryPositions","addCnt","newCursor","nextSibling","_getCursorBlinking","isSolid","BLINK_INTERVAL","_getClassName","renderData","renderDataLen","primaryRenderData","secondaryRenderData","getLastRenderData","caret","caretBackground","safeInvokeNoArg","func","_cursor","_renderAnimationFrame","viewController_1","eventDispatcher","viewEventDispatcher_1","_renderOnce","viewContext_1","viewParts","_textAreaHandler","textAreaHandler_1","createTextAreaHandlerHelper","createViewParts","pointerHandler","pointerHandler_1","createPointerHandlerHelper","getEditorClassName","overflowGuardContainer","_scrollbar","editorScrollbar_1","viewLines_1","viewZones","viewZones_1","decorationsOverviewRuler","decorationsOverviewRuler_1","scrollDecoration","scrollDecoration_1","contentViewOverlays","viewOverlays_1","currentLineHighlight_1","indentGuides_1","marginViewOverlays","currentLineMarginHighlight_1","marginDecorations_1","linesDecorations_1","contentWidgets","contentWidgets_1","viewCursors","viewCursors_1","overlayWidgets","overlayWidgets_1","rulers_1","minimap_1","overviewRulerData","_flushAccumulatedAndRenderNow","_renderNow","focused","_scheduleRender","_onRenderScheduled","_actualRender","_getViewPartsToRender","viewPart","viewPartsToRender","partialViewportData","viewLinesViewportData_1","renderingContext","getOffsetForColumn","createOverviewRuler","overviewRuler_1","zonesHaveChanged","safeInvoke1Arg","everything","newPreference","getSquigglySVGData","squigglyStart","squigglyEnd","EDITOR_ID","SHOW_UNUSED_ENABLED_CLASS","hasRealView","listenersToRemove","CodeEditorWidget","codeEditorWidgetOptions","instantiationService","_onDidChangeModelContent","_onDidChangeModelLanguage","_onDidChangeModelLanguageConfiguration","_onDidChangeModelOptions","onDidChangeModelOptions","_onDidChangeModelDecorations","onDidChangeModelDecorations","_onDidChangeConfiguration","_onDidChangeModel","_onDidChangeCursorPosition","_onDidChangeCursorSelection","_onDidLayoutChange","_editorTextFocus","BooleanEventEmitter","onDidFocusEditorText","onDidChangeToTrue","onDidBlurEditorText","onDidChangeToFalse","_editorWidgetFocus","onDidFocusEditorWidget","_onWillType","onWillType","_onDidType","_onDidPaste","_onMouseDrag","_onMouseDrop","_onDidScrollChange","_onDidChangeViewZones","onDidChangeViewZones","_domElement","_decorationTypeKeysToIds","_decorationTypeSubtypes","_telemetryData","telemetryData","_createConfiguration","EditorContextKeysManager","EditorModeContext","_attachModel","_contributions","_actions","_focusTracker","CodeEditorWidgetFocusTracker","_contentWidgets","_overlayWidgets","contributions","internalAction","editorAction_1","contributionId","_removeDecorationTypes","_postDetachModelCleanup","_detachModel","getRawConfiguration","_modelData","eolPreference","detachedModel","oldModelUrl","newModelUrl","decorationType","subTypes","_removeDecorationType","_getVerticalOffsetForPosition","getVisibleColumnFromPosition","_sendRevealRange","validatedModelRange","_revealLine","revealLineInCenter","revealType","_revealPosition","something","isSelection","isRange","_setSelectionImpl","revealLines","_revealLines","revealLinesInCenter","revealLinesInCenterIfOutsideViewport","revealVerticalInCenter","revealRangeInCenter","revealRangeAtTop","setScrollLeft","contributionsState","codeEditorState","reducedState","getSupportedActions","_triggerEditorCommand","forceRedraw","viewModelImpl_1","cursor_1","secondarySelections","_createView","viewOutgoingEvents","viewOutgoingEvents_1","viewImpl_1","removeDomNode","notification_1","accessibility_1","_onDidChangeToTrue","_onDidChangeToFalse","_editorFocus","_textInputFocus","_editorTabMovesFocus","_editorReadonly","_hasMultipleSelections","_hasNonEmptySelection","_canUndo","_canRedo","_updateFromConfig","_updateFromSelection","_updateFromFocus","_updateFromModel","_langId","_hasCompletionItemProvider","_hasCodeActionsProvider","_hasCodeLensProvider","_hasDefinitionProvider","_hasDeclarationProvider","_hasImplementationProvider","_hasTypeDefinitionProvider","_hasHoverProvider","_hasDocumentHighlightProvider","_hasDocumentSymbolProvider","_hasReferenceProvider","_hasRenameProvider","_hasSignatureHelpProvider","_hasDocumentFormattingProvider","_hasDocumentSelectionFormattingProvider","_hasMultipleDocumentFormattingProvider","_hasMultipleDocumentSelectionFormattingProvider","_isInWalkThrough","_domFocusTracker","dotdotdotStart","dotdotdotEnd","errorBorderColor","warningBorderColor","warningForeground","infoBorderColor","infoForeground","hintBorderColor","hintForeground","getDotDotDotSVGData","unnecessaryForeground","unnecessaryBorder","findFocusedDiffEditor","diffEditors","diffEditor","DiffEntry","originalLineStart","originalLineEnd","modifiedLineStart","modifiedLineEnd","DiffReview","_diffEditor","_actionBar","_content","_diffs","getOriginalEditor","_goToRow","_getNextRow","_getPrevRow","_currentDiff","currentIndex","_findDiffIndex","jumpToLineNumber","_getCurrentFocusedRow","previousElementSibling","_getFirstRow","nextElementSibling","originalModel","modifiedModel","_mergeAdjacent","modifiedLineCount","diffs","diffsLength","rLength_1","originalEqualAbove","modifiedEqualAbove","minOriginal","minModified","prevLineChange","fromOriginal","fromModified","originalEqualBelow","modifiedEqualBelow","maxOriginal","maxModified","nextLineChange","toOriginal","toModified","thisDiff","currLast","thisFirst","originalOpts","modifiedOpts","originalModelOpts","modifiedModelOpts","diffIndex","minOriginalLine","maxOriginalLine","minModifiedLine","maxModifiedLine","diffEntry","originalChangedLinesCnt","modifiedChangedLinesCnt","getAriaLines","originalChangedLinesCntAria","modifiedChangedLinesCntAria","modLine","_renderSection","rowClassName","lineNumbersExtraClassName","spacerClassName","originalLineNumbersWidth","modifiedLineNumbersWidth","spacer","DiffReviewNext","diffReviewNext","DiffReviewPrev","diffReviewPrev","createDecoration","isChangeOrInsert","isChangeOrDelete","VisualEditorState","_zonesMap","getForeignViewZones","allViewZones","clean","viewChangeAccessor","restoreScrollState","zoneId","overviewZones","DIFF_EDITOR_ID","DiffEditorWidget","editorWorkerService","_onDidUpdateDiff","_lastOriginalWarning","_lastModifiedWarning","_editorWorkerService","_renderSideBySide","renderSideBySide","_ignoreTrimWhitespace","_renderIndicators","renderIndicators","_originalIsEditable","originalEditable","_updateDecorationsRunner","_updateDecorations","_containerDomElement","_overviewViewportDomElement","_overviewDomElement","modifiedEditor","_createLeftHandSide","_createRightHandSide","_beginUpdateDecorationsTimeout","_currentlyChangingViewZones","_diffComputationToken","_originalEditorState","_modifiedEditorState","_isHandlingScrollEvent","_reviewHeight","_diffComputationResult","leftContextKeyService","leftServices","leftScopedInstantiationService","rightContextKeyService","rightServices","rightScopedInstantiationService","_createLeftHandSideEditor","_createRightHandSideEditor","_reviewPane","diffReview_1","_measureDomElementToken","_measureDomElement","_enableSplitViewResizing","enableSplitViewResizing","_setStrategy","DiffEdtorWidgetSideBySide","_createDataSource","DiffEdtorWidgetInline","applyColors","_recreateOverviewRulers","_originalOverviewRuler","originalEditor","_modifiedOverviewRuler","_layoutOverviewRulers","_originalDomNode","_modifiedDomNode","_createInnerEditor","_adjustOptionsForLeftHandSide","_layoutOverviewViewport","_onViewZonesChanged","_beginUpdateDecorationsSoon","_adjustOptionsForRightHandSide","codeEditorWidget_1","_cleanViewZonesAndDecorations","renderSideBySideChanged","beginUpdateDecorations","_beginUpdateDecorations","setEnableSplitViewResizing","diffEditorState","forceDoLayoutCall","freeSpace","ENTIRE_DIFF_OVERVIEW_WIDTH","ONE_OVERVIEW_WIDTH","UPDATE_DIFF_DECORATIONS_DELAY","currentOriginalModel","currentModifiedModel","currentToken","foreignOriginal","foreignModified","diffDecorations","getEditorsDiffDecorations","_adjustOptionsForSubEditor","clonedOptions","isEditable","splitPoint","_computeOverviewViewport","computedRatio","getContainerDomNode","relayoutEditors","newStrategy","_getLineChangeAtOrBeforeLineNumber","startLineNumberExtractor","midEnd","_getEquivalentLineForOriginalLineNumber","originalEquivalentLineNumber","modifiedEquivalentLineNumber","lineChangeOriginalLength","lineChangeModifiedLength","_getEquivalentLineForModifiedLineNumber","getDiffLineInformationForOriginal","equivalentLineNumber","getDiffLineInformationForModified","DiffEditorWidgetStyle","newInsertColor","newRemoveColor","_insertColor","_removeColor","originalWhitespaces","modifiedWhitespaces","_getViewZones","originalDecorations","_getOriginalEditorDecorations","modifiedDecorations","_getModifiedEditorDecorations","ForeignViewZonesIterator","ViewZonesComputer","originalForeignVZ","modifiedForeignVZ","getViewZones","originalEndEquivalentLineNumber","modifiedEndEquivalentLineNumber","sortMyViewZones","addAndCombineIfPossible","lastItem","length_4","stepOriginal","stepModified","viewZoneLineNumber","_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion","_produceOriginalFromDiff","_produceModifiedFromDiff","stepOriginalIndex","stepModifiedIndex","originalDelta","modifiedDelta","shouldNotShrink","_ensureDomNodes","createFakeLinesDiv","DECORATIONS","charDelete","charDeleteWholeLine","charInsert","charInsertWholeLine","lineInsert","lineInsertWithSign","lineDelete","lineDeleteWithSign","lineDeleteMargin","_disableSash","_sashRatio","_sashPosition","_sash","onSashDragStart","onSashDrag","onSashDragEnd","onSashReset","newDisableSash","sashRatio","sashPosition","midPoint","MINIMUM_EDITOR_WIDTH","_startSashPosition","SideBySideViewZonesComputer","overviewZoneColor","length_5","lengthJ","length_6","InlineViewZonesComputer","length_7","length_8","modifiedEditorConfiguration","modifiedEditorTabSize","marginHTML","maxCharsPerLine","_renderOriginalLine","actualDecorations","absoluteOffsets","added","removed","addedOutline","removedOutline","EmbeddedCodeEditorWidget","parentEditor","_parentEditor","_overwriteOptions","_onParentConfigurationChanged","getParentEditor","MarkerDecorations","_markersData","ids","getMarker","MarkerDecorationsService","_onDidChangeMarker","_markerDecorations","_handleMarkerChange","markerDecorations","changedResources","newModelDecorations","_createDecorationRange","_createDecorationOption","rawMarker","overviewRulerBracketMatchForeground","JumpToBracketAction","BracketMatchingController","jumpToBracket","SelectToBracketAction","selectToBracket","BracketsData","_lastBracketsData","_lastVersionId","_updateBracketsSoon","_updateBrackets","_matchBrackets","newCursorPosition","nextBracket","openBracket","closeBracket","_recomputeBrackets","previousData","positionsLen","newData","newDataLen","previousIndex","previousLen","bracketMatchBackground","bracketMatchBorder","CodeLensViewZone","onHeight","_onHeight","_lastHeight","CodeLensContentWidget","symbolRange","_idPool","setSymbolRange","updateHeight","withCommands","inSymbols","wasEmpty","_widgetPosition","CodeLensHelper","_removeDecorations","_addDecorations","_addDecorationsCallbacks","commit","resultingDecorations","CodeLens","viewZoneChangeAccessor","updateCallback","_decorationIds","codeLensData","_contentWidget","_viewZoneId","updateCodeLensSymbols","computeIfNecessary","updateCommands","getLineNumber","codeLensForeground","activeLinkForeground","CodeLensContribution","_codeLensCache","_lenses","_currentFindCodeLensSymbolsPromise","_modelChangeCounter","_onModelChange","_localDispose","_currentResolveCodeLensSymbolsPromise","cachedLenses","_renderCodeLensSymbols","scheduler","_detectVisibleLenses","_onViewportChanged","counterValue","codelens_1","viewAccessor","lastLensLineNumber","lens","codelensWidget_1","_disposeAllLenses","cachedLensesNow","decChangeAccessor","lastGroup","symbols_1","codeLensIndex","groupsIndex","symbolsLineNumber","codeLensLineNumber","toResolve","lenses","resolvedSymbols","codeLensCache_1","ColorPickerHeader","pickedColorNode","colorBox","ColorPickerBody","saturationBox","SaturationBox","onDidSaturationValueChange","opacityStrip","OpacityStrip","onDidOpacityChange","hueStrip","HueStrip","onDidHueChange","canvas","onDidChangePosition","mouseUpListener","paintSelection","paint","saturatedColor","whiteGradient","createLinearGradient","addColorStop","blackGradient","rect","fill","Strip","updateSliderPosition","onDidChangeTop","opaque","ColorPickerWidget","FindDecorations","_overviewRulerApproximateDecorations","_findScopeDecorationId","_rangeHighlightDecorationId","_highlightedDecorationId","_startPosition","_allDecorations","getFindScope","newStartPosition","setCurrentFindMatch","_getDecorationIndex","getCurrentMatchesPosition","desiredRange","candidates_1","candidateOpts","_FIND_MATCH_DECORATION","_CURRENT_FIND_MATCH_DECORATION","nextMatch","newCurrentDecorationId","matchPosition","lineBeforeEnd","lineBeforeEndMaxColumn","_RANGE_HIGHLIGHT_DECORATION","findScope","findMatchesOptions","newOverviewRulerApproximateDecorations","_FIND_MATCH_NO_OVERVIEW_DECORATION","approxPixelsPerLine","mergeLinesDelta","prevStartLineNumber","_FIND_MATCH_ONLY_OVERVIEW_DECORATION","newFindMatchesDecorations","_FIND_SCOPE_DECORATION","matchBeforePosition","matchAfterPosition","CONTEXT_FIND_WIDGET_VISIBLE","CONTEXT_FIND_INPUT_FOCUSED","CONTEXT_REPLACE_INPUT_FOCUSED","ToggleCaseSensitiveKeybinding","ToggleWholeWordKeybinding","ToggleRegexKeybinding","ToggleSearchScopeKeybinding","FIND_IDS","StartFindAction","StartFindWithSelection","NextMatchFindAction","PreviousMatchFindAction","NextSelectionMatchFindAction","PreviousSelectionMatchFindAction","StartFindReplaceAction","CloseFindWidgetCommand","ToggleCaseSensitiveCommand","ToggleWholeWordCommand","ToggleRegexCommand","ToggleSearchScopeCommand","ReplaceOneAction","ReplaceAllAction","SelectAllMatchesAction","MATCHES_LIMIT","FindModelBoundToEditorModel","_startSearchingTimer","findDecorations_1","_updateDecorationsScheduler","research","_ignoreModelContentChanged","onFindReplaceStateChange","_onStateChanged","_getSearchRange","newFindScope","_findMatches","_moveToNextMatch","_hasMatches","_cannotFind","_setCurrentFindMatch","_prevSearchPosition","isUsingLineStops","_moveToPrevMatch","isRecursed","prevMatchRange","prevMatch","moveToPrevMatch","_nextSearchPosition","nextMatchRange","_getNextMatch","forceMove","moveToNextMatch","_getReplacePattern","replacePattern_1","replacePattern","hasReplacementPatterns","_executeEditorCommand","replaceAll","_largeReplaceAll","_regularReplaceAll","mod","resultText","modelText","replaceAllCommand_1","selectAllMatches","FindOptionsWidget","_hideSoon","inputActiveOptionBorderColor","_keybindingLabelFor","findModel_1","_revealTemporarily","_applyTheme","actionId","inputStyles","widgetBackground","hcBorder","NLS_FIND_INPUT_LABEL","NLS_FIND_INPUT_PLACEHOLDER","NLS_PREVIOUS_MATCH_BTN_LABEL","NLS_NEXT_MATCH_BTN_LABEL","NLS_TOGGLE_SELECTION_FIND_TITLE","NLS_CLOSE_BTN_LABEL","NLS_REPLACE_INPUT_LABEL","NLS_REPLACE_INPUT_PLACEHOLDER","NLS_REPLACE_BTN_LABEL","NLS_REPLACE_ALL_BTN_LABEL","NLS_TOGGLE_REPLACE_MODE_BTN_LABEL","NLS_MATCHES_COUNT_LIMIT_TITLE","NLS_MATCHES_LOCATION","NLS_NO_RESULTS","MAX_MATCHES_COUNT_WIDTH","FIND_ALL_CONTROLS_WIDTH","FIND_INPUT_AREA_HEIGHT","FindWidgetViewZone","FindWidget","_codeEditor","_controller","_contextViewProvider","_isReplaceVisible","_ignoreChangeEvent","_updateHistoryDelayer","_buildDomNode","_updateButtons","_tryUpdateWidgetWidth","updateAccessibilitySupport","_showViewZone","_removeViewZone","_updateToggleSelectionFindButton","globalBufferTerm","getGlobalBufferTerm","_findInput","_findInputFocused","_findFocusTracker","_updateSearchScope","_replaceInputFocused","_replaceFocusTracker","_replaceInputBox","_layoutViewZone","_toggleSelectionFind","showRedOutline","_updateMatchesCount","_delayedUpdateHistory","_updateHistory","_closeBtn","findInputIsNonEmpty","_prevBtn","_nextBtn","_replaceBtn","_replaceAllBtn","_toggleReplaceBtn","setExpanded","canReplace","adjustEditorScrollTop","startCoords","startLeft","startTop","leftOfFindWidget","endCoords","focusTheEditor","viewZone","adjustScroll","scrollAdjustment","editorWidth","collapsedFindWidget","reducedFindWidget","narrowFindWidget","_resized","FIND_WIDGET_INITIAL_WIDTH","findInputWidth","focusFindInput","focusReplaceInput","_onFindInputMouseDown","_onFindInputKeyDown","_onReplaceInputKeyDown","_buildFindPart","contextScopedHistoryWidget_1","PART_WIDTH","SimpleButton","onTrigger","findPart","SimpleCheckbox","_buildReplacePart","replaceInput","REPLACE_INPUT_AREA_WIDTH","replacePart","_buildSash","originalWidth","inputBoxWidth","_checkbox","_COUNTER","htmlFor","addBackgroundColorRule","findMatchHighlightBorder","findMatchBorder","findRangeHighlightBorder","resizeBorderBackground","inputActiveBorder","getSelectionSearchString","SEARCH_STRING_MAX_LENGTH","CommonFindController","clipboardService","_findWidgetVisible","_clipboardService","findState_1","loadQueryState","shouldRestartFind","disposeModel","forceRevealReplace","seedSearchStringFromGlobalClipboard","shouldFocus","shouldAnimate","updateSearchScope","saveQueryState","setGlobalBufferTerm","actualIsRegex","actualWholeWord","actualMatchCase","isFindInputFocused","getState","closeFindWidget","toggleCaseSensitive","toggleWholeWords","toggleRegex","toggleSearchScope","setSearchString","stateChanges","selectionSearchString","readFindText","writeFindText","clipboardService_1","FindController","_createFindWidget","_findOptionsWidget","findWidget_1","findOptionsWidget_1","StartFindWithSelectionAction","MatchFindAction","SelectionMatchFindAction","findInputFocused","FindCommand","InPlaceReplaceController","currentRequest","modelURI","highlightRange","inPlaceReplaceCommand_1","DECORATION","decorationRemover","InPlaceReplaceUp","InPlaceReplaceDown","HOVER_MESSAGE_GENERAL_META","HOVER_MESSAGE_COMMAND_META","HOVER_MESSAGE_GENERAL_ALT","HOVER_MESSAGE_COMMAND_ALT","meta","metaActive","altActive","altCommand","altCommandActive","metaCommand","metaCommandActive","LinkOccurrence","useMetaKey","_getOptions","activate","deactivate","LinkDetector","clickLinkGesture","clickLinkGesture_1","_onEditorMouseMove","cleanUpActiveLinkDecoration","async","computePromise","activeLinksList","currentOccurrences","activeLinkDecorationId","getLinks_1","occurance","links_1","withKey","occurrence_1","getLinkOccurrence","occurrence_2","occurrence","openLinkOccurrence","decoration_1","currentOccurrence","OpenLinkAction","linkDetector","MessageController","_messageListeners","MESSAGE_VISIBLE","_messageWidget","MessageWidget","closeMessage","bounds","fadeOut","MessageCommand","messageWidget","contextKeyForSupportedActions","applyCodeAction","bulkEditService","showCodeActionsForEditorSelection","notAvailableMessage","autoApply","QuickFixController","triggerFromEditorSelection","messageController_1","markerService","progressService","contextMenuService","_bulkEditService","_codeActionContextMenu","codeActionWidget_1","_lightBulbWidget","lightBulbWidget_1","_updateLightBulbTitle","_handleLightBulbSelect","onDidChangeState","_onDidChangeCodeActionsState","onDidUpdateKeybindings","_activeRequest","QuickFixAction","Id","progress_1","bulkEditService_1","CodeActionCommandArgs","preferred","fromUser","getKindFromUser","getApplyFromUser","getPreferredUser","defaultAutoApply","defaultKind","CodeActionCommand","userArg","RefactorAction","SourceAction","OrganizeImportsAction","FixAllAction","AutoFixAction","codeActionCommands_1","modelRangesContainSameText","InsertCursorAbove","logicalLine","InsertCursorBelow","InsertCursorAtEndOfEachLineSelected","getCursorsForSelection","currentLineMaxColumn","InsertCursorAtEndOfLineSelected","InsertCursorAtTopOfLineSelected","MultiCursorSessionResult","revealScrollType","MultiCursorSession","findController","isDisconnectedFromFindController","searchText","findState","addSelectionToNextFindMatch","allSelections","moveSelectionToNextFindMatch","lastAddedSelection","addSelectionToPreviousFindMatch","previousMatch","_getPreviousMatch","moveSelectionToPreviousFindMatch","MultiCursorSelectionController","_ignoreSelectionChange","_session","_sessionDispose","_endSession","_beginSessionIfNeeded","session","_setSelections","_expandEmptyToWord","_applySessionResult","getSession","resultingSelections","MultiCursorSelectionControllerAction","multiCursorController","findController_1","AddSelectionToNextFindMatchAction","AddSelectionToPreviousFindMatchAction","MoveSelectionToNextFindMatchAction","MoveSelectionToPreviousFindMatchAction","SelectHighlightsAction","CompatChangeAll","SelectionHighlighterState","softEquals","SelectionHighlighter","updateSoon","_createState","findStateSearchString","mySearchString","hasFindOccurrences","allMatches","_SELECTION_HIGHLIGHT","_SELECTION_HIGHLIGHT_OVERVIEW","ParameterHintsWidget","markdownRenderer","parameterHintsModel_1","keyVisible","keyMultipleSignatures","newParameterHints","createParamaterHintDOMNodes","onPreviousClick","onNextClick","overloads","signature","docs","userSelect","updateMaxHeight","announcedLabel","hasParameters","renderParameters","activeParameter","renderDisposeables","documentation","currentOverload","labelToAnnounce","getParameterLabel","currentParameter","getParameterLabelOffsets","beforeSpan","paramSpan","afterSpan","paramIdx","codeBackground","ParameterHintsController","parameterHintsWidget_1","TriggerParameterHintsAction","ParameterHintsCommand","IPeekViewService","addExclusiveWidget","existing","onDidClose","PeekContext","inPeekEditor","notInPeekEditor","getOuterEditor","embeddedCodeEditorWidget_1","headerBackgroundColor","primaryHeadingColor","secondaryHeadingColor","PeekViewWidget","_onDidClose","_headElement","_primaryHeading","_secondaryHeading","_bodyElement","_fillHead","_fillBody","titleElement","_onTitleClick","_headingIcon","_metaHeading","actionsContainer","actionBarOptions","_getActionBarOptions","_actionbarWidget","setTitleIcon","iconClassName","setTitle","primaryHeading","secondaryHeading","setMetaTitle","headHeight","bodyHeight","_doLayoutHead","_doLayoutBody","zoneWidget_1","_resolverService","referencesModel_1","failure","Delegate","FileReferencesRenderer","OneReferenceRenderer","StringRepresentationProvider","IdentityProvider","FileReferencesTemplate","_uriLabel","badge","countBadge_1","labels_1","getUriLabel","label_1","template","OneReferenceTemplate","filePreview","before_1","after_1","AriaProvider","rename","newName","RenameSkeleton","provideRenameEdits","_providers","hasProvider","resolveRenameLocation","firstProvider","rejects","rejectReason","RenameController","_renameOperationIdPool","_renameInputField","renameInputField_1","_activeRename","doRename","skeleton","resolveLocationOperation","loc","e_1","renameInputField","newNameOrFocusFlag","renameOperation","ariaSummary","acceptRenameInput","cancelRenameInput","RenameAction","editorService","RenameCommand","canExpandCompletionItem","editorSuggestWidgetBackground","editorSuggestWidgetBorder","editorSuggestWidgetForeground","editorSuggestWidgetSelectedBackground","editorSuggestWidgetHighlightForeground","triggerKeybindingLabel","colorspan","main","iconLabel","typeLabel","readMore","configureFont","fontSizePx","lineHeightPx","labelOptions","extractColor","getIconTheme","hasFileIcons","getIconClasses_1","FILE","hasFolderIcons","toggleDetails","SuggestionDetails","renderDisposeable","innerText","scrollDown","scrollUp","scrollBottom","pageDown","pageUp","setBorderWidth","SuggestWidget","ignoreFocusEvents","editorBlurTimeout","showTimeout","onDidSelectEmitter","onDidFocusEmitter","onDidHideEmitter","onDidShowEmitter","onDidHide","onDidShow","maxWidgetWidth","listWidth","firstFocusInCurrentList","preferDocPositionTop","isAuto","messageElement","listElement","details","applyIconStyle","onEditorLayoutChange","onListMouseDown","onListSelection","onListFocus","onCursorSelectionChanged","suggestWidgetVisible","suggest_1","suggestWidgetMultipleSuggestions","expandDocsSettingFromStorage","expandSideOrBelow","completionModel","_getSuggestionAriaAlertLabel","_ariaAlert","newAriaAlertLabel","_lastAriaAlertLabel","detailsBorderColor","focusBorderColor","detailsFocusBorderColor","currentSuggestionDetails","showDetails","stateChanged","listHeight","LOADING_MESSAGE","NO_SUGGESTIONS_MESSAGE","showTriggered","auto","loadingTimeout","showSuggestions","selectionIndex","docsPositionPreviousWidgetY","visibleCount","stats","selectNextPage","selectNext","selectLast","selectPreviousPage","selectPrevious","getFocusedItem","toggleDetailsFocus","updateExpandDocsSetting","maxWidgetHeight","marginTop","adjustDocsPosition","updateListHeight","hideWidget","unfocusedHeight","cursorY","widgetCoords","widgetX","widgetY","matchHighlight","getOccurrencesAtPosition","orderedByScore","provideDocumentHighlights","editorWordHighlight","editorWordHighlightStrong","editorWordHighlightBorder","editorWordHighlightStrongBorder","overviewRulerWordHighlightForeground","overviewRulerWordHighlightStrongForeground","ctxHasWordHighlights","OccurenceAtPositionRequest","_wordRange","_getCurrentWordRange","currentWordRange","requestIsValid","SemanticOccurenceAtPositionRequest","TextualOccurenceAtPositionRequest","currentSelectionIsEmpty","WordHighlighter","workerRequestTokenId","workerRequestCompleted","workerRequestValue","lastCursorPositionChangeTime","renderDecorationsTimer","_hasWordHighlights","_ignorePositionChangeEvent","toUnhook","_onPositionChanged","_stopAll","workerRequest","hasDecorations","_getSortedHighlights","moveNext","moveBack","workerRequestIsValid","_beginRenderDecorations","myRequestId_1","computeOccurencesAtPosition","minimumRenderTime","renderDecorations","_getDecorationOptions","Write","_WRITE_OPTIONS","_TEXT_OPTIONS","_REGULAR_OPTIONS","WordHighlighterContribution","createWordHighlighterIfPossible","wordHighligher","WordHighlightNavigationAction","_isNext","NextWordHighlightAction","PrevWordHighlightAction","TriggerWordHighlightAction","wordHighlight","wordHighlightStrong","selectionHighlightBorder","wordHighlightBorder","wordHighlightStrongBorder","CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE","AccessibilityHelpController","AccessibilityHelpWidget","_isVisibleKey","_contentDomNode","_layout","_buildContent","accessibilityHelpUrl","_descriptionForCommand","noKbMsg","charactersSelected","getSelectionLabel","turnOnMessage","toggleTabFocusMode_1","ShowAccessibilityHelpAction","AccessibilityHelpCommand","InspectTokensController","standaloneColorService","launch","InspectTokensWidget","InspectTokens","_tokenizationSupport","getSafeTokenizationSupport","_ID","_getTokensAtLine","token1Index","tokens1","token2Index","tokens2","tokenStartIndex","renderTokenText","_decodeMetadata","_tokenTypeToString","_fontStyleToString","stateBeforeLine","_getStateBeforeLine","tokenizationResult1","tokenizationResult2","startState","onClose","clearDecorations","lastKnownEditorSelection","quickOpenEditorWidget_1","getAutoFocus","decorateLine","rangeHighlightDecorationId","BaseEditorQuickOpenAction","_inputAriaLabel","getController","searchValue","GotoLineEntry","decorator","parseResult","parseInput","numbers","diffModel","currentLine","runOpen","runPreview","toSelection","quickOpenModel_1","GotoLineAction","editorQuickOpen_1","EditorActionCommandEntry","QuickCommandAction","_editorActionsToEntries","elementA","elementB","elementAName","elementBName","SymbolEntry","getRange","QuickOutlineAction","quickOpen_1","toQuickOpenEntries","symbolEntry","flattened","normalizedSearchValue","flattened_1","sortScoped","sortNormal","currentType","currentResult","typeCounter","typeToLabel","elementARange","elementBRange","elementAType","elementBType","StandaloneCodeEditorServiceImpl","sideBySide","doOpenEditor","findModel","codeEditorServiceImpl_1","inherit","vs_dark","hc_black","isBuiltinTheme","VS_THEME_NAME","VS_DARK_THEME_NAME","HC_BLACK_THEME_NAME","getBuiltinRules","builtinTheme","themes_1","newBuiltInTheme","themeData","StandaloneTheme","standaloneThemeData","defaultColors","_tokenTheme","notifyBaseUpdated","baseData","useDefault","getDefault","encodedTokensColors","tokenization_1","StandaloneThemeServiceImpl","environment","_onThemeChange","_onIconThemeChange","_knownThemes","_styleElement","defineTheme","hasRule","ruleCollector","hidesExplorerArrows","ContextMenuService","_onDidContextMenu","contextMenuHandler","contextMenuHandler_1","useAltAsMultipleSelectionModifier","multiSelectModifierSettingKey","useSingleClickToOpen","openModeSettingKey","workbenchTreeDataPreamble","WorkbenchListSupportsKeyboardNavigation","didBindWorkbenchListAutomaticKeyboardNavigation","WorkbenchListAutomaticKeyboardNavigation","getAutomaticKeyboardNavigation","WorkbenchListAutomaticKeyboardNavigationKey","automaticKeyboardNavigationSettingKey","keyboardNavigation","keyboardNavigationSettingKey","horizontalScrollingKey","getHorizontalScrollingSetting","MultipleSelectionController","WorkbenchOpenController","tlp_1","toWorkbenchListOptions","workbenchListOptions","sharedListStyleSheet","treeIndentKey","inChord","createKeyboardNavigationEventFilter","IListService","ListService","_lastFocusedWidget","extraContextKeys","registeredList","RawWorkbenchListFocusContextKey","WorkbenchListSupportsMultiSelectContextKey","WorkbenchListHasSelectionOrFocus","WorkbenchListDoubleSelection","WorkbenchListMultiSelection","registerListeners","existingOpenController","isLeftButton","WorkbenchObjectTree","listService","treeOptions","internals","WorkbenchTreeInternals","WorkbenchDataTree","dataTree_1","WorkbenchAsyncDataTree","asyncDataTree_1","createScopedContextKeyService","hasSelectionOrFocus","hasDoubleSelection","hasMultiSelection","_useAltAsMultipleSelectionModifier","interestingContextKeys","updateKeyboardNavigation","DecorationsManager","_decorationIgnoreSet","_callOnModelChange","_onModelChanged","_onDecorationChanged","newDecorationsActualIndex","oneReference","DecorationOptions","LayoutData","ctxReferenceWidgetSearchTreeFocused","ReferenceWidget","_defaultTreeKeyboardSupport","layoutData","_textModelResolverService","_peekViewService","_disposeOnNewModel","_onDidSelectReference","_dim","_previewNotAvailableMessage","_tree","_previewModelReference","_splitView","peekViewBorder","peekViewTitleBackground","peekViewTitleForeground","peekViewTitleInfoForeground","_getFocusedReference","containerElement","_messageContainer","splitview_1","_previewContainer","_treeContainer","referencesTree_1","listService_1","onEvent","_revealReference","goto","aside","_onNewModel","_decorationsManager","revealParent","_revealedReference","peekViewWidget_1","peekViewResultsBackground","peekViewResultsMatchForeground","peekViewResultsFileForeground","peekViewResultsSelectionBackground","peekViewResultsSelectionForeground","peekViewEditorBackground","peekViewEditorGutterBackground","peekViewResultsMatchHighlight","peekViewEditorMatchHighlight","peekViewEditorMatchHighlightBorder","findMatchHighlightColor","referenceHighlightColor","referenceHighlightBorder","hcOutline","resultsBackground","resultsMatchForeground","resultsFileForeground","resultsSelectedBackground","resultsSelectedForeground","editorGutterBackground","onRelatedInformation","_longestLineLength","_relatedDiagnostics","WeakMap","_messageBlock","_relatedBlock","related","lines_1","lastLineElement","lines_2","detailsElement","sourceElement","codeElement","relatedInformationNode","relatedInformation_1","relatedResource","relatedMessage","getHeightInLines","MarkerNavigationWidget","_onDidSelectRelatedInformation","onDidSelectRelatedInformation","_severity","_backgroundColor","editorMarkerNavigationBackground","editorMarkerNavigationError","editorMarkerNavigationWarning","editorMarkerNavigationInfo","referencesWidget_1","_parentContainer","_message","showAtMarker","markerIdx","markerCount","computeRequiredHeight","headingIconClassName","updateMarker","showStale","_heightInPixel","errorDefault","warningDefault","infoDefault","MarkerModel","_markers","_nextIdx","_toUnbind","_onCurrentMarkerChanged","_onMarkerSetChanged","setMarkers","currentMarker","oldMarker","MarkerNavigationAction","compareMarker","withoutWatchingEditorPosition","inCircles","oldIdx","atEdge","findMarkerAtPosition","MarkerController","_disposeOnClose","_widgetVisible","CONTEXT_MARKERS_NAVIGATION_VISIBLE","_cleanUp","getOrCreateModel","_getMarkers","prevMarkerKeybinding","PrevMarkerAction","nextMarkerKeybinding","NextMarkerAction","LABEL","__generator","gotoErrorWidget_1","pinned","revealIfOpened","closeMarkersNavigation","onCurrentMarkerChanged","onMarkerSetChanged","multiFile","_multiFile","newMarker","revealInCenterIfOutsideViewport","NextMarkerInFilesAction","PrevMarkerInFilesAction","MarkerCommand","ColorHover","MarkerHover","ModesContentComputer","_markerDecorationsService","setRange","getHover_1","colorDetector","colorDetector_1","didFindColor","hoverRange","_getLoadingMessage","ModesContentHoverWidget","markerDecorationsService","renderDisposable","_lastRange","_highlightDecorations","_isChangingDecorations","_colorPicker","filteredMessages","firstElement","secondElement","hoverContentsEquals","_shouldFocus","isColorPickerVisible","complete","renderColumn","isEmptyHoverContent","containColorPicker","markdownDisposeables","markerMessages","color_3","editorModel_1","colorPickerModel_1","colorPickerWidget_1","updateEditorModel","textEdits","textEdit","updateColorPresentations","colorListener","colorChangeListener","markdownHoverElement","hoverContentsElement","renderMarkerHover","markerHoverForStatusbar","renderMarkerStatusbar","markerHover","hoverElement","markerElement","whiteSpace","message_1","relatedInfoContainer","messageElement_1","actionsElement","renderAction","codeActionsPromise","gotoError_1","codeAction","actionOptions","actionContainer","ModesHoverController","_isMouseDown","_hoverClicked","_hookEvents","_didChangeConfigurationHandler","_hideWidgets","_unhookEvents","_createHoverWidget","_glyphWidget","hideWidgetsEventHandler","hoverOpts","_isHoverEnabled","_isHoverSticky","_onModelDecorationsChanged","_onEditorScrollChanged","contentWidget","glyphWidget","modesContentHover_1","modesGlyphHover_1","showContentHover","markersDecorationService_1","ShowHoverAction","editorHoverHighlightColor","hoverBackground","hoverBorder","actionsBackground","ctxReferenceSearchVisible","ReferencesController","_requestIdPool","_ignoreModelChangeEvent","_referenceSearchVisible","toggleWidget","modelPromise","widgetPosition","closeWidget","onDidSelectReference","openReference","onGoto","_gotoReference","requestId","getMetaTitle","goToNextOrPreviousReference","currentPosition","editorFocus","openedEditor","DefinitionActionConfig","openInPeek","filterCurrent","DefinitionAction","definitionPromise","_getTargetLocationForPosition","idxOfCurrent","_openReference","_onResult","_getNoResultFoundMessage","goToDefinition_1","_getMetaTitle","_openInPeek","targetEditor","referencesController_1","goToDefinitionKb","GoToDefinitionAction","OpenDefinitionToSideAction","PeekDefinitionAction","DeclarationAction","GoToDeclarationAction","PeekDeclarationAction","ImplementationAction","GoToImplementationAction","PeekImplementationAction","TypeDefinitionAction","GoToTypeDefinitionAction","PeekTypeDefinitionAction","GotoDefinitionWithMouseEditorContribution","previousPromise","linkGesture","startFindDefinition","gotoDefinition","currentWordUnderMouse","findDefinition","previewValue","getPreviewValue","rangeToUse","getPreviewRangeBasedOnBrackets","MAX_SOURCE_PREVIEW_LINES","getPreviewRangeBasedOnIndentation","stripIndentationFromPreviewRange","previewRange","minIndent","endIndent","startIndent","ignoreFirstEmpty","currentBracket","lastBracket","nextLineNumber","nextColumn","goToDefinitionCommands_1","closeActiveReferenceSearch","withController","outerEditor","provideReferences","includeDeclaration","defaultReferenceSearchOptions","ReferenceController","ReferenceAction","control","lastFocusedList","StandaloneReferencesController","IWorkspaceContextService","IWorkspace","isIWorkspace","IWorkspaceFolder","isIWorkspaceFolder","toResource","Workspace","_foldersMap","_folders","updateFoldersMap","WorkspaceFolder","isConfigurationOverrides","SimpleModel","SimpleEditorModelResolverService","setEditor","codeEditorCallback","diffEditorCallback","withTypedEditor","SimpleProgressService","SimpleDialogService","SimpleNotificationService","notify","notification","NO_OP","StandaloneCommandService","_onWillExecuteCommand","_dynamicCommands","StandaloneKeybindingService","_cachedResolver","_dynamicKeybindings","keyEvent","addDynamicKeybinding","_keybinding","updateResolver","_toNormalizedKeybindingItems","resolvedKeybindings_1","resolveKeybinding","resolvedKeybindingItem_1","usLayoutResolvedKeybinding_1","abstractKeybindingService_1","SimpleConfigurationService","configurationModels_1","arg3","arg4","SimpleResourceConfigurationService","_onDidChangeConfigurationEmitter","SimpleResourcePropertiesService","filesConfiguration","StandaloneTelemetryService","SimpleWorkspaceContextService","SCHEME","workspace_1","applyConfigurationValues","isDiffEditor","SimpleBulkEditService","workspaceEdit","totalEdits","totalFiles","SimpleUriLabelService","SimpleLayoutService","LAST_GENERATED_COMMAND_ID","ariaDomNodeCreated","StandaloneCodeEditor","simpleServices_1","_standaloneKeybindingService","whenExpression","createContextKey","addAction","_descriptor","keybindingsWhen","keybindingContext","contextMenuGroupId","contextMenuOrder","uniqueId","menuItem","StandaloneEditor","_ownsModel","StandaloneDiffEditor","diffEditorWidget_1","StaticServices","LazyStaticService","_all","_serviceCollection","_serviceId","_factory","init","instantiationService_1","configurationServiceImpl","resourceConfigurationService","contextService","labelService","dialogService","dialogs_1","accessibilityService_1","markerService_1","modeServiceImpl_1","modelServiceImpl_1","markerDecorationsServiceImpl_1","standaloneThemeServiceImpl_1","standaloneCodeServiceImpl_1","suggestMemoryService","suggestMemory_1","codeLensCacheService","DynamicStandaloneServices","ensure","contextKeyService_1","contextViewService_1","contextMenuService_1","menuService_1","withAllStandaloneServices","standaloneServices_1","simpleEditorModelResolverService","openerService_1","standaloneCodeEditor_1","onDidCreateEditor","createDiffEditor","createDiffNavigator","diffNavigator_1","doCreateModel","firstLF","setModelLanguage","setModelMarkers","getModelMarkers","onDidCreateModel","onWillDisposeModel","webWorker_1","colorizer_1","remeasureFonts","configuration_2","createMonacoEditorAPI","getEncodedLanguageId","lid","onLanguage","setLanguageConfiguration","setTokensProvider","isEncodedTokensProvider","EncodedTokenizationSupport2Adapter","TokenizationSupport2Adapter","setMonarchTokensProvider","languageDef","monarchCompile_1","registerReferenceProvider","registerRenameProvider","registerSignatureHelpProvider","registerHoverProvider","registerDocumentSymbolProvider","registerDocumentHighlightProvider","registerDefinitionProvider","registerImplementationProvider","registerTypeDefinitionProvider","registerCodeLensProvider","registerCodeActionProvider","registerDocumentFormattingEditProvider","registerDocumentRangeFormattingEditProvider","registerOnTypeFormattingEditProvider","registerLinkProvider","registerCompletionItemProvider","registerColorProvider","registerFoldingRangeProvider","tokenizeEncoded","_toClassicTokens","previousStartIndex","scopes","actualResult","_toBinaryTokens","createMonacoLanguagesAPI","api","standaloneEditor_1","standaloneLanguages_1","ignoreDuplicateModules","WORKSPACE_EXTENSION","isSingleFolderWorkspaceIdentifier","toWorkspaceIdentifier","configPath","CompositeSnippetVariableResolver","_delegates","SelectionBasedVariableResolver","lineLeadingWhitespace","varLeadingWhitespace_1","snippetParser_1","whitespaceCommonLength_1","ModelBasedVariableResolver","ClipboardBasedVariableResolver","_selectionIdx","_selectionCount","readText","CommentBasedVariableResolver","TimeBasedVariableResolver","getFullYear","getMonth","valueOf","getDate","getHours","getMinutes","getSeconds","dayNames","getDay","dayNamesShort","monthNames","monthNamesShort","WorkspaceBasedVariableResolver","_workspaceService","workspaceIdentifier","workspaces_1","getColorGraceful","OneSnippet","_nestingLevel","_snippet","_offset","_placeholderGroups","placeholders","_placeholderGroupsIdx","_placeholderDecorations","_initDecorations","placeholderOffset","placeholderLen","_decor","inactiveFinal","inactive","skipThisPlaceholder","activePlaceholders","activeFinal","active","enclosingPlaceholder","id_1","computePossibleSelections","placeholdersWithEqualIndex_1","indexLastPlaceholder","nestedPlaceholder","placeholder_1","SnippetSession","overwriteAfter","adjustWhitespace","_templateMerges","_snippets","_template","_overwriteBefore","_overwriteAfter","_adjustWhitespace","templateLeadingWhitespace","adjustSelection","positionColumnBefore","positionColumnAfter","createEditsAndSnippets","modelBasedVariableResolver","snippetVariables_1","workspaceService","firstBeforeText","firstAfterText","firstLineFirstNonWhitespace","indexedSelections","indexedSelections_1","extensionBefore","extensionAfter","snippetSelection","_logInfo","hasPlaceholder","oneSelection","isAtFirstPlaceholder","isAtLastPlaceholder","isSelectionWithinPlaceholders","allPossibleSelections","SnippetController2","_snippetListener","_inSnippet","InSnippetMode","_hasNextTabstop","HasNextTabstop","_hasPrevTabstop","HasPrevTabstop","undoStopBefore","undoStopAfter","_doInsert","_modelVersionId","snippetSession_1","_updateState","_handleChoice","_currentChoice","first_1","resetSelection","isInSnippet","CommandCtor","ctrl","shy","leadingWord","shouldAutoTrigger","SuggestModel","_editorWorker","_triggerQuickSuggest","_triggerRefilter","_onDidTrigger","_onDidSuggest","onDidTrigger","onDidSuggest","_updateTriggerCharacters","_updateQuickSuggest","_updateActiveSuggestSession","editorIsComposing","_refilterCompletionItems","_triggerCharacterListener","_completionModel","_quickSuggestDelay","supportsByTriggerCharacter","triggerCharacters","retrigger","_requestToken","prevSelection","snippetController2_1","_onNewContext","onlyFrom","existingItems","suggestCtx","itemKindFilter","wordDistance_1","cmpFn","completionModel_1","adopted","oldLineContext","AcceptOnCharacterOracle","_onItem","_active","acceptCharacters","commitCharacters","SuggestController","editorWorker","_memoryService","_sticky","suggestModel_1","suggestWidget_1","_onDidSelectItem","autoAcceptOracle","makesTextEdit","insertTextRules","_alternatives","suggestAlternatives_1","wordContextKey_1","acceptSuggestionsOnEnter","updateFromConfig","keepAlternativeSuggestions","undoStops","modelVersionNow","columnDelta","TriggerSuggestAction","_alertCompletionItem","triggerSuggestAndAcceptBest","positionNow","acceptSelectedSuggestion","acceptNextSuggestion","acceptPrevSuggestion","cancelSuggestWidget","selectNextSuggestion","selectNextPageSuggestion","selectLastSuggestion","selectPrevSuggestion","selectPrevPageSuggestion","selectFirstSuggestion","toggleSuggestionDetails","toggleSuggestionFocus","SuggestCommand","__export","editor_api_1"],"mappings":";;;;;;CAAA;AACA,ICeAA,EDfAC,GAAA,UAAA,UAAA,2BAAA,8BAAA,uBAAA,yBAAA,SAAA,sBAAA,+BAAA,+BAAA,wBAAA,qCAAA,iCAAA,iDAAA,wCAAA,uBAAA,yBAAA,0BAAA,2CAAA,wBAAA,uBAAA,qCAAA,kCAAA,yCAAA,8BAAA,qBAAA,8BAAA,uCAAA,uBAAA,mCAAA,0BAAA,yBAAA,+CAAA,kCAAA,4CAAA,+CAAA,0BAAA,2CAAA,2CAAA,uDAAA,uCAAA,iDAAA,yCAAA,6BAAA,4BAAA,yBAAA,qBAAA,+BAAA,wCAAA,yBAAA,qCAAA,iDAAA,gCAAA,yBAAA,2BAAA,sCAAA,mCAAA,0BAAA,qCAAA,8CAAA,yCAAA,kCAAA,wBAAA,gDAAA,qCAAA,yBAAA,qCAAA,wCAAA,qCAAA,uCAAA,gCAAA,4CAAA,yCAAA,mCAAA,sBAAA,iDAAA,4CAAA,2CAAA,wBAAA,yCAAA,4CAAA,+CAAA,qDAAA,sDAAA,4BAAA,kCAAA,8CAAA,6BAAA,yCAAA,yDAAA,oDAAA,qDAAA,uCAAA,uCAAA,mCAAA,oDAAA,+BAAA,yCAAA,6CAAA,8CAAA,oCAAA,qCAAA,4CAAA,8BAAA,6BAAA,mDAAA,kCAAA,oCAAA,+CAAA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ACf4qH,EAAAh5F,QAAe0tB,QAAQhiD,YACvB2nJ,EAAA5lJ,oBAAoBE,iBAAiBjC,YACrCgmJ,EAAA7C,mBAAmBG,cAActjJ,aAElCtqP,QAAS,SAACzrB,EAAGpN,GAEZoN,EAAEo+Z,4BAA4B1hW,EAAApB,SAAS1oE,GAAMm0B,GAAG6pO,SAAU,OAAUh+P,IAAUg+P,SAAU,SAEzFqhD,QACC5E,OA7Ia,IA8IbH,QAAO,MAIT4H,EAAApB,sBAAsB,IAAIwrH,GACzBrkZ,GAAI,uBACJ+uG,aAAcwsJ,EAAA/B,eAAeM,IAC5ByB,EAAA/B,eAAel3Q,OAAO,8BAA+B,MACrDuga,EAAA5lJ,oBAAoBE,iBACpBqrH,EAAAh5F,QAAe0tB,QAAQhiD,YACvBgmJ,EAAA7C,mBAAmBG,cAActjJ,aAElCtqP,QAAS,SAAAzrB,GAAK,OAAAA,EAAEu+Z,wBAChBtsH,QACC5E,OA5Ja,IA6JbiF,OAAQkE,EAAAtgC,kBAAkBG,eAC1B62B,QAAO,MAIT4H,EAAApB,sBAAsB,IAAIwrH,GACzBrkZ,GAAI;AACJ+uG,aAAcwsJ,EAAA/B,eAAeM,IAC5ByB,EAAA/B,eAAel3Q,OAAO,8BAA+B,MACrDuga,EAAA5lJ,oBAAoBE,iBACpBqrH,EAAAh5F,QAAe0tB,QAAQhiD,YACvBgmJ,EAAA7C,mBAAmBG,cAActjJ,aAElCtqP,QAAS,SAAAzrB,GAAK,OAAAA,EAAEw+Z,wBAChBvsH,QACC5E,OA5Ka,IA6KbiF,OAAQkE,EAAAtgC,kBAAkBG,eAC1B62B,QAAS,odC/nBXiyH,CAAAC,O9bfA7ra,KAAAhE","file":"editor.main.js","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 var other = head.getElementsByTagName('link') || document.head.getElementsByTagName('script');\n if (other.length > 0) {\n head.insertBefore(linkNode, other[other.length - 1]);\n }\n else {\n head.appendChild(linkNode);\n }\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) {\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 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: true,\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 === undefined || 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(undefined, [_this._env, data, message].concat(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","\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: 'text/plain'\n};\n\nexport interface IDragAndDropData {\n\tupdate(dataTransfer: DataTransfer): void;\n\tgetData(): any;\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 * Copyright (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: HTMLIFrameElement | 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.protocol !== parentLocation.protocol || location.hostname !== parentLocation.hostname || location.port !== parentLocation.port) {\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\nfunction findIframeElementInParentWindow(parentWindow: Window, childWindow: Window): HTMLIFrameElement | null {\n\tlet parentWindowIframes = parentWindow.document.getElementsByTagName('iframe');\n\tlet iframe: HTMLIFrameElement;\n\tfor (let i = 0, len = parentWindowIframes.length; i < len; i++) {\n\t\tiframe = parentWindowIframes[i];\n\t\tif (iframe.contentWindow === childWindow) {\n\t\t\treturn iframe;\n\t\t}\n\t}\n\treturn null;\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: findIframeElementInParentWindow(parent, w)\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: any) {\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\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 { GestureEvent } from 'vs/base/browser/touch';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IDragAndDropData } from 'vs/base/browser/dnd';\n\nexport interface IListVirtualDelegate<T> {\n\tgetHeight(element: T): number;\n\tgetTemplateId(element: T): string;\n\thasDynamicHeight?(element: T): boolean;\n\tsetDynamicHeight?(element: T, height: number): void;\n}\n\nexport interface IListRenderer<T, TTemplateData> {\n\ttemplateId: string;\n\trenderTemplate(container: HTMLElement): TTemplateData;\n\trenderElement(element: T, index: number, templateData: TTemplateData, dynamicHeightProbing?: boolean): void;\n\tdisposeElement?(element: T, index: number, templateData: TTemplateData, dynamicHeightProbing?: boolean): 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 enum ListAriaRootRole {\n\t/** default tree structure role */\n\tTREE = 'tree',\n\n\t/** role='tree' can interfere with screenreaders reading nested elements inside the tree row. Use FORM in that case. */\n\tFORM = 'form'\n}\n\nexport interface IKeyboardNavigationLabelProvider<T> {\n\n\t/**\n\t * Return a keyboard navigation label which will be used by the\n\t * list for filtering/navigating. Return `undefined` to make an\n\t * element always match.\n\t */\n\tgetKeyboardNavigationLabel(element: T): { toString(): string | undefined; } | undefined;\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[]): string | undefined;\n\tonDragStart?(data: IDragAndDropData, originalEvent: DragEvent): void;\n\tonDragOver(data: IDragAndDropData, targetElement: T | undefined, targetIndex: number | undefined, originalEvent: DragEvent): boolean | IListDragOverReaction;\n\tdrop(data: IDragAndDropData, targetElement: T | undefined, targetIndex: number | undefined, originalEvent: DragEvent): 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 { 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 readonly _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 readonly _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) {\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 = 0;\n\t\tthis._scrollSize = 0;\n\t\tthis._scrollPosition = 0;\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\tlet r = new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize);\n\t\tr.setVisibleSize(this._visibleSize);\n\t\tr.setScrollSize(this._scrollSize);\n\t\tr.setScrollPosition(this._scrollPosition);\n\t\treturn r;\n\t}\n\n\tpublic setVisibleSize(visibleSize: number): boolean {\n\t\tlet 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\tlet 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\tlet 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\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\tlet 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` 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\tlet desiredSliderPosition = this._computedSliderPosition + delta;\n\t\treturn Math.round(desiredSliderPosition / this._computedSliderRatio);\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/**\n * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort`\n * so only use this when actually needing stable sort.\n */\nexport function mergeSort<T>(data: T[], compare: Compare<T>): T[] {\n\t_sort(data, compare, 0, data.length - 1, []);\n\treturn data;\n}\n\nfunction _merge<T>(a: T[], compare: Compare<T>, lo: number, mid: number, hi: number, aux: T[]): void {\n\tlet leftIdx = lo, rightIdx = mid + 1;\n\tfor (let i = lo; i <= hi; i++) {\n\t\taux[i] = a[i];\n\t}\n\tfor (let i = lo; i <= hi; i++) {\n\t\tif (leftIdx > mid) {\n\t\t\t// left side consumed\n\t\t\ta[i] = aux[rightIdx++];\n\t\t} else if (rightIdx > hi) {\n\t\t\t// right side consumed\n\t\t\ta[i] = aux[leftIdx++];\n\t\t} else if (compare(aux[rightIdx], aux[leftIdx]) < 0) {\n\t\t\t// right element is less -> comes first\n\t\t\ta[i] = aux[rightIdx++];\n\t\t} else {\n\t\t\t// left element comes first (less or equal)\n\t\t\ta[i] = aux[leftIdx++];\n\t\t}\n\t}\n}\n\nfunction _sort<T>(a: T[], compare: Compare<T>, lo: number, hi: number, aux: T[]) {\n\tif (hi <= lo) {\n\t\treturn;\n\t}\n\tconst mid = lo + ((hi - lo) / 2) | 0;\n\t_sort(a, compare, lo, mid, aux);\n\t_sort(a, compare, mid + 1, hi, aux);\n\tif (compare(a[mid], a[mid + 1]) <= 0) {\n\t\t// left and right are sorted and if the last-left element is less\n\t\t// or equals than the first-right element there is nothing else\n\t\t// to do\n\t\treturn;\n\t}\n\t_merge(a, compare, lo, mid, hi, aux);\n}\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 mergeSort(data.slice(0), 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 a new array with all falsy values removed. The original array IS NOT modified.\n */\nexport function coalesce<T>(array: Array<T | undefined | null>): T[] {\n\tif (!array) {\n\t\treturn array;\n\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: ReadonlyArray<T> | undefined | null): obj is Array<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 equalness by returning a unique string for each.\n */\nexport function distinct<T>(array: ReadonlyArray<T>, keyFn?: (t: T) => string): T[] {\n\tif (!keyFn) {\n\t\treturn array.filter((element, position) => {\n\t\t\treturn array.indexOf(element) === position;\n\t\t});\n\t}\n\n\tconst seen: { [key: string]: boolean; } = Object.create(null);\n\treturn array.filter((elem) => {\n\t\tconst key = keyFn(elem);\n\t\tif (seen[key]) {\n\t\t\treturn false;\n\t\t}\n\n\t\tseen[key] = true;\n\n\t\treturn true;\n\t});\n}\n\nexport function distinctES6<T>(array: ReadonlyArray<T>): T[] {\n\tconst seen = new Set<T>();\n\treturn array.filter(element => {\n\t\tif (seen.has(element)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tseen.add(element);\n\t\treturn true;\n\t});\n}\n\nexport function firstIndex<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): number {\n\tfor (let i = 0; i < array.length; 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 first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T): T;\nexport function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): T | undefined;\nexport function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T | undefined = undefined): T | undefined {\n\tconst index = firstIndex(array, fn);\n\treturn index < 0 ? notFoundValue : array[index];\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[] {\n\treturn Array.isArray(x) ? x : [x];\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (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?: any, message?: string) {\n\tif (!value) {\n\t\tthrow new Error(message ? 'Assertion failed (' + message + ')' : 'Assertion Failed');\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (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 interface IStringDictionary<V> {\n\t[name: string]: V;\n}\n\n/**\n * An interface for a JavaScript object that\n * acts a dictionary. The keys are numbers.\n */\nexport interface INumberDictionary<V> {\n\t[idx: number]: V;\n}\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Iterates over each entry in the provided set. 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}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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;\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;\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;\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): 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\ttoString(): string {\n\t\treturn '' + Color.Format.CSS.format(this);\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 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 | null {\n\t\t\t\tif (!color) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\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\tif (!hex) {\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\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\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\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 * Copyright (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\nimport { DiffChange } from 'vs/base/common/diff/diffChange';\n\nfunction createStringSequence(a: string): ISequence {\n\treturn {\n\t\tgetLength() { return a.length; },\n\t\tgetElementAtIndex(pos: number) { return a.charCodeAt(pos); }\n\t};\n}\n\nexport function stringDiff(original: string, modified: string, pretty: boolean): IDiffChange[] {\n\treturn new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty);\n}\n\n\nexport interface ISequence {\n\tgetLength(): number;\n\tgetElementAtIndex(index: number): 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, originalSequence: ISequence, matchLengthOfLongest: number): boolean;\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}\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\nlet MaxDifferencesHistory = 1447;\n//let MaxDifferencesHistory = 100;\n\n\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 * MarktNextChange() 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 = Number.MAX_VALUE;\n\t\tthis.m_modifiedStart = Number.MAX_VALUE;\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 = Number.MAX_VALUE;\n\t\tthis.m_modifiedStart = Number.MAX_VALUE;\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 OriginalSequence: ISequence;\n\tprivate ModifiedSequence: ISequence;\n\tprivate ContinueProcessingPredicate: IContinueProcessingPredicate | null;\n\n\tprivate m_forwardHistory: number[][];\n\tprivate m_reverseHistory: number[][];\n\n\t/**\n\t * Constructs the DiffFinder\n\t */\n\tconstructor(originalSequence: ISequence, newSequence: ISequence, continueProcessingPredicate: IContinueProcessingPredicate | null = null) {\n\t\tthis.OriginalSequence = originalSequence;\n\t\tthis.ModifiedSequence = newSequence;\n\t\tthis.ContinueProcessingPredicate = continueProcessingPredicate;\n\n\t\tthis.m_forwardHistory = [];\n\t\tthis.m_reverseHistory = [];\n\t}\n\n\tprivate ElementsAreEqual(originalIndex: number, newIndex: number): boolean {\n\t\treturn (this.OriginalSequence.getElementAtIndex(originalIndex) === this.ModifiedSequence.getElementAtIndex(newIndex));\n\t}\n\n\tprivate OriginalElementsAreEqual(index1: number, index2: number): boolean {\n\t\treturn (this.OriginalSequence.getElementAtIndex(index1) === this.OriginalSequence.getElementAtIndex(index2));\n\t}\n\n\tprivate ModifiedElementsAreEqual(index1: number, index2: number): boolean {\n\t\treturn (this.ModifiedSequence.getElementAtIndex(index1) === this.ModifiedSequence.getElementAtIndex(index2));\n\t}\n\n\tpublic ComputeDiff(pretty: boolean): IDiffChange[] {\n\t\treturn this._ComputeDiff(0, this.OriginalSequence.getLength() - 1, 0, this.ModifiedSequence.getLength() - 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): DiffChange[] {\n\t\tlet 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\treturn this.PrettifyChanges(changes);\n\t\t}\n\n\t\treturn changes;\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\tlet midOriginalArr = [0], midModifiedArr = [0];\n\t\tlet result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\n\n\t\tlet midOriginal = midOriginalArr[0];\n\t\tlet 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\tlet 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 did'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: number[], reversePoints: number[],\n\t\toriginalIndex: number, originalEnd: number, midOriginalArr: number[],\n\t\tmodifiedIndex: number, modifiedEnd: number, midModifiedArr: number[],\n\t\tdeltaIsEven: boolean, quitEarlyArr: boolean[]): DiffChange[] {\n\t\tlet forwardChanges: DiffChange[] | null = null, 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 = Number.MIN_VALUE;\n\t\tlet historyIndex = this.m_forwardHistory.length - 1;\n\t\tlet diagonal: number;\n\n\t\tdo {\n\t\t\t// Get the diagonal index from the relative diagonal number\n\t\t\tdiagonal = 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\tlet 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 = Number.MAX_VALUE;\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\tdiagonal = 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\t\tlet numDifferences: number;\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\tlet maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\n\t\tlet numDiagonals = maxDifferences + 1;\n\t\tlet forwardPoints: number[] = new Array<number>(numDiagonals);\n\t\tlet reversePoints: number[] = new Array<number>(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\tlet diagonalForwardBase = (modifiedEnd - modifiedStart);\n\t\tlet 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\tlet diagonalForwardOffset = (originalStart - modifiedStart);\n\t\tlet 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\tlet delta = diagonalReverseBase - diagonalForwardBase;\n\t\tlet 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\tlet diagonal: number, tempOriginalIndex: number;\n\t\tfor (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 (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\ttempOriginalIndex = 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] && MaxDifferencesHistory > 0 && numDifferences <= (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\tlet matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\n\n\t\t\tif (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, this.OriginalSequence, 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 && MaxDifferencesHistory > 0 && numDifferences <= (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 quiting 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 (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\ttempOriginalIndex = 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] && MaxDifferencesHistory > 0 && numDifferences <= (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 <= 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: number[] = new Array<number>(diagonalForwardEnd - diagonalForwardStart + 2);\n\t\t\t\ttemp[0] = diagonalForwardBase - diagonalForwardStart + 1;\n\t\t\t\tMyArray.Copy(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\n\t\t\t\tthis.m_forwardHistory.push(temp);\n\n\t\t\t\ttemp = new Array<number>(diagonalReverseEnd - diagonalReverseStart + 2);\n\t\t\t\ttemp[0] = diagonalReverseBase - diagonalReverseStart + 1;\n\t\t\t\tMyArray.Copy(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\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.OriginalSequence.getLength();\n\t\t\tconst modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this.ModifiedSequence.getLength();\n\t\t\tconst checkOriginal = change.originalLength > 0;\n\t\t\tconst checkModified = change.modifiedLength > 0;\n\n\t\t\twhile (change.originalStart + change.originalLength < originalStop &&\n\t\t\t\tchange.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\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\tif (prevChange.originalLength > 0) {\n\t\t\t\t\toriginalStop = prevChange.originalStart + prevChange.originalLength;\n\t\t\t\t}\n\t\t\t\tif (prevChange.modifiedLength > 0) {\n\t\t\t\t\tmodifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\n\t\t\t\t}\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\tlet originalStart = change.originalStart - delta;\n\t\t\t\tlet 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\tlet score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);\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\t\t}\n\n\t\treturn changes;\n\t}\n\n\tprivate _OriginalIsBoundary(index: number): boolean {\n\t\tif (index <= 0 || index >= this.OriginalSequence.getLength() - 1) {\n\t\t\treturn true;\n\t\t}\n\t\tconst element = this.OriginalSequence.getElementAtIndex(index);\n\t\treturn (typeof element === 'string' && /^\\s*$/.test(element));\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\tlet 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.ModifiedSequence.getLength() - 1) {\n\t\t\treturn true;\n\t\t}\n\t\tconst element = this.ModifiedSequence.getElementAtIndex(index);\n\t\treturn (typeof element === 'string' && /^\\s*$/.test(element));\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\tlet 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\tlet originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\n\t\tlet 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\tlet 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\tlet 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\tlet originalStart = left.originalStart;\n\t\t\tlet originalLength = left.originalLength;\n\t\t\tlet 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\tlet diagonalsBelow = diagonalBaseIndex;\n\t\tlet diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\n\t\tlet diffEven = (numDifferences % 2 === 0);\n\n\t\tif (diagonal < 0) {\n\t\t\tlet lowerBoundEven = (diagonalsBelow % 2 === 0);\n\t\t\treturn (diffEven === lowerBoundEven) ? 0 : 1;\n\t\t} else {\n\t\t\tlet 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\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\tpublic onUnexpectedError(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\tpublic onUnexpectedExternalError(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 (!isPromiseCanceledError(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 (!isPromiseCanceledError(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 isPromiseCanceledError(error: any): boolean {\n\treturn error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n\n/**\n * Returns an error that signals cancellation.\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","/*---------------------------------------------------------------------------------------------\n * Copyright (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: any, fn: T): T {\n\tconst _this = this;\n\tlet didCall = false;\n\tlet result: any;\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 any as 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 * Return a hash value for an object.\n */\nexport function hash(obj: any, hashVal = 0): 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(0, 937);\n\t\tdefault:\n\t\t\treturn numberHash(0, 617);\n\t}\n}\n\nfunction 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\nfunction 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) => hash(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 hash(obj[key], hashVal);\n\t}, initialHashVal);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { UriComponents } from 'vs/base/common/uri';\n\nexport interface IMarkdownString {\n\tvalue: string;\n\tisTrusted?: boolean;\n\turis?: { [href: string]: UriComponents };\n}\n\nexport class MarkdownString implements IMarkdownString {\n\n\tvalue: string;\n\tisTrusted?: boolean;\n\n\tconstructor(value: string = '') {\n\t\tthis.value = value;\n\t}\n\n\tappendText(value: string): MarkdownString {\n\t\t// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n\t\tthis.value += value.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&');\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}\n\treturn false;\n}\n\nexport function markedStringsEquals(a: IMarkdownString | IMarkdownString[], b: IMarkdownString | IMarkdownString[]): boolean {\n\tif (!a && !b) {\n\t\treturn true;\n\t} else if (!a || !b) {\n\t\treturn false;\n\t} else if (Array.isArray(a) && Array.isArray(b)) {\n\t\treturn equals(a, b, markdownStringEqual);\n\t} else if (isMarkdownString(a) && isMarkdownString(b)) {\n\t\treturn markdownStringEqual(a, b);\n\t} else {\n\t\treturn false;\n\t}\n}\n\nfunction markdownStringEqual(a: IMarkdownString, b: IMarkdownString): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t} else if (!a || !b) {\n\t\treturn false;\n\t} else {\n\t\treturn a.value === b.value && a.isTrusted === b.isTrusted;\n\t}\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","/*---------------------------------------------------------------------------------------------\n * Copyright (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 interface IteratorDefinedResult<T> {\n\treadonly done: false;\n\treadonly value: T;\n}\nexport interface IteratorUndefinedResult {\n\treadonly done: true;\n\treadonly value: undefined;\n}\nexport const FIN: IteratorUndefinedResult = { done: true, value: undefined };\nexport type IteratorResult<T> = IteratorDefinedResult<T> | IteratorUndefinedResult;\n\nexport interface Iterator<T> {\n\tnext(): IteratorResult<T>;\n}\n\nexport module Iterator {\n\tconst _empty: Iterator<any> = {\n\t\tnext() {\n\t\t\treturn FIN;\n\t\t}\n\t};\n\n\texport function empty<T>(): Iterator<T> {\n\t\treturn _empty;\n\t}\n\n\texport function fromArray<T>(array: T[], index = 0, length = array.length): Iterator<T> {\n\t\treturn {\n\t\t\tnext(): IteratorResult<T> {\n\t\t\t\tif (index >= length) {\n\t\t\t\t\treturn FIN;\n\t\t\t\t}\n\n\t\t\t\treturn { done: false, value: array[index++] };\n\t\t\t}\n\t\t};\n\t}\n\n\texport function from<T>(elements: Iterator<T> | T[] | undefined): Iterator<T> {\n\t\tif (!elements) {\n\t\t\treturn Iterator.empty();\n\t\t} else if (Array.isArray(elements)) {\n\t\t\treturn Iterator.fromArray(elements);\n\t\t} else {\n\t\t\treturn elements;\n\t\t}\n\t}\n\n\texport function map<T, R>(iterator: Iterator<T>, fn: (t: T) => R): Iterator<R> {\n\t\treturn {\n\t\t\tnext() {\n\t\t\t\tconst element = iterator.next();\n\t\t\t\tif (element.done) {\n\t\t\t\t\treturn FIN;\n\t\t\t\t} else {\n\t\t\t\t\treturn { done: false, value: fn(element.value) };\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\texport function filter<T>(iterator: Iterator<T>, fn: (t: T) => boolean): Iterator<T> {\n\t\treturn {\n\t\t\tnext() {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst element = iterator.next();\n\t\t\t\t\tif (element.done) {\n\t\t\t\t\t\treturn FIN;\n\t\t\t\t\t}\n\t\t\t\t\tif (fn(element.value)) {\n\t\t\t\t\t\treturn { done: false, value: element.value };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\texport function forEach<T>(iterator: Iterator<T>, fn: (t: T) => void): void {\n\t\tfor (let next = iterator.next(); !next.done; next = iterator.next()) {\n\t\t\tfn(next.value);\n\t\t}\n\t}\n\n\texport function collect<T>(iterator: Iterator<T>): T[] {\n\t\tconst result: T[] = [];\n\t\tforEach(iterator, value => result.push(value));\n\t\treturn result;\n\t}\n}\n\nexport type ISequence<T> = Iterator<T> | T[];\n\nexport function getSequenceIterator<T>(arg: Iterator<T> | T[]): Iterator<T> {\n\tif (Array.isArray(arg)) {\n\t\treturn Iterator.fromArray(arg);\n\t} else {\n\t\treturn arg;\n\t}\n}\n\nexport interface INextIterator<T> {\n\tnext(): T | null;\n}\n\nexport class ArrayIterator<T> implements INextIterator<T> {\n\n\tprivate items: T[];\n\tprotected start: number;\n\tprotected end: number;\n\tprotected index: number;\n\n\tconstructor(items: T[], start: number = 0, end: number = items.length, index = start - 1) {\n\t\tthis.items = items;\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.index = index;\n\t}\n\n\tpublic next(): T | null {\n\t\tthis.index = Math.min(this.index + 1, this.end);\n\t\treturn this.current();\n\t}\n\n\tprotected current(): 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\nexport class ArrayNavigator<T> extends ArrayIterator<T> implements INavigator<T> {\n\n\tconstructor(items: T[], start: number = 0, end: number = items.length, index = start - 1) {\n\t\tsuper(items, start, end, index);\n\t}\n\n\tpublic current(): T | null {\n\t\treturn super.current();\n\t}\n\n\tpublic previous(): T | null {\n\t\tthis.index = Math.max(this.index - 1, this.start - 1);\n\t\treturn this.current();\n\t}\n\n\tpublic first(): T | null {\n\t\tthis.index = this.start;\n\t\treturn this.current();\n\t}\n\n\tpublic last(): T | null {\n\t\tthis.index = this.end - 1;\n\t\treturn this.current();\n\t}\n\n\tpublic parent(): T | null {\n\t\treturn null;\n\t}\n}\n\nexport class MappedIterator<T, R> implements INextIterator<R> {\n\n\tconstructor(protected iterator: INextIterator<T>, protected fn: (item: T | null) => R) {\n\t\t// noop\n\t}\n\n\tnext() { return this.fn(this.iterator.next()); }\n}\n\nexport interface INavigator<T> extends INextIterator<T> {\n\tprevious(): T | null;\n\tparent(): T | null;\n\tfirst(): T | null;\n\tlast(): T | null;\n\tnext(): 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 { INavigator, ArrayNavigator } from 'vs/base/common/iterator';\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: T[] = [], limit: number = 10) {\n\t\tthis._initialize(history);\n\t\tthis._limit = limit;\n\t\tthis._onChange();\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\treturn this._navigator.next();\n\t}\n\n\tpublic previous(): T | null {\n\t\treturn this._navigator.previous();\n\t}\n\n\tpublic current(): T | null {\n\t\treturn this._navigator.current();\n\t}\n\n\tpublic parent(): null {\n\t\treturn null;\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\tthis._navigator = new ArrayNavigator(this._elements, 0, this._elements.length, this._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 _initialize(history: 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\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport { illegalArgument } from 'vs/base/common/errors';\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\t/**\n\t * Placed first to cover the 0 value of the enum.\n\t */\n\tUnknown = 0,\n\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\n\tKEY_0 = 21,\n\tKEY_1 = 22,\n\tKEY_2 = 23,\n\tKEY_3 = 24,\n\tKEY_4 = 25,\n\tKEY_5 = 26,\n\tKEY_6 = 27,\n\tKEY_7 = 28,\n\tKEY_8 = 29,\n\tKEY_9 = 30,\n\n\tKEY_A = 31,\n\tKEY_B = 32,\n\tKEY_C = 33,\n\tKEY_D = 34,\n\tKEY_E = 35,\n\tKEY_F = 36,\n\tKEY_G = 37,\n\tKEY_H = 38,\n\tKEY_I = 39,\n\tKEY_J = 40,\n\tKEY_K = 41,\n\tKEY_L = 42,\n\tKEY_M = 43,\n\tKEY_N = 44,\n\tKEY_O = 45,\n\tKEY_P = 46,\n\tKEY_Q = 47,\n\tKEY_R = 48,\n\tKEY_S = 49,\n\tKEY_T = 50,\n\tKEY_U = 51,\n\tKEY_V = 52,\n\tKEY_W = 53,\n\tKEY_X = 54,\n\tKEY_Y = 55,\n\tKEY_Z = 56,\n\n\tMeta = 57,\n\tContextMenu = 58,\n\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\n\tNumLock = 78,\n\tScrollLock = 79,\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\tUS_SEMICOLON = 80,\n\t/**\n\t * For any country/region, the '+' key\n\t * For the US standard keyboard, the '=+' key\n\t */\n\tUS_EQUAL = 81,\n\t/**\n\t * For any country/region, the ',' key\n\t * For the US standard keyboard, the ',<' key\n\t */\n\tUS_COMMA = 82,\n\t/**\n\t * For any country/region, the '-' key\n\t * For the US standard keyboard, the '-_' key\n\t */\n\tUS_MINUS = 83,\n\t/**\n\t * For any country/region, the '.' key\n\t * For the US standard keyboard, the '.>' key\n\t */\n\tUS_DOT = 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\tUS_SLASH = 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\tUS_BACKTICK = 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\tUS_OPEN_SQUARE_BRACKET = 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\tUS_BACKSLASH = 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\tUS_CLOSE_SQUARE_BRACKET = 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\tUS_QUOTE = 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\tOEM_102 = 92,\n\n\tNUMPAD_0 = 93, // VK_NUMPAD0, 0x60, Numeric keypad 0 key\n\tNUMPAD_1 = 94, // VK_NUMPAD1, 0x61, Numeric keypad 1 key\n\tNUMPAD_2 = 95, // VK_NUMPAD2, 0x62, Numeric keypad 2 key\n\tNUMPAD_3 = 96, // VK_NUMPAD3, 0x63, Numeric keypad 3 key\n\tNUMPAD_4 = 97, // VK_NUMPAD4, 0x64, Numeric keypad 4 key\n\tNUMPAD_5 = 98, // VK_NUMPAD5, 0x65, Numeric keypad 5 key\n\tNUMPAD_6 = 99, // VK_NUMPAD6, 0x66, Numeric keypad 6 key\n\tNUMPAD_7 = 100, // VK_NUMPAD7, 0x67, Numeric keypad 7 key\n\tNUMPAD_8 = 101, // VK_NUMPAD8, 0x68, Numeric keypad 8 key\n\tNUMPAD_9 = 102, // VK_NUMPAD9, 0x69, Numeric keypad 9 key\n\n\tNUMPAD_MULTIPLY = 103,\t// VK_MULTIPLY, 0x6A, Multiply key\n\tNUMPAD_ADD = 104,\t\t// VK_ADD, 0x6B, Add key\n\tNUMPAD_SEPARATOR = 105,\t// VK_SEPARATOR, 0x6C, Separator key\n\tNUMPAD_SUBTRACT = 106,\t// VK_SUBTRACT, 0x6D, Subtract key\n\tNUMPAD_DECIMAL = 107,\t// VK_DECIMAL, 0x6E, Decimal key\n\tNUMPAD_DIVIDE = 108,\t// VK_DIVIDE, 0x6F,\n\n\t/**\n\t * Cover all key codes when IME is processing input.\n\t */\n\tKEY_IN_COMPOSITION = 109,\n\n\tABNT_C1 = 110, // Brazilian (ABNT) Keyboard\n\tABNT_C2 = 111, // Brazilian (ABNT) Keyboard\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\nclass KeyCodeStrMap {\n\n\tprivate _keyCodeToStr: string[];\n\tprivate _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();\n\n(function () {\n\n\tfunction define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel: string = uiLabel, generalUserSettingsLabel: string = usUserSettingsLabel): void {\n\t\tuiMap.define(keyCode, uiLabel);\n\t\tuserSettingsUSMap.define(keyCode, usUserSettingsLabel);\n\t\tuserSettingsGeneralMap.define(keyCode, generalUserSettingsLabel);\n\t}\n\n\tdefine(KeyCode.Unknown, 'unknown');\n\n\tdefine(KeyCode.Backspace, 'Backspace');\n\tdefine(KeyCode.Tab, 'Tab');\n\tdefine(KeyCode.Enter, 'Enter');\n\tdefine(KeyCode.Shift, 'Shift');\n\tdefine(KeyCode.Ctrl, 'Ctrl');\n\tdefine(KeyCode.Alt, 'Alt');\n\tdefine(KeyCode.PauseBreak, 'PauseBreak');\n\tdefine(KeyCode.CapsLock, 'CapsLock');\n\tdefine(KeyCode.Escape, 'Escape');\n\tdefine(KeyCode.Space, 'Space');\n\tdefine(KeyCode.PageUp, 'PageUp');\n\tdefine(KeyCode.PageDown, 'PageDown');\n\tdefine(KeyCode.End, 'End');\n\tdefine(KeyCode.Home, 'Home');\n\n\tdefine(KeyCode.LeftArrow, 'LeftArrow', 'Left');\n\tdefine(KeyCode.UpArrow, 'UpArrow', 'Up');\n\tdefine(KeyCode.RightArrow, 'RightArrow', 'Right');\n\tdefine(KeyCode.DownArrow, 'DownArrow', 'Down');\n\tdefine(KeyCode.Insert, 'Insert');\n\tdefine(KeyCode.Delete, 'Delete');\n\n\tdefine(KeyCode.KEY_0, '0');\n\tdefine(KeyCode.KEY_1, '1');\n\tdefine(KeyCode.KEY_2, '2');\n\tdefine(KeyCode.KEY_3, '3');\n\tdefine(KeyCode.KEY_4, '4');\n\tdefine(KeyCode.KEY_5, '5');\n\tdefine(KeyCode.KEY_6, '6');\n\tdefine(KeyCode.KEY_7, '7');\n\tdefine(KeyCode.KEY_8, '8');\n\tdefine(KeyCode.KEY_9, '9');\n\n\tdefine(KeyCode.KEY_A, 'A');\n\tdefine(KeyCode.KEY_B, 'B');\n\tdefine(KeyCode.KEY_C, 'C');\n\tdefine(KeyCode.KEY_D, 'D');\n\tdefine(KeyCode.KEY_E, 'E');\n\tdefine(KeyCode.KEY_F, 'F');\n\tdefine(KeyCode.KEY_G, 'G');\n\tdefine(KeyCode.KEY_H, 'H');\n\tdefine(KeyCode.KEY_I, 'I');\n\tdefine(KeyCode.KEY_J, 'J');\n\tdefine(KeyCode.KEY_K, 'K');\n\tdefine(KeyCode.KEY_L, 'L');\n\tdefine(KeyCode.KEY_M, 'M');\n\tdefine(KeyCode.KEY_N, 'N');\n\tdefine(KeyCode.KEY_O, 'O');\n\tdefine(KeyCode.KEY_P, 'P');\n\tdefine(KeyCode.KEY_Q, 'Q');\n\tdefine(KeyCode.KEY_R, 'R');\n\tdefine(KeyCode.KEY_S, 'S');\n\tdefine(KeyCode.KEY_T, 'T');\n\tdefine(KeyCode.KEY_U, 'U');\n\tdefine(KeyCode.KEY_V, 'V');\n\tdefine(KeyCode.KEY_W, 'W');\n\tdefine(KeyCode.KEY_X, 'X');\n\tdefine(KeyCode.KEY_Y, 'Y');\n\tdefine(KeyCode.KEY_Z, 'Z');\n\n\tdefine(KeyCode.Meta, 'Meta');\n\tdefine(KeyCode.ContextMenu, 'ContextMenu');\n\n\tdefine(KeyCode.F1, 'F1');\n\tdefine(KeyCode.F2, 'F2');\n\tdefine(KeyCode.F3, 'F3');\n\tdefine(KeyCode.F4, 'F4');\n\tdefine(KeyCode.F5, 'F5');\n\tdefine(KeyCode.F6, 'F6');\n\tdefine(KeyCode.F7, 'F7');\n\tdefine(KeyCode.F8, 'F8');\n\tdefine(KeyCode.F9, 'F9');\n\tdefine(KeyCode.F10, 'F10');\n\tdefine(KeyCode.F11, 'F11');\n\tdefine(KeyCode.F12, 'F12');\n\tdefine(KeyCode.F13, 'F13');\n\tdefine(KeyCode.F14, 'F14');\n\tdefine(KeyCode.F15, 'F15');\n\tdefine(KeyCode.F16, 'F16');\n\tdefine(KeyCode.F17, 'F17');\n\tdefine(KeyCode.F18, 'F18');\n\tdefine(KeyCode.F19, 'F19');\n\n\tdefine(KeyCode.NumLock, 'NumLock');\n\tdefine(KeyCode.ScrollLock, 'ScrollLock');\n\n\tdefine(KeyCode.US_SEMICOLON, ';', ';', 'OEM_1');\n\tdefine(KeyCode.US_EQUAL, '=', '=', 'OEM_PLUS');\n\tdefine(KeyCode.US_COMMA, ',', ',', 'OEM_COMMA');\n\tdefine(KeyCode.US_MINUS, '-', '-', 'OEM_MINUS');\n\tdefine(KeyCode.US_DOT, '.', '.', 'OEM_PERIOD');\n\tdefine(KeyCode.US_SLASH, '/', '/', 'OEM_2');\n\tdefine(KeyCode.US_BACKTICK, '`', '`', 'OEM_3');\n\tdefine(KeyCode.ABNT_C1, 'ABNT_C1');\n\tdefine(KeyCode.ABNT_C2, 'ABNT_C2');\n\tdefine(KeyCode.US_OPEN_SQUARE_BRACKET, '[', '[', 'OEM_4');\n\tdefine(KeyCode.US_BACKSLASH, '\\\\', '\\\\', 'OEM_5');\n\tdefine(KeyCode.US_CLOSE_SQUARE_BRACKET, ']', ']', 'OEM_6');\n\tdefine(KeyCode.US_QUOTE, '\\'', '\\'', 'OEM_7');\n\tdefine(KeyCode.OEM_8, 'OEM_8');\n\tdefine(KeyCode.OEM_102, 'OEM_102');\n\n\tdefine(KeyCode.NUMPAD_0, 'NumPad0');\n\tdefine(KeyCode.NUMPAD_1, 'NumPad1');\n\tdefine(KeyCode.NUMPAD_2, 'NumPad2');\n\tdefine(KeyCode.NUMPAD_3, 'NumPad3');\n\tdefine(KeyCode.NUMPAD_4, 'NumPad4');\n\tdefine(KeyCode.NUMPAD_5, 'NumPad5');\n\tdefine(KeyCode.NUMPAD_6, 'NumPad6');\n\tdefine(KeyCode.NUMPAD_7, 'NumPad7');\n\tdefine(KeyCode.NUMPAD_8, 'NumPad8');\n\tdefine(KeyCode.NUMPAD_9, 'NumPad9');\n\n\tdefine(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply');\n\tdefine(KeyCode.NUMPAD_ADD, 'NumPad_Add');\n\tdefine(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator');\n\tdefine(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract');\n\tdefine(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal');\n\tdefine(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide');\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\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 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\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 class SimpleKeybinding {\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\tpublic equals(other: ChordKeybinding | null): boolean {\n\t\tif (other === null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.parts.length !== other.parts.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0; i < this.parts.length; i++) {\n\t\t\tif (!this.parts[i].equals(other.parts[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\nexport type Keybinding = ChordKeybinding;\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\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\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 */\n\tpublic abstract getDispatchParts(): (string | null)[];\n}\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><any>thing).dispose === 'function'\n\t\t&& (<IDisposable><any>thing).dispose.length === 0;\n}\n\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(...disposables: Array<T | undefined>): T[];\nexport function dispose<T extends IDisposable>(disposables: T[]): T[];\nexport function dispose<T extends IDisposable>(first: T | T[], ...rest: T[]): T | T[] | undefined {\n\tif (Array.isArray(first)) {\n\t\tfirst.forEach(d => d && d.dispose());\n\t\treturn [];\n\t} else if (rest.length === 0) {\n\t\tif (first) {\n\t\t\tfirst.dispose();\n\t\t\treturn first;\n\t\t}\n\t\treturn undefined;\n\t} else {\n\t\tdispose(first);\n\t\tdispose(rest);\n\t\treturn [];\n\t}\n}\n\nexport function combinedDisposable(disposables: IDisposable[]): IDisposable {\n\treturn { dispose: () => dispose(disposables) };\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n\treturn { dispose() { fn(); } };\n}\n\nexport abstract class Disposable implements IDisposable {\n\n\tstatic None = Object.freeze<IDisposable>({ dispose() { } });\n\n\tprotected _toDispose: IDisposable[] = [];\n\n\tprivate _lifecycle_disposable_isDisposed = false;\n\n\tpublic dispose(): void {\n\t\tthis._lifecycle_disposable_isDisposed = true;\n\t\tthis._toDispose = dispose(this._toDispose);\n\t}\n\n\tprotected _register<T extends IDisposable>(t: T): T {\n\t\tif (this._lifecycle_disposable_isDisposed) {\n\t\t\tconsole.warn('Registering disposable on object that has already been disposed.');\n\t\t\tt.dispose();\n\t\t} else {\n\t\t\tthis._toDispose.push(t);\n\t\t}\n\n\t\treturn t;\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\nimport { Iterator, IteratorResult, FIN } from 'vs/base/common/iterator';\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\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\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\titerator(): Iterator<E> {\n\t\tlet element: { done: false; value: E; };\n\t\tlet node = this._first;\n\t\treturn {\n\t\t\tnext(): IteratorResult<E> {\n\t\t\t\tif (node === Node.Undefined) {\n\t\t\t\t\treturn FIN;\n\t\t\t\t}\n\n\t\t\t\tif (!element) {\n\t\t\t\t\telement = { done: false, value: node.element };\n\t\t\t\t} else {\n\t\t\t\t\telement.value = node.element;\n\t\t\t\t}\n\t\t\t\tnode = node.next;\n\t\t\t\treturn element;\n\t\t\t}\n\t\t};\n\t}\n\n\ttoArray(): E[] {\n\t\tconst result: E[] = [];\n\t\tfor (let node = this._first; node !== Node.Undefined; node = node.next) {\n\t\t\tresult.push(node.element);\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { once as onceFn } from 'vs/base/common/functional';\nimport { combinedDisposable, Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { LinkedList } from 'vs/base/common/linkedList';\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[]): IDisposable;\n}\n\nexport namespace Event {\n\tconst _disposable = { dispose() { } };\n\texport const None: Event<any> = function () { return _disposable; };\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 * Given an event and a `map` function, returns another event which maps each element\n\t * throught the mapping function.\n\t */\n\texport function map<I, O>(event: Event<I>, map: (i: I) => O): Event<O> {\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables));\n\t}\n\n\t/**\n\t * Given an event and an `each` function, returns another identical event and calls\n\t * the `each` function per each element.\n\t */\n\texport function forEach<I>(event: Event<I>, each: (i: I) => void): Event<I> {\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables));\n\t}\n\n\t/**\n\t * Given an event and a `filter` function, returns another event which emits those\n\t * elements for which the `filter` function returns `true`.\n\t */\n\texport function filter<T>(event: Event<T>, filter: (e: T) => boolean): Event<T>;\n\texport function filter<T, R>(event: Event<T | R>, filter: (e: T | R) => e is R): Event<R>;\n\texport function filter<T>(event: Event<T>, filter: (e: T) => boolean): Event<T> {\n\t\treturn snapshot((listener, thisArgs = null, disposables?) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables));\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\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 * Given an event and a `merge` function, returns another event which maps each element\n\t * and the cummulative result throught the `merge` function. Similar to `map`, but with memory.\n\t */\n\texport function reduce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, initial?: O): 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});\n\t}\n\n\t/**\n\t * Given a chain of event processing functions (filter, map, etc), each\n\t * function will be invoked per event & per listener. Snapshotting an event\n\t * chain allows each function to be invoked just once per event.\n\t */\n\texport function snapshot<T>(event: Event<T>): Event<T> {\n\t\tlet listener: IDisposable;\n\t\tconst emitter = new Emitter<T>({\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\treturn emitter.event;\n\t}\n\n\t/**\n\t * Debounces the provided event, given a `merge` function.\n\t *\n\t * @param event The input event.\n\t * @param merge The reducing function.\n\t * @param delay The debouncing delay in millis.\n\t * @param leading Whether the event should fire in the leading phase of the timeout.\n\t * @param leakWarningThreshold The leak warning threshold override.\n\t */\n\texport function debounce<T>(event: Event<T>, merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number): Event<T>;\n\texport function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number, leading?: boolean, leakWarningThreshold?: number): Event<O>;\n\texport function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay: number = 100, leading = false, leakWarningThreshold?: number): 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 emitter = new Emitter<O>({\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}\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\treturn emitter.event;\n\t}\n\n\t/**\n\t * Given an event, it returns another event which fires only once and as soon as\n\t * the input event emits. The event data is the number of millis it took for the\n\t * event to fire.\n\t */\n\texport function stopwatch<T>(event: Event<T>): Event<number> {\n\t\tconst start = new Date().getTime();\n\t\treturn map(once(event), _ => new Date().getTime() - start);\n\t}\n\n\t/**\n\t * Given an event, it returns another event which fires only when the event\n\t * element changes.\n\t */\n\texport function latch<T>(event: Event<T>): 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 || value !== cache;\n\t\t\tfirstCall = false;\n\t\t\tcache = value;\n\t\t\treturn shouldEmit;\n\t\t});\n\t}\n\n\t/**\n\t * Buffers the provided event until a first listener comes\n\t * along, at which point fire all the events at once and\n\t * pipe the event from then on.\n\t *\n\t * ```typescript\n\t * const emitter = new Emitter<number>();\n\t * const event = emitter.event;\n\t * const bufferedEvent = buffer(event);\n\t *\n\t * emitter.fire(1);\n\t * emitter.fire(2);\n\t * emitter.fire(3);\n\t * // nothing...\n\t *\n\t * const listener = bufferedEvent(num => console.log(num));\n\t * // 1, 2, 3\n\t *\n\t * emitter.fire(4);\n\t * // 4\n\t * ```\n\t */\n\texport function buffer<T>(event: Event<T>, nextTick = 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 (nextTick) {\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\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\treduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R>;\n\t\tlatch(): IChainableEvent<T>;\n\t\ton(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): 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\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\ton(listener: (e: T) => any, thisArgs: any, disposables: IDisposable[]) {\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\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): this;\n\t\tremoveListener(event: string | symbol, listener: Function): this;\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 function fromPromise<T = any>(promise: Promise<T>): Event<undefined> {\n\t\tconst emitter = new Emitter<undefined>();\n\t\tlet shouldEmit = false;\n\n\t\tpromise\n\t\t\t.then(undefined, () => null)\n\t\t\t.then(() => {\n\t\t\t\tif (!shouldEmit) {\n\t\t\t\t\tsetTimeout(() => emitter.fire(undefined), 0);\n\t\t\t\t} else {\n\t\t\t\t\temitter.fire(undefined);\n\t\t\t\t}\n\t\t\t});\n\n\t\tshouldEmit = true;\n\t\treturn emitter.event;\n\t}\n\n\texport function toPromise<T>(event: Event<T>): Promise<T> {\n\t\treturn new Promise(c => once(event)(c));\n\t}\n}\n\ntype Listener<T> = [(e: T) => void, any] | ((e: T) => void);\n\nexport interface EmitterOptions {\n\tonFirstListenerAdd?: Function;\n\tonFirstListenerDidAdd?: Function;\n\tonListenerDidAdd?: Function;\n\tonLastListenerRemove?: Function;\n\tleakWarningThreshold?: number;\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(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 stack = new Error().stack!.split('\\n').slice(3).join('\\n');\n\t\tconst count = (this._stacks.get(stack) || 0);\n\t\tthis._stacks.set(stack, 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;\n\t\t\tlet topCount: number = 0;\n\t\t\tthis._stacks.forEach((count, stack) => {\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) || 0);\n\t\t\tthis._stacks!.set(stack, count - 1);\n\t\t};\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 _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 static readonly _noop = function () { };\n\n\tprivate readonly _options?: EmitterOptions;\n\tprivate readonly _leakageMon?: LeakageMonitor;\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\n\t\t\t? new LeakageMonitor(this._options && this._options.leakWarningThreshold)\n\t\t\t: undefined;\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 = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]) => {\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 && this._options.onFirstListenerAdd) {\n\t\t\t\t\tthis._options.onFirstListenerAdd(this);\n\t\t\t\t}\n\n\t\t\t\tconst remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\n\n\t\t\t\tif (firstListener && this._options && 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 && this._options.onListenerDidAdd) {\n\t\t\t\t\tthis._options.onListenerDidAdd(this, listener, thisArgs);\n\t\t\t\t}\n\n\t\t\t\t// check and record this emitter for potential leakage\n\t\t\t\tlet removeMonitor: (() => void) | undefined;\n\t\t\t\tif (this._leakageMon) {\n\t\t\t\t\tremoveMonitor = this._leakageMon.check(this._listeners.size);\n\t\t\t\t}\n\n\t\t\t\tlet result: IDisposable;\n\t\t\t\tresult = {\n\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\tif (removeMonitor) {\n\t\t\t\t\t\t\tremoveMonitor();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.dispose = Emitter._noop;\n\t\t\t\t\t\tif (!this._disposed) {\n\t\t\t\t\t\t\tremove();\n\t\t\t\t\t\t\tif (this._options && this._options.onLastListenerRemove) {\n\t\t\t\t\t\t\t\tconst hasListeners = (this._listeners && !this._listeners.isEmpty());\n\t\t\t\t\t\t\t\tif (!hasListeners) {\n\t\t\t\t\t\t\t\t\tthis._options.onLastListenerRemove(this);\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\tif (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 iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n\t\t\t\tthis._deliveryQueue.push([e.value, event]);\n\t\t\t}\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\tif (typeof listener === 'function') {\n\t\t\t\t\t\tlistener.call(undefined, event);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlistener[0].call(listener[1], event);\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tonUnexpectedError(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose() {\n\t\tif (this._listeners) {\n\t\t\tthis._listeners.clear();\n\t\t}\n\t\tif (this._deliveryQueue) {\n\t\t\tthis._deliveryQueue.clear();\n\t\t}\n\t\tif (this._leakageMon) {\n\t\t\tthis._leakageMon.dispose();\n\t\t}\n\t\tthis._disposed = true;\n\t}\n}\n\nexport class PauseableEmitter<T> extends Emitter<T> {\n\n\tprivate _isPaused = 0;\n\tprivate _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 && 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 = this._eventQueue.toArray();\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\tfire(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 EventMultiplexer<T> implements IDisposable {\n\n\tprivate readonly emitter: Emitter<T>;\n\tprivate hasListeners = false;\n\tprivate events: { event: Event<T>; listener: IDisposable | null; }[] = [];\n\n\tconstructor() {\n\t\tthis.emitter = new Emitter<T>({\n\t\t\tonFirstListenerAdd: () => this.onFirstListenerAdd(),\n\t\t\tonLastListenerRemove: () => this.onLastListenerRemove()\n\t\t});\n\t}\n\n\tget event(): Event<T> {\n\t\treturn this.emitter.event;\n\t}\n\n\tadd(event: Event<T>): IDisposable {\n\t\tconst e = { event: event, listener: null };\n\t\tthis.events.push(e);\n\n\t\tif (this.hasListeners) {\n\t\t\tthis.hook(e);\n\t\t}\n\n\t\tconst dispose = () => {\n\t\t\tif (this.hasListeners) {\n\t\t\t\tthis.unhook(e);\n\t\t\t}\n\n\t\t\tconst idx = this.events.indexOf(e);\n\t\t\tthis.events.splice(idx, 1);\n\t\t};\n\n\t\treturn toDisposable(onceFn(dispose));\n\t}\n\n\tprivate onFirstListenerAdd(): void {\n\t\tthis.hasListeners = true;\n\t\tthis.events.forEach(e => this.hook(e));\n\t}\n\n\tprivate onLastListenerRemove(): void {\n\t\tthis.hasListeners = false;\n\t\tthis.events.forEach(e => this.unhook(e));\n\t}\n\n\tprivate hook(e: { event: Event<T>; listener: IDisposable | null; }): void {\n\t\te.listener = e.event(r => this.emitter.fire(r));\n\t}\n\n\tprivate unhook(e: { event: Event<T>; listener: IDisposable | null; }): void {\n\t\tif (e.listener) {\n\t\t\te.listener.dispose();\n\t\t}\n\t\te.listener = null;\n\t}\n\n\tdispose(): void {\n\t\tthis.emitter.dispose();\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 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 { IDisposable } from 'vs/base/common/lifecycle';\n\nclass WindowManager {\n\n\tpublic static readonly INSTANCE = new WindowManager();\n\n\t// --- Zoom Level\n\tprivate _zoomLevel: number = 0;\n\tprivate _lastZoomLevelChangeTime: number = 0;\n\tprivate readonly _onDidChangeZoomLevel = new Emitter<number>();\n\n\tpublic readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;\n\tpublic getZoomLevel(): number {\n\t\treturn this._zoomLevel;\n\t}\n\tpublic getTimeSinceLastZoomLevelChanged(): number {\n\t\treturn Date.now() - this._lastZoomLevelChangeTime;\n\t}\n\n\t// --- Pixel Ratio\n\tpublic getPixelRatio(): number {\n\t\tlet ctx = document.createElement('canvas').getContext('2d');\n\t\tlet dpr = window.devicePixelRatio || 1;\n\t\tlet bsr = (<any>ctx).webkitBackingStorePixelRatio ||\n\t\t\t(<any>ctx).mozBackingStorePixelRatio ||\n\t\t\t(<any>ctx).msBackingStorePixelRatio ||\n\t\t\t(<any>ctx).oBackingStorePixelRatio ||\n\t\t\t(<any>ctx).backingStorePixelRatio || 1;\n\t\treturn dpr / bsr;\n\t}\n}\nexport function getZoomLevel(): number {\n\treturn WindowManager.INSTANCE.getZoomLevel();\n}\n/** Returns the time (in ms) since the zoom level was changed */\nexport function getTimeSinceLastZoomLevelChanged(): number {\n\treturn WindowManager.INSTANCE.getTimeSinceLastZoomLevelChanged();\n}\nexport function onDidChangeZoomLevel(callback: (zoomLevel: number) => void): IDisposable {\n\treturn WindowManager.INSTANCE.onDidChangeZoomLevel(callback);\n}\n\nexport function getPixelRatio(): number {\n\treturn WindowManager.INSTANCE.getPixelRatio();\n}\n\nconst userAgent = navigator.userAgent;\n\nexport const isIE = (userAgent.indexOf('Trident') >= 0);\nexport const isEdge = (userAgent.indexOf('Edge/') >= 0);\nexport const isEdgeOrIE = isIE || isEdge;\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 isIPad = (userAgent.indexOf('iPad') >= 0);\nexport const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0);\n\nexport function hasClipboardSupport() {\n\tif (isIE) {\n\t\treturn false;\n\t}\n\n\tif (isEdge) {\n\t\tlet index = userAgent.indexOf('Edge/');\n\t\tlet version = parseInt(userAgent.substring(index + 5, userAgent.indexOf('.', index)), 10);\n\n\t\tif (!version || (version >= 12 && version <= 16)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\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 { Event as BaseEvent, Emitter } from 'vs/base/common/event';\n\nexport type EventHandler = HTMLElement | HTMLDocument | Window;\n\nexport interface IDomEvent {\n\t<K extends keyof HTMLElementEventMap>(element: EventHandler, type: K, useCapture?: boolean): BaseEvent<HTMLElementEventMap[K]>;\n\t(element: EventHandler, type: string, useCapture?: boolean): BaseEvent<any>;\n}\n\nexport const domEvent: IDomEvent = (element: EventHandler, type: string, useCapture?: boolean) => {\n\tconst fn = (e: Event) => emitter.fire(e);\n\tconst emitter = new Emitter<Event>({\n\t\tonFirstListenerAdd: () => {\n\t\t\telement.addEventListener(type, fn, useCapture);\n\t\t},\n\t\tonLastListenerRemove: () => {\n\t\t\telement.removeEventListener(type, fn, useCapture);\n\t\t}\n\t});\n\n\treturn emitter.event;\n};\n\nexport interface CancellableEvent {\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport function stop<T extends CancellableEvent>(event: BaseEvent<T>): BaseEvent<T> {\n\treturn BaseEvent.map(event, e => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\treturn e;\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 { ICollapseStateChangeEvent, ITreeElement, ITreeFilter, ITreeFilterDataResult, ITreeModel, ITreeNode, TreeVisibility, ITreeModelSpliceEvent } from 'vs/base/browser/ui/tree/tree';\nimport { tail2 } from 'vs/base/common/arrays';\nimport { Emitter, Event, EventBufferer } from 'vs/base/common/event';\nimport { ISequence, Iterator } from 'vs/base/common/iterator';\nimport { ISpliceable } from 'vs/base/common/sequence';\n\ninterface IMutableTreeNode<T, TFilterData> extends ITreeNode<T, TFilterData> {\n\treadonly parent: IMutableTreeNode<T, TFilterData> | undefined;\n\treadonly children: IMutableTreeNode<T, TFilterData>[];\n\tvisibleChildrenCount: number;\n\tvisibleChildIndex: number;\n\tcollapsible: boolean;\n\tcollapsed: boolean;\n\trenderNodeCount: number;\n\tvisible: boolean;\n\tfilterData: TFilterData | undefined;\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\nfunction treeNodeToElement<T>(node: IMutableTreeNode<T, any>): ITreeElement<T> {\n\tconst { element, collapsed } = node;\n\tconst children = Iterator.map(Iterator.fromArray(node.children), treeNodeToElement);\n\n\treturn { element, children, collapsed };\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 class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = void> implements ITreeModel<T, TFilterData, number[]> {\n\n\treadonly rootRef = [];\n\n\tprivate root: IMutableTreeNode<T, TFilterData>;\n\tprivate eventBufferer = new EventBufferer();\n\n\tprivate _onDidChangeCollapseState = new Emitter<ICollapseStateChangeEvent<T, TFilterData>>();\n\treadonly onDidChangeCollapseState: Event<ICollapseStateChangeEvent<T, TFilterData>> = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event);\n\n\tprivate _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 _onDidSplice = new Emitter<ITreeModelSpliceEvent<T, TFilterData>>();\n\treadonly onDidSplice = this._onDidSplice.event;\n\n\tconstructor(private list: ISpliceable<ITreeNode<T, TFilterData>>, rootElement: T, options: IIndexTreeModelOptions<T, TFilterData> = {}) {\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\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?: ISequence<ITreeElement<T>>,\n\t\tonDidCreateNode?: (node: ITreeNode<T, TFilterData>) => void,\n\t\tonDidDeleteNode?: (node: ITreeNode<T, TFilterData>) => void\n\t): Iterator<ITreeElement<T>> {\n\t\tif (location.length === 0) {\n\t\t\tthrow new Error('Invalid tree location');\n\t\t}\n\n\t\tconst { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location);\n\t\tconst treeListElementsToInsert: ITreeNode<T, TFilterData>[] = [];\n\t\tconst nodesToInsertIterator = Iterator.map(Iterator.from(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\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: IMutableTreeNode<T, TFilterData>[] = [];\n\t\tlet insertedVisibleChildrenCount = 0;\n\t\tlet renderNodeCount = 0;\n\n\t\tIterator.forEach(nodesToInsertIterator, child => {\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 = parentNode.children.splice(lastIndex, deleteCount, ...nodesToInsert);\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.renderNodeCount, 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\tconst result = Iterator.map(Iterator.fromArray(deletedNodes), treeNodeToElement);\n\t\tthis._onDidSplice.fire({ insertedNodes: nodesToInsert, deletedNodes });\n\t\treturn result;\n\t}\n\n\trerender(location: number[]): void {\n\t\tif (location.length === 0) {\n\t\t\tthrow new Error('Invalid tree location');\n\t\t}\n\n\t\tconst { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location);\n\n\t\tif (revealed) {\n\t\t\tthis.list.splice(listIndex, 1, [node]);\n\t\t}\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\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\treturn this.eventBufferer.bufferEvents(() => this._setCollapsed(location, collapsed!, recursive));\n\t}\n\n\tprivate _setCollapsed(location: number[], collapsed: boolean, recursive?: boolean): boolean {\n\t\tconst { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location);\n\n\t\tconst result = this._setListNodeCollapsed(node, listIndex, revealed, collapsed!, recursive || false);\n\n\t\tif (this.autoExpandSingleChildren && !collapsed! && !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._setCollapsed([...location, onlyVisibleChildIndex], false, false);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _setListNodeCollapsed(node: IMutableTreeNode<T, TFilterData>, listIndex: number, revealed: boolean, collapsed: boolean, recursive: boolean): boolean {\n\t\tconst result = this._setNodeCollapsed(node, collapsed, recursive, false);\n\n\t\tif (!revealed || !node.visible) {\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 _setNodeCollapsed(node: IMutableTreeNode<T, TFilterData>, collapsed: boolean, recursive: boolean, deep: boolean): boolean {\n\t\tlet result = node.collapsible && node.collapsed !== collapsed;\n\n\t\tif (node.collapsible) {\n\t\t\tnode.collapsed = collapsed;\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 (recursive) {\n\t\t\tfor (const child of node.children) {\n\t\t\t\tresult = this._setNodeCollapsed(child, collapsed, true, 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._setCollapsed(location, 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}\n\n\tprivate createTreeNode(\n\t\ttreeElement: ITreeElement<T>,\n\t\tparent: IMutableTreeNode<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): IMutableTreeNode<T, TFilterData> {\n\t\tconst node: IMutableTreeNode<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\tvisible: true,\n\t\t\tfilterData: undefined\n\t\t};\n\n\t\tconst visibility = this._filterNode(node, parentVisibility);\n\n\t\tif (revealed) {\n\t\t\ttreeListElements.push(node);\n\t\t}\n\n\t\tconst childElements = Iterator.from(treeElement.children);\n\t\tconst childRevealed = revealed && visibility !== TreeVisibility.Hidden && !node.collapsed;\n\t\tconst childNodes = Iterator.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\tIterator.forEach(childNodes, child => {\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: IMutableTreeNode<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: IMutableTreeNode<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: IMutableTreeNode<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: IMutableTreeNode<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\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}\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: IMutableTreeNode<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: IMutableTreeNode<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 getTreeNode(location: number[], node: IMutableTreeNode<T, TFilterData> = this.root): IMutableTreeNode<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 Error('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: IMutableTreeNode<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 Error('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: IMutableTreeNode<T, TFilterData> = this.root, listIndex: number = 0, revealed = true, visible = true): { parentNode: IMutableTreeNode<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 Error('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\n\t\twhile (node.parent) {\n\t\t\tlocation.push(node.parent.children.indexOf(node));\n\t\t\tnode = node.parent;\n\t\t}\n\n\t\treturn location.reverse();\n\t}\n\n\tgetParentNodeLocation(location: number[]): number[] {\n\t\tif (location.length <= 1) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn tail2(location)[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 { ISpliceable } from 'vs/base/common/sequence';\nimport { Iterator, ISequence, getSequenceIterator } from 'vs/base/common/iterator';\nimport { IndexTreeModel, IIndexTreeModelOptions } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { Event } from 'vs/base/common/event';\nimport { ITreeModel, ITreeNode, ITreeElement, ITreeSorter, ICollapseStateChangeEvent, ITreeModelSpliceEvent } from 'vs/base/browser/ui/tree/tree';\n\nexport interface IObjectTreeModelOptions<T, TFilterData> extends IIndexTreeModelOptions<T, TFilterData> {\n\treadonly sorter?: ITreeSorter<T>;\n}\n\nexport class ObjectTreeModel<T extends NonNullable<any>, TFilterData extends NonNullable<any> = void> implements ITreeModel<T | null, TFilterData, T | null> {\n\n\tprivate model: IndexTreeModel<T | null, TFilterData>;\n\tprivate nodes = new Map<T | null, ITreeNode<T, TFilterData>>();\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(list: ISpliceable<ITreeNode<T, TFilterData>>, options: IObjectTreeModelOptions<T, TFilterData> = {}) {\n\t\tthis.model = new IndexTreeModel(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\t}\n\n\tsetChildren(\n\t\telement: T | null,\n\t\tchildren: ISequence<ITreeElement<T>> | undefined,\n\t\tonDidCreateNode?: (node: ITreeNode<T, TFilterData>) => void,\n\t\tonDidDeleteNode?: (node: ITreeNode<T, TFilterData>) => void\n\t): Iterator<ITreeElement<T | null>> {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this._setChildren(location, this.preserveCollapseState(children), onDidCreateNode, onDidDeleteNode);\n\t}\n\n\tprivate _setChildren(\n\t\tlocation: number[],\n\t\tchildren: ISequence<ITreeElement<T>> | undefined,\n\t\tonDidCreateNode?: (node: ITreeNode<T, TFilterData>) => void,\n\t\tonDidDeleteNode?: (node: ITreeNode<T, TFilterData>) => void\n\t): Iterator<ITreeElement<T | null>> {\n\t\tconst insertedElements = new Set<T | null>();\n\n\t\tconst _onDidCreateNode = (node: ITreeNode<T, TFilterData>) => {\n\t\t\tinsertedElements.add(node.element);\n\t\t\tthis.nodes.set(node.element, node);\n\n\t\t\tif (onDidCreateNode) {\n\t\t\t\tonDidCreateNode(node);\n\t\t\t}\n\t\t};\n\n\t\tconst _onDidDeleteNode = (node: ITreeNode<T, TFilterData>) => {\n\t\t\tif (!insertedElements.has(node.element)) {\n\t\t\t\tthis.nodes.delete(node.element);\n\t\t\t}\n\n\t\t\tif (onDidDeleteNode) {\n\t\t\t\tonDidDeleteNode(node);\n\t\t\t}\n\t\t};\n\n\t\treturn this.model.splice(\n\t\t\t[...location, 0],\n\t\t\tNumber.MAX_VALUE,\n\t\t\tchildren,\n\t\t\t_onDidCreateNode,\n\t\t\t_onDidDeleteNode\n\t\t);\n\t}\n\n\tprivate preserveCollapseState(elements: ISequence<ITreeElement<T>> | undefined): ISequence<ITreeElement<T>> {\n\t\tlet iterator = elements ? getSequenceIterator(elements) : Iterator.empty<ITreeElement<T>>();\n\n\t\tif (this.sorter) {\n\t\t\titerator = Iterator.fromArray(Iterator.collect(iterator).sort(this.sorter.compare.bind(this.sorter)));\n\t\t}\n\n\t\treturn Iterator.map(iterator, treeElement => {\n\t\t\tconst node = this.nodes.get(treeElement.element);\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): void {\n\t\tconst location = this.getElementLocation(element);\n\t\tthis.model.rerender(location);\n\t}\n\n\tgetListIndex(element: T): number {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.getListIndex(location);\n\t}\n\n\tgetListRenderCount(element: T): number {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.getListRenderCount(location);\n\t}\n\n\tisCollapsed(element: T): boolean {\n\t\tconst location = this.getElementLocation(element);\n\t\treturn this.model.isCollapsed(location);\n\t}\n\n\tsetCollapsed(element: T, 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): 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 Error(`Tree element not found: ${element}`);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tgetNodeLocation(node: ITreeNode<T, TFilterData>): T {\n\t\treturn node.element;\n\t}\n\n\tgetParentNodeLocation(element: T): T | null {\n\t\tconst node = this.nodes.get(element);\n\n\t\tif (!node) {\n\t\t\tthrow new Error(`Tree element not found: ${element}`);\n\t\t}\n\n\t\treturn node.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 Error(`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 { IDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport { Event, Emitter } from 'vs/base/common/event';\n\nexport interface ITelemetryData {\n\t[key: string]: any;\n}\n\nexport interface IAction extends IDisposable {\n\tid: string;\n\tlabel: string;\n\ttooltip: string;\n\tclass: string | undefined;\n\tenabled: boolean;\n\tchecked: boolean;\n\trun(event?: any): Promise<any>;\n}\n\nexport interface IActionRunner extends IDisposable {\n\trun(action: IAction, context?: any): Promise<any>;\n\tonDidRun: Event<IRunEvent>;\n\tonDidBeforeRun: Event<IRunEvent>;\n}\n\nexport interface IActionChangeEvent {\n\tlabel?: string;\n\ttooltip?: string;\n\tclass?: string;\n\tenabled?: boolean;\n\tchecked?: boolean;\n\tradio?: boolean;\n}\n\nexport class Action implements IAction {\n\n\tprotected _onDidChange = new Emitter<IActionChangeEvent>();\n\treadonly onDidChange: Event<IActionChangeEvent> = this._onDidChange.event;\n\n\tprotected _id: string;\n\tprotected _label: string;\n\tprotected _tooltip: string;\n\tprotected _cssClass: string | undefined;\n\tprotected _enabled: boolean;\n\tprotected _checked: boolean;\n\tprotected _radio: boolean;\n\tprotected _actionCallback?: (event?: any) => Promise<any>;\n\n\tconstructor(id: string, label: string = '', cssClass: string = '', enabled: boolean = true, actionCallback?: (event?: any) => Promise<any>) {\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\tprotected _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 {\n\t\treturn this._checked;\n\t}\n\n\tset checked(value: boolean) {\n\t\tthis._setChecked(value);\n\t}\n\n\tget radio(): boolean {\n\t\treturn this._radio;\n\t}\n\n\tset radio(value: boolean) {\n\t\tthis._setRadio(value);\n\t}\n\n\tprotected _setChecked(value: boolean): 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\tprotected _setRadio(value: boolean): void {\n\t\tif (this._radio !== value) {\n\t\t\tthis._radio = value;\n\t\t\tthis._onDidChange.fire({ radio: value });\n\t\t}\n\t}\n\n\trun(event?: any, _data?: ITelemetryData): Promise<any> {\n\t\tif (this._actionCallback) {\n\t\t\treturn this._actionCallback(event);\n\t\t}\n\n\t\treturn Promise.resolve(true);\n\t}\n\n\tdispose() {\n\t\tthis._onDidChange.dispose();\n\t}\n}\n\nexport interface IRunEvent {\n\taction: IAction;\n\tresult?: any;\n\terror?: any;\n}\n\nexport class ActionRunner extends Disposable implements IActionRunner {\n\n\tprivate _onDidBeforeRun = this._register(new Emitter<IRunEvent>());\n\treadonly onDidBeforeRun: Event<IRunEvent> = this._onDidBeforeRun.event;\n\n\tprivate _onDidRun = this._register(new Emitter<IRunEvent>());\n\treadonly onDidRun: Event<IRunEvent> = this._onDidRun.event;\n\n\trun(action: IAction, context?: any): Promise<any> {\n\t\tif (!action.enabled) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\tthis._onDidBeforeRun.fire({ action: action });\n\n\t\treturn this.runAction(action, context).then((result: any) => {\n\t\t\tthis._onDidRun.fire({ action: action, result: result });\n\t\t}, (error: any) => {\n\t\t\tthis._onDidRun.fire({ action: action, error: error });\n\t\t});\n\t}\n\n\tprotected runAction(action: IAction, context?: any): Promise<any> {\n\t\tconst res = context ? action.run(context) : action.run();\n\t\treturn Promise.resolve(res);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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\treadonly isCancellationRequested: boolean;\n\t/**\n\t * An event emitted when cancellation is requested\n\t * @event\n\t */\n\treadonly onCancellationRequested: Event<any>;\n}\n\nconst shortcutEvent = Object.freeze(function (callback, context?): IDisposable {\n\tconst handle = setTimeout(callback.bind(context), 0);\n\treturn { dispose() { clearTimeout(handle); } };\n} as Event<any>);\n\nexport namespace CancellationToken {\n\n\texport function isCancellationToken(thing: any): 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(): void {\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 * as errors from 'vs/base/common/errors';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\n\nexport function isThenable<T>(obj: any): obj is Promise<T> {\n\treturn obj && typeof (<Promise<any>>obj).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\tsource.token.onCancellationRequested(() => {\n\t\t\treject(errors.canceled());\n\t\t});\n\t\tPromise.resolve(thenable).then(value => {\n\t\t\tsource.dispose();\n\t\t\tresolve(value);\n\t\t}, err => {\n\t\t\tsource.dispose();\n\t\t\treject(err);\n\t\t});\n\t});\n\n\treturn new class implements CancelablePromise<T> {\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\nexport interface ITask<T> {\n\t(): T;\n}\n\n/**\n * A helper to delay 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 timeout: any;\n\tprivate completionPromise: Promise<any> | null;\n\tprivate doResolve: ((value?: any | Promise<any>) => void) | null;\n\tprivate doReject?: (err: any) => void;\n\tprivate task: ITask<T | Promise<T>> | null;\n\n\tconstructor(public defaultDelay: number) {\n\t\tthis.timeout = null;\n\t\tthis.completionPromise = null;\n\t\tthis.doResolve = null;\n\t\tthis.task = null;\n\t}\n\n\ttrigger(task: ITask<T | Promise<T>>, delay: number = 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((c, e) => {\n\t\t\t\tthis.doResolve = c;\n\t\t\t\tthis.doReject = e;\n\t\t\t}).then(() => {\n\t\t\t\tthis.completionPromise = null;\n\t\t\t\tthis.doResolve = null;\n\t\t\t\tconst task = this.task!;\n\t\t\t\tthis.task = null;\n\n\t\t\t\treturn task();\n\t\t\t});\n\t\t}\n\n\t\tthis.timeout = setTimeout(() => {\n\t\t\tthis.timeout = null;\n\t\t\tthis.doResolve!(null);\n\t\t}, delay);\n\n\t\treturn this.completionPromise;\n\t}\n\n\tisTriggered(): boolean {\n\t\treturn this.timeout !== null;\n\t}\n\n\tcancel(): void {\n\t\tthis.cancelTimeout();\n\n\t\tif (this.completionPromise) {\n\t\t\tthis.doReject!(errors.canceled());\n\t\t\tthis.completionPromise = null;\n\t\t}\n\t}\n\n\tprivate cancelTimeout(): void {\n\t\tif (this.timeout !== null) {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.timeout = null;\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.cancelTimeout();\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(resolve, millis);\n\t\ttoken.onCancellationRequested(() => {\n\t\t\tclearTimeout(handle);\n\t\t\treject(errors.canceled());\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 extends Disposable {\n\tprivate _token: any;\n\n\tconstructor();\n\tconstructor(runner: () => void, timeout: number);\n\tconstructor(runner?: () => void, timeout?: number) {\n\t\tsuper();\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\tsuper.dispose();\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 extends Disposable {\n\n\tprivate _token: any;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._token = -1;\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel();\n\t\tsuper.dispose();\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: any[]) => void) | null;\n\n\tprivate timeoutToken: any;\n\tprivate timeout: number;\n\tprivate timeoutHandler: () => void;\n\n\tconstructor(runner: (...args: any[]) => void, timeout: number) {\n\t\tthis.timeoutToken = -1;\n\t\tthis.runner = runner;\n\t\tthis.timeout = timeout;\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\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}\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\tconst dummyIdle: IdleDeadline = Object.freeze({\n\t\t\tdidTimeout: true,\n\t\t\ttimeRemaining() { return 15; }\n\t\t});\n\t\trunWhenIdle = (runner) => {\n\t\t\tconst handle = setTimeout(() => runner(dummyIdle));\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\tclearTimeout(handle);\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: any;\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\tgetValue(): 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 * Copyright (c) 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 _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._shouldBeVisible = false;\n\t\tthis._revealTimer = this._register(new TimeoutTimer());\n\t}\n\n\t// ----------------- Hide / Reveal\n\n\tprivate applyVisibilitySetting(shouldBeVisible: boolean): 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 shouldBeVisible;\n\t}\n\n\tpublic setShouldBeVisible(rawShouldBeVisible: boolean): void {\n\t\tlet shouldBeVisible = this.applyVisibilitySetting(rawShouldBeVisible);\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 * Copyright (c) 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 { CharCode } from 'vs/base/common/charCode';\n\nexport function values<V = any>(set: Set<V>): V[];\nexport function values<K = any, V = any>(map: Map<K, V>): V[];\nexport function values<V>(forEachable: { forEach(callback: (value: V, ...more: any[]) => any): void }): V[] {\n\tconst result: V[] = [];\n\tforEachable.forEach(value => result.push(value));\n\treturn result;\n}\n\nexport function keys<K, V>(map: Map<K, V>): K[] {\n\tconst result: K[] = [];\n\tmap.forEach((value, key) => result.push(key));\n\n\treturn result;\n}\n\nexport interface IKeyIterator {\n\treset(key: string): this;\n\tnext(): this;\n\n\thasNext(): boolean;\n\tcmp(a: string): number;\n\tvalue(): string;\n}\n\nexport class StringIterator implements IKeyIterator {\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 PathIterator implements IKeyIterator {\n\n\tprivate _value: string;\n\tprivate _from: number;\n\tprivate _to: number;\n\n\treset(key: string): this {\n\t\tthis._value = key.replace(/\\\\$|\\/$/, '');\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.Slash || 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\n\t\tlet aPos = 0;\n\t\tconst aLen = a.length;\n\t\tlet thisPos = this._from;\n\n\t\twhile (aPos < aLen && thisPos < this._to) {\n\t\t\tconst cmp = a.charCodeAt(aPos) - this._value.charCodeAt(thisPos);\n\t\t\tif (cmp !== 0) {\n\t\t\t\treturn cmp;\n\t\t\t}\n\t\t\taPos += 1;\n\t\t\tthisPos += 1;\n\t\t}\n\n\t\tif (aLen === this._to - this._from) {\n\t\t\treturn 0;\n\t\t} else if (aPos < aLen) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tvalue(): string {\n\t\treturn this._value.substring(this._from, this._to);\n\t}\n}\n\nclass TernarySearchTreeNode<E> {\n\tsegment: string;\n\tvalue: E | undefined;\n\tkey: string;\n\tleft: TernarySearchTreeNode<E> | undefined;\n\tmid: TernarySearchTreeNode<E> | undefined;\n\tright: TernarySearchTreeNode<E> | undefined;\n}\n\nexport class TernarySearchTree<E> {\n\n\tstatic forPaths<E>(): TernarySearchTree<E> {\n\t\treturn new TernarySearchTree<E>(new PathIterator());\n\t}\n\n\tstatic forStrings<E>(): TernarySearchTree<E> {\n\t\treturn new TernarySearchTree<E>(new StringIterator());\n\t}\n\n\tprivate _iter: IKeyIterator;\n\tprivate _root: TernarySearchTreeNode<E> | undefined;\n\n\tconstructor(segments: IKeyIterator) {\n\t\tthis._iter = segments;\n\t}\n\n\tclear(): void {\n\t\tthis._root = undefined;\n\t}\n\n\tset(key: string, element: E): E | undefined {\n\t\tconst iter = this._iter.reset(key);\n\t\tlet node: TernarySearchTreeNode<E>;\n\n\t\tif (!this._root) {\n\t\t\tthis._root = new TernarySearchTreeNode<E>();\n\t\t\tthis._root.segment = iter.value();\n\t\t}\n\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<E>();\n\t\t\t\t\tnode.left.segment = iter.value();\n\t\t\t\t}\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<E>();\n\t\t\t\t\tnode.right.segment = iter.value();\n\t\t\t\t}\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<E>();\n\t\t\t\t\tnode.mid.segment = iter.value();\n\t\t\t\t}\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\tconst oldElement = node.value;\n\t\tnode.value = element;\n\t\tnode.key = key;\n\t\treturn oldElement;\n\t}\n\n\tget(key: string): E | 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\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn node ? node.value : undefined;\n\t}\n\n\tfindSubstr(key: string): E | undefined {\n\t\tconst iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\tlet candidate: E | 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\tforEach(callback: (value: E, index: string) => any) {\n\t\tthis._forEach(this._root, callback);\n\t}\n\n\tprivate _forEach(node: TernarySearchTreeNode<E> | undefined, callback: (value: E, index: string) => any) {\n\t\tif (node) {\n\t\t\t// left\n\t\t\tthis._forEach(node.left, callback);\n\n\t\t\t// node\n\t\t\tif (node.value) {\n\t\t\t\t// callback(node.value, this._iter.join(parts));\n\t\t\t\tcallback(node.value, node.key);\n\t\t\t}\n\t\t\t// mid\n\t\t\tthis._forEach(node.mid, callback);\n\n\t\t\t// right\n\t\t\tthis._forEach(node.right, callback);\n\t\t}\n\t}\n}\n\nexport class ResourceMap<T> {\n\n\tprotected readonly map: Map<string, T>;\n\tprotected readonly ignoreCase?: boolean;\n\n\tconstructor() {\n\t\tthis.map = new Map<string, T>();\n\t\tthis.ignoreCase = false; // in the future this should be an uri-comparator\n\t}\n\n\tset(resource: URI, value: T): void {\n\t\tthis.map.set(this.toKey(resource), value);\n\t}\n\n\tget(resource: URI): T | undefined {\n\t\treturn this.map.get(this.toKey(resource));\n\t}\n\n\tprivate toKey(resource: URI): string {\n\t\tlet key = resource.toString();\n\t\tif (this.ignoreCase) {\n\t\t\tkey = key.toLowerCase();\n\t\t}\n\n\t\treturn key;\n\t}\n}\n\n// We should fold BoundedMap and LinkedMap. See https://github.com/Microsoft/vscode/issues/28496\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> {\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\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}\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}\n\n\tget size(): number {\n\t\treturn this._size;\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): void {\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}\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\tforEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void {\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\tcurrent = current.next;\n\t\t}\n\t}\n\n\t/* VS Code / Monaco editor runs on es5 which has no Symbol.iterator\n\tkeys(): IterableIterator<K> {\n\t\tconst 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 (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 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 (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\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}\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}\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}\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 happend if size === 1 which is handle\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 happend if size === 1 which is handle\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}\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} 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}\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\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(key: K): V | undefined {\n\t\treturn super.get(key, Touch.AsNew);\n\t}\n\n\tset(key: K, value: V): void {\n\t\tsuper.set(key, value, Touch.AsNew);\n\t\tthis.checkTrim();\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 * marked - a markdown parser\n * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n// BEGIN MONACOCHANGE\nvar __marked_exports;\n// END MONACOCHANGE\n\n;(function(root) {\n'use strict';\n\n/**\n * Block-Level Grammar\n */\n\nvar block = {\n newline: /^\\n+/,\n code: /^( {4}[^\\n]+\\n*)+/,\n fences: noop,\n hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)/,\n heading: /^ *(#{1,6}) *([^\\n]+?) *(?:#+ *)?(?:\\n+|$)/,\n nptable: noop,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3})(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?!\\1bull )\\n*|\\s*$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style)[\\\\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{2,}|$)' // (6)\n + '|<(?!script|pre|style)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (7) open tag\n + '|</(?!script|pre|style)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:\\\\n{2,}|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *\\n? *<?([^\\s>]+)>?(?:(?: +\\n? *| *\\n *)(title))? *(?:\\n+|$)/,\n table: noop,\n lheading: /^([^\\n]+)\\n *(=|-){2,} *(?:\\n+|$)/,\n paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading| {0,3}>|<\\/?(?:tag)(?: +|\\n|\\/?>)|<(?:script|pre|style|!--))[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\[\\[\\]]|[^\\[\\]])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}\\.)/;\nblock.item = /^( *)(bull) ?[^\\n]*(?:\\n(?!\\1bull ?)[^\\n]*)*/;\nblock.item = edit(block.item, 'gm')\n .replace(/bull/g, block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?-->/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block.paragraph)\n .replace('hr', block.hr)\n .replace('heading', block.heading)\n .replace('lheading', block.lheading)\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = merge({}, block);\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = merge({}, block.normal, {\n fences: /^ {0,3}(`{3,}|~{3,})([^`\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~`]* *(?:\\n+|$)|$)/,\n paragraph: /^/,\n heading: /^ *(#{1,6}) +([^\\n]+?) *#* *(?:\\n+|$)/\n});\n\nblock.gfm.paragraph = edit(block.paragraph)\n .replace('(?!', '(?!'\n + block.gfm.fences.source.replace('\\\\1', '\\\\2') + '|'\n + block.list.source.replace('\\\\1', '\\\\3') + '|')\n .getRegex();\n\n/**\n * GFM + Tables Block Grammar\n */\n\nblock.tables = merge({}, block.gfm, {\n nptable: /^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:.*[^>\\n ].*(?:\\n|$))*)\\n*|$)/,\n table: /^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n((?: *[^>\\n ].*(?:\\n|$))*)\\n*|$)/\n});\n\n/**\n * Pedantic grammar\n */\n\nblock.pedantic = merge({}, block.normal, {\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/\n});\n\n/**\n * Block Lexer\n */\n\nfunction Lexer(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || marked.defaults;\n this.rules = block.normal;\n\n if (this.options.pedantic) {\n this.rules = block.pedantic;\n } else if (this.options.gfm) {\n if (this.options.tables) {\n this.rules = block.tables;\n } else {\n this.rules = block.gfm;\n }\n }\n}\n\n/**\n * Expose Block Rules\n */\n\nLexer.rules = block;\n\n/**\n * Static Lex Method\n */\n\nLexer.lex = function(src, options) {\n var lexer = new Lexer(options);\n return lexer.lex(src);\n};\n\n/**\n * Preprocessing\n */\n\nLexer.prototype.lex = function(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n')\n .replace(/\\t/g, ' ')\n .replace(/\\u00a0/g, ' ')\n .replace(/\\u2424/g, '\\n');\n\n return this.token(src, true);\n};\n\n/**\n * Lexing\n */\n\nLexer.prototype.token = function(src, top) {\n src = src.replace(/^ +$/gm, '');\n var next,\n loose,\n cap,\n bull,\n b,\n item,\n listStart,\n listItems,\n t,\n space,\n i,\n tag,\n l,\n isordered,\n istask,\n ischecked;\n\n while (src) {\n // newline\n if (cap = this.rules.newline.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[0].length > 1) {\n this.tokens.push({\n type: 'space'\n });\n }\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n src = src.substring(cap[0].length);\n cap = cap[0].replace(/^ {4}/gm, '');\n this.tokens.push({\n type: 'code',\n text: !this.options.pedantic\n ? rtrim(cap, '\\n')\n : cap\n });\n continue;\n }\n\n // fences (gfm)\n if (cap = this.rules.fences.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'code',\n lang: cap[2] ? cap[2].trim() : cap[2],\n text: cap[3] || ''\n });\n continue;\n }\n\n // heading\n if (cap = this.rules.heading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[1].length,\n text: cap[2]\n });\n continue;\n }\n\n // table no leading pipe (gfm)\n if (cap = this.rules.nptable.exec(src)) {\n item = {\n type: 'table',\n header: splitCells(cap[1].replace(/^ *| *\\| *$/g, '')),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n src = src.substring(cap[0].length);\n\n for (i = 0; i < item.align.length; 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 for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = splitCells(item.cells[i], item.header.length);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n }\n\n // hr\n if (cap = this.rules.hr.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'hr'\n });\n continue;\n }\n\n // blockquote\n if (cap = this.rules.blockquote.exec(src)) {\n src = src.substring(cap[0].length);\n\n this.tokens.push({\n type: 'blockquote_start'\n });\n\n cap = cap[0].replace(/^ *> ?/gm, '');\n\n // Pass `top` to keep the current\n // \"toplevel\" state. This is exactly\n // how markdown.pl works.\n this.token(cap, top);\n\n this.tokens.push({\n type: 'blockquote_end'\n });\n\n continue;\n }\n\n // list\n if (cap = this.rules.list.exec(src)) {\n src = src.substring(cap[0].length);\n bull = cap[2];\n isordered = bull.length > 1;\n\n listStart = {\n type: 'list_start',\n ordered: isordered,\n start: isordered ? +bull : '',\n loose: false\n };\n\n this.tokens.push(listStart);\n\n // Get each top-level item.\n cap = cap[0].match(this.rules.item);\n\n listItems = [];\n next = false;\n l = cap.length;\n i = 0;\n\n for (; i < l; i++) {\n item = cap[i];\n\n // Remove the list item's bullet\n // so it is seen as the next token.\n space = item.length;\n item = item.replace(/^ *([*+-]|\\d+\\.) */, '');\n\n // Outdent whatever the\n // list item contains. Hacky.\n if (~item.indexOf('\\n ')) {\n space -= item.length;\n item = !this.options.pedantic\n ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')\n : item.replace(/^ {1,4}/gm, '');\n }\n\n // Determine whether the next list item belongs here.\n // Backpedal if it does not belong in this list.\n if (i !== l - 1) {\n b = block.bullet.exec(cap[i + 1])[0];\n if (bull.length > 1 ? b.length === 1\n : (b.length > 1 || (this.options.smartLists && b !== bull))) {\n src = cap.slice(i + 1).join('\\n') + src;\n i = l - 1;\n }\n }\n\n // Determine whether item is loose or not.\n // Use: /(^|\\n)(?! )[^\\n]+\\n\\n(?!\\s*$)/\n // for discount behavior.\n loose = next || /\\n\\n(?!\\s*$)/.test(item);\n if (i !== l - 1) {\n next = item.charAt(item.length - 1) === '\\n';\n if (!loose) loose = next;\n }\n\n if (loose) {\n listStart.loose = true;\n }\n\n // Check for task list items\n istask = /^\\[[ xX]\\] /.test(item);\n ischecked = undefined;\n if (istask) {\n ischecked = item[1] !== ' ';\n item = item.replace(/^\\[[ xX]\\] +/, '');\n }\n\n t = {\n type: 'list_item_start',\n task: istask,\n checked: ischecked,\n loose: loose\n };\n\n listItems.push(t);\n this.tokens.push(t);\n\n // Recurse.\n this.token(item, false);\n\n this.tokens.push({\n type: 'list_item_end'\n });\n }\n\n if (listStart.loose) {\n l = listItems.length;\n i = 0;\n for (; i < l; i++) {\n listItems[i].loose = true;\n }\n }\n\n this.tokens.push({\n type: 'list_end'\n });\n\n continue;\n }\n\n // html\n if (cap = this.rules.html.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: this.options.sanitize\n ? 'paragraph'\n : 'html',\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n });\n continue;\n }\n\n // def\n if (top && (cap = this.rules.def.exec(src))) {\n src = src.substring(cap[0].length);\n if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);\n tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n if (!this.tokens.links[tag]) {\n this.tokens.links[tag] = {\n href: cap[2],\n title: cap[3]\n };\n }\n continue;\n }\n\n // table (gfm)\n if (cap = this.rules.table.exec(src)) {\n item = {\n type: 'table',\n header: splitCells(cap[1].replace(/^ *| *\\| *$/g, '')),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n cells: cap[3] ? cap[3].replace(/\\n$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n src = src.substring(cap[0].length);\n\n for (i = 0; i < item.align.length; 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 for (i = 0; i < item.cells.length; i++) {\n item.cells[i] = splitCells(\n item.cells[i].replace(/^ *\\| *| *\\| *$/g, ''),\n item.header.length);\n }\n\n this.tokens.push(item);\n\n continue;\n }\n }\n\n // lheading\n if (cap = this.rules.lheading.exec(src)) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'heading',\n depth: cap[2] === '=' ? 1 : 2,\n text: cap[1]\n });\n continue;\n }\n\n // top-level paragraph\n if (top && (cap = this.rules.paragraph.exec(src))) {\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'paragraph',\n text: cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1]\n });\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n // Top-level should never reach here.\n src = src.substring(cap[0].length);\n this.tokens.push({\n type: 'text',\n text: cap[0]\n });\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return this.tokens;\n};\n\n/**\n * Inline-Level Grammar\n */\n\nvar inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noop,\n tag: '^comment'\n + '|^</[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]*?\\\\]\\\\]>', // CDATA section\n link: /^!?\\[(label)\\]\\(href(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(?!\\s*\\])((?:\\\\[\\[\\]]?|[^\\[\\]\\\\])+)\\]/,\n nolink: /^!?\\[(?!\\s*\\])((?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]|[^\\[\\]])*)\\](?:\\[\\])?/,\n strong: /^__([^\\s_])__(?!_)|^\\*\\*([^\\s*])\\*\\*(?!\\*)|^__([^\\s][\\s\\S]*?[^\\s])__(?!_)|^\\*\\*([^\\s][\\s\\S]*?[^\\s])\\*\\*(?!\\*)/,\n em: /^_([^\\s_])_(?!_)|^\\*([^\\s*\"<\\[])\\*(?!\\*)|^_([^\\s][\\s\\S]*?[^\\s_])_(?!_|[^\\spunctuation])|^_([^\\s_][\\s\\S]*?[^\\s])_(?!_|[^\\spunctuation])|^\\*([^\\s\"<\\[][\\s\\S]*?[^\\s*])\\*(?!\\*)|^\\*([^\\s*\"<\\[][\\s\\S]*?[^\\s])\\*(?!\\*)/,\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noop,\n text: /^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\<!\\[`*]|\\b_|$)|[^ ](?= {2,}\\n))|(?= {2,}\\n))/\n};\n\n// list of punctuation marks from common mark spec\n// without ` and ] to workaround Rule 17 (inline code blocks/links)\ninline._punctuation = '!\"#$%&\\'()*+,\\\\-./:;<=>?@\\\\[^_{|}~';\ninline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._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])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', block._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[[^\\[\\]]*\\]|\\\\[\\[\\]]?|`[^`]*`|`(?!`)|[^\\[\\]\\\\`])*?/;\ninline._href = /\\s*(<(?:\\\\[<>]?|[^\\s<>\\\\])*>|[^\\s\\x00-\\x1f]*)/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = merge({}, inline);\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = merge({}, inline.normal, {\n strong: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n em: /^_(?=\\S)([\\s\\S]*?\\S)_(?!_)|^\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)/,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n});\n\n/**\n * GFM Inline Grammar\n */\n\ninline.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)~+/,\n text: /^(`+|[^`])(?:[\\s\\S]*?(?:(?=[\\\\<!\\[`*~]|\\b_|https?:\\/\\/|ftp:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))|(?= {2,}\\n|[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))/\n});\n\ninline.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = merge({}, inline.gfm, {\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text).replace(/\\{2,\\}/g, '*').getRegex()\n});\n\n/**\n * Inline Lexer & Compiler\n */\n\nfunction InlineLexer(links, options) {\n this.options = options || marked.defaults;\n this.links = links;\n this.rules = inline.normal;\n this.renderer = this.options.renderer || new Renderer();\n this.renderer.options = this.options;\n\n if (!this.links) {\n throw new Error('Tokens array requires a `links` property.');\n }\n\n if (this.options.pedantic) {\n this.rules = inline.pedantic;\n } else if (this.options.gfm) {\n if (this.options.breaks) {\n this.rules = inline.breaks;\n } else {\n this.rules = inline.gfm;\n }\n }\n}\n\n/**\n * Expose Inline Rules\n */\n\nInlineLexer.rules = inline;\n\n/**\n * Static Lexing/Compiling Method\n */\n\nInlineLexer.output = function(src, links, options) {\n var inline = new InlineLexer(links, options);\n return inline.output(src);\n};\n\n/**\n * Lexing/Compiling\n */\n\nInlineLexer.prototype.output = function(src) {\n var out = '',\n link,\n text,\n href,\n title,\n cap,\n prevCapZero;\n\n while (src) {\n // escape\n if (cap = this.rules.escape.exec(src)) {\n src = src.substring(cap[0].length);\n out += escape(cap[1]);\n continue;\n }\n\n // tag\n if (cap = this.rules.tag.exec(src)) {\n if (!this.inLink && /^<a /i.test(cap[0])) {\n this.inLink = true;\n } else if (this.inLink && /^<\\/a>/i.test(cap[0])) {\n this.inLink = false;\n }\n if (!this.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.inRawBlock = true;\n } else if (this.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.inRawBlock = false;\n }\n\n src = src.substring(cap[0].length);\n out += this.options.sanitize\n ? this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0])\n : cap[0];\n continue;\n }\n\n // link\n if (cap = this.rules.link.exec(src)) {\n var lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n src = src.substring(cap[0].length);\n this.inLink = true;\n href = cap[2];\n if (this.options.pedantic) {\n link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n } else {\n title = '';\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n href = href.trim().replace(/^<([\\s\\S]*)>$/, '$1');\n out += this.outputLink(cap, {\n href: InlineLexer.escapes(href),\n title: InlineLexer.escapes(title)\n });\n this.inLink = false;\n continue;\n }\n\n // reflink, nolink\n if ((cap = this.rules.reflink.exec(src))\n || (cap = this.rules.nolink.exec(src))) {\n src = src.substring(cap[0].length);\n link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = this.links[link.toLowerCase()];\n if (!link || !link.href) {\n out += cap[0].charAt(0);\n src = cap[0].substring(1) + src;\n continue;\n }\n this.inLink = true;\n out += this.outputLink(cap, link);\n this.inLink = false;\n continue;\n }\n\n // strong\n if (cap = this.rules.strong.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));\n continue;\n }\n\n // em\n if (cap = this.rules.em.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));\n continue;\n }\n\n // code\n if (cap = this.rules.code.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.codespan(escape(cap[2].trim(), true));\n continue;\n }\n\n // br\n if (cap = this.rules.br.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.br();\n continue;\n }\n\n // del (gfm)\n if (cap = this.rules.del.exec(src)) {\n src = src.substring(cap[0].length);\n out += this.renderer.del(this.output(cap[1]));\n continue;\n }\n\n // autolink\n if (cap = this.rules.autolink.exec(src)) {\n src = src.substring(cap[0].length);\n if (cap[2] === '@') {\n text = escape(this.mangle(cap[1]));\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // url (gfm)\n if (!this.inLink && (cap = this.rules.url.exec(src))) {\n if (cap[2] === '@') {\n text = escape(cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + text;\n } else {\n href = text;\n }\n }\n src = src.substring(cap[0].length);\n out += this.renderer.link(href, null, text);\n continue;\n }\n\n // text\n if (cap = this.rules.text.exec(src)) {\n src = src.substring(cap[0].length);\n if (this.inRawBlock) {\n out += this.renderer.text(cap[0]);\n } else {\n out += this.renderer.text(escape(this.smartypants(cap[0])));\n }\n continue;\n }\n\n if (src) {\n throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));\n }\n }\n\n return out;\n};\n\nInlineLexer.escapes = function(text) {\n return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;\n};\n\n/**\n * Compile Link\n */\n\nInlineLexer.prototype.outputLink = function(cap, link) {\n var href = link.href,\n title = link.title ? escape(link.title) : null;\n\n return cap[0].charAt(0) !== '!'\n ? this.renderer.link(href, title, this.output(cap[1]))\n : this.renderer.image(href, title, escape(cap[1]));\n};\n\n/**\n * Smartypants Transformations\n */\n\nInlineLexer.prototype.smartypants = function(text) {\n if (!this.options.smartypants) return text;\n return text\n // em-dashes\n .replace(/---/g, '\\u2014')\n // en-dashes\n .replace(/--/g, '\\u2013')\n // opening singles\n .replace(/(^|[-\\u2014/(\\[{\"\\s])'/g, '$1\\u2018')\n // closing singles & apostrophes\n .replace(/'/g, '\\u2019')\n // opening doubles\n .replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g, '$1\\u201c')\n // closing doubles\n .replace(/\"/g, '\\u201d')\n // ellipses\n .replace(/\\.{3}/g, '\\u2026');\n};\n\n/**\n * Mangle Links\n */\n\nInlineLexer.prototype.mangle = function(text) {\n if (!this.options.mangle) return text;\n var out = '',\n l = text.length,\n i = 0,\n ch;\n\n for (; i < l; i++) {\n ch = text.charCodeAt(i);\n if (Math.random() > 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n};\n\n/**\n * Renderer\n */\n\nfunction Renderer(options) {\n this.options = options || marked.defaults;\n}\n\nRenderer.prototype.code = function(code, infostring, escaped) {\n var lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n var out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n if (!lang) {\n return '<pre><code>'\n + (escaped ? code : escape(code, true))\n + '</code></pre>';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang, true)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n};\n\nRenderer.prototype.blockquote = function(quote) {\n return '<blockquote>\\n' + quote + '</blockquote>\\n';\n};\n\nRenderer.prototype.html = function(html) {\n return html;\n};\n\nRenderer.prototype.heading = function(text, level, raw, slugger) {\n if (this.options.headerIds) {\n return '<h'\n + level\n + ' id=\"'\n + this.options.headerPrefix\n + slugger.slug(raw)\n + '\">'\n + text\n + '</h'\n + level\n + '>\\n';\n }\n // ignore IDs\n return '<h' + level + '>' + text + '</h' + level + '>\\n';\n};\n\nRenderer.prototype.hr = function() {\n return this.options.xhtml ? '<hr/>\\n' : '<hr>\\n';\n};\n\nRenderer.prototype.list = function(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\nRenderer.prototype.listitem = function(text) {\n return '<li>' + text + '</li>\\n';\n};\n\nRenderer.prototype.checkbox = function(checked) {\n return '<input '\n + (checked ? 'checked=\"\" ' : '')\n + 'disabled=\"\" type=\"checkbox\"'\n + (this.options.xhtml ? ' /' : '')\n + '> ';\n};\n\nRenderer.prototype.paragraph = function(text) {\n return '<p>' + text + '</p>\\n';\n};\n\nRenderer.prototype.table = function(header, body) {\n if (body) body = '<tbody>' + body + '</tbody>';\n\n return '<table>\\n'\n + '<thead>\\n'\n + header\n + '</thead>\\n'\n + body\n + '</table>\\n';\n};\n\nRenderer.prototype.tablerow = function(content) {\n return '<tr>\\n' + content + '</tr>\\n';\n};\n\nRenderer.prototype.tablecell = function(content, flags) {\n var type = flags.header ? 'th' : 'td';\n var tag = flags.align\n ? '<' + type + ' align=\"' + flags.align + '\">'\n : '<' + type + '>';\n return tag + content + '</' + type + '>\\n';\n};\n\n// span level renderer\nRenderer.prototype.strong = function(text) {\n return '<strong>' + text + '</strong>';\n};\n\nRenderer.prototype.em = function(text) {\n return '<em>' + text + '</em>';\n};\n\nRenderer.prototype.codespan = function(text) {\n return '<code>' + text + '</code>';\n};\n\nRenderer.prototype.br = function() {\n return this.options.xhtml ? '<br/>' : '<br>';\n};\n\nRenderer.prototype.del = function(text) {\n return '<del>' + text + '</del>';\n};\n\nRenderer.prototype.link = function(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n var out = '<a href=\"' + escape(href) + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n};\n\nRenderer.prototype.image = function(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n var out = '<img src=\"' + href + '\" alt=\"' + text + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += this.options.xhtml ? '/>' : '>';\n return out;\n};\n\nRenderer.prototype.text = function(text) {\n return text;\n};\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\n\nfunction TextRenderer() {}\n\n// no need for block level renderers\n\nTextRenderer.prototype.strong =\nTextRenderer.prototype.em =\nTextRenderer.prototype.codespan =\nTextRenderer.prototype.del =\nTextRenderer.prototype.text = function (text) {\n return text;\n};\n\nTextRenderer.prototype.link =\nTextRenderer.prototype.image = function(href, title, text) {\n return '' + text;\n};\n\nTextRenderer.prototype.br = function() {\n return '';\n};\n\n/**\n * Parsing & Compiling\n */\n\nfunction Parser(options) {\n this.tokens = [];\n this.token = null;\n this.options = options || marked.defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.slugger = new Slugger();\n}\n\n/**\n * Static Parse Method\n */\n\nParser.parse = function(src, options) {\n var parser = new Parser(options);\n return parser.parse(src);\n};\n\n/**\n * Parse Loop\n */\n\nParser.prototype.parse = function(src) {\n this.inline = new InlineLexer(src.links, this.options);\n // use an InlineLexer with a TextRenderer to extract pure text\n this.inlineText = new InlineLexer(\n src.links,\n merge({}, this.options, {renderer: new TextRenderer()})\n );\n this.tokens = src.reverse();\n\n var out = '';\n while (this.next()) {\n out += this.tok();\n }\n\n return out;\n};\n\n/**\n * Next Token\n */\n\nParser.prototype.next = function() {\n return this.token = this.tokens.pop();\n};\n\n/**\n * Preview Next Token\n */\n\nParser.prototype.peek = function() {\n return this.tokens[this.tokens.length - 1] || 0;\n};\n\n/**\n * Parse Text Tokens\n */\n\nParser.prototype.parseText = function() {\n var body = this.token.text;\n\n while (this.peek().type === 'text') {\n body += '\\n' + this.next().text;\n }\n\n return this.inline.output(body);\n};\n\n/**\n * Parse Current Token\n */\n\nParser.prototype.tok = function() {\n switch (this.token.type) {\n case 'space': {\n return '';\n }\n case 'hr': {\n return this.renderer.hr();\n }\n case 'heading': {\n return this.renderer.heading(\n this.inline.output(this.token.text),\n this.token.depth,\n unescape(this.inlineText.output(this.token.text)),\n this.slugger);\n }\n case 'code': {\n return this.renderer.code(this.token.text,\n this.token.lang,\n this.token.escaped);\n }\n case 'table': {\n var header = '',\n body = '',\n i,\n row,\n cell,\n j;\n\n // header\n cell = '';\n for (i = 0; i < this.token.header.length; i++) {\n cell += this.renderer.tablecell(\n this.inline.output(this.token.header[i]),\n { header: true, align: this.token.align[i] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n for (i = 0; i < this.token.cells.length; i++) {\n row = this.token.cells[i];\n\n cell = '';\n for (j = 0; j < row.length; j++) {\n cell += this.renderer.tablecell(\n this.inline.output(row[j]),\n { header: false, align: this.token.align[j] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n return this.renderer.table(header, body);\n }\n case 'blockquote_start': {\n body = '';\n\n while (this.next().type !== 'blockquote_end') {\n body += this.tok();\n }\n\n return this.renderer.blockquote(body);\n }\n case 'list_start': {\n body = '';\n var ordered = this.token.ordered,\n start = this.token.start;\n\n while (this.next().type !== 'list_end') {\n body += this.tok();\n }\n\n return this.renderer.list(body, ordered, start);\n }\n case 'list_item_start': {\n body = '';\n var loose = this.token.loose;\n var checked = this.token.checked;\n var task = this.token.task;\n\n if (this.token.task) {\n body += this.renderer.checkbox(checked);\n }\n\n while (this.next().type !== 'list_item_end') {\n body += !loose && this.token.type === 'text'\n ? this.parseText()\n : this.tok();\n }\n return this.renderer.listitem(body, task, checked);\n }\n case 'html': {\n // TODO parse inline content if parameter markdown=1\n return this.renderer.html(this.token.text);\n }\n case 'paragraph': {\n return this.renderer.paragraph(this.inline.output(this.token.text));\n }\n case 'text': {\n return this.renderer.paragraph(this.parseText());\n }\n default: {\n var errMsg = 'Token with \"' + this.token.type + '\" type was not found.';\n if (this.options.silent) {\n console.log(errMsg);\n } else {\n throw new Error(errMsg);\n }\n }\n }\n};\n\n/**\n * Slugger generates header id\n */\n\nfunction Slugger () {\n this.seen = {};\n}\n\n/**\n * Convert string to unique id\n */\n\nSlugger.prototype.slug = function (value) {\n var slug = value\n .toLowerCase()\n .trim()\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n\n if (this.seen.hasOwnProperty(slug)) {\n var originalSlug = slug;\n do {\n this.seen[originalSlug]++;\n slug = originalSlug + '-' + this.seen[originalSlug];\n } while (this.seen.hasOwnProperty(slug));\n }\n this.seen[slug] = 0;\n\n return slug;\n};\n\n/**\n * Helpers\n */\n\nfunction escape(html, encode) {\n if (encode) {\n if (escape.escapeTest.test(html)) {\n return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; });\n }\n } else {\n if (escape.escapeTestNoEncode.test(html)) {\n return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; });\n }\n }\n\n return html;\n}\n\nescape.escapeTest = /[&<>\"']/;\nescape.escapeReplace = /[&<>\"']/g;\nescape.replacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\nescape.escapeTestNoEncode = /[<>\"']|&(?!#?\\w+;)/;\nescape.escapeReplaceNoEncode = /[<>\"']|&(?!#?\\w+;)/g;\n\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(/&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig, function(_, n) {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nfunction edit(regex, opt) {\n regex = regex.source || regex;\n opt = opt || '';\n return {\n replace: function(name, val) {\n val = val.source || val;\n val = val.replace(/(^|[^\\[])\\^/g, '$1');\n regex = regex.replace(name, val);\n return this;\n },\n getRegex: function() {\n return new RegExp(regex, opt);\n }\n };\n}\n\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n try {\n var prot = decodeURIComponent(unescape(href))\n .replace(/[^\\w:]/g, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nfunction 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 (/^[^:]+:\\/*[^/]*$/.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n\n if (href.slice(0, 2) === '//') {\n return base.replace(/:[\\s\\S]*/, ':') + href;\n } else if (href.charAt(0) === '/') {\n return base.replace(/(:\\/*[^/]*)[\\s\\S]*/, '$1') + href;\n } else {\n return base + href;\n }\n}\nvar baseUrls = {};\nvar originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\nfunction noop() {}\nnoop.exec = noop;\n\nfunction merge(obj) {\n var i = 1,\n target,\n key;\n\n for (; i < arguments.length; i++) {\n target = arguments[i];\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\nfunction 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 while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\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 i = 0;\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\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 return cells;\n}\n\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.\nfunction rtrim(str, c, invert) {\n if (str.length === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n var suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < str.length) {\n var currChar = str.charAt(str.length - suffLen - 1);\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, str.length - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n var level = 0;\n for (var i = 0; i < str.length; 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 if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\n/**\n * Marked\n */\n\nfunction 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 if (typeof src !== 'string') {\n throw new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected');\n }\n\n if (callback || typeof opt === 'function') {\n if (!callback) {\n callback = opt;\n opt = null;\n }\n\n opt = merge({}, marked.defaults, opt || {});\n\n var highlight = opt.highlight,\n tokens,\n pending,\n i = 0;\n\n try {\n tokens = Lexer.lex(src, opt);\n } catch (e) {\n return callback(e);\n }\n\n pending = tokens.length;\n\n var done = function(err) {\n if (err) {\n opt.highlight = highlight;\n return callback(err);\n }\n\n var out;\n\n try {\n out = Parser.parse(tokens, opt);\n } catch (e) {\n err = e;\n }\n\n opt.highlight = highlight;\n\n return err\n ? callback(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!pending) return done();\n\n for (; i < tokens.length; i++) {\n (function(token) {\n if (token.type !== 'code') {\n return --pending || done();\n }\n return highlight(token.text, token.lang, function(err, code) {\n if (err) return done(err);\n if (code == null || code === token.text) {\n return --pending || done();\n }\n token.text = code;\n token.escaped = true;\n --pending || done();\n });\n })(tokens[i]);\n }\n\n return;\n }\n try {\n if (opt) opt = merge({}, marked.defaults, opt);\n return Parser.parse(Lexer.lex(src, opt), opt);\n } catch (e) {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n if ((opt || marked.defaults).silent) {\n return '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n }\n throw e;\n }\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n merge(marked.defaults, opt);\n return marked;\n};\n\nmarked.getDefaults = function () {\n return {\n baseUrl: null,\n breaks: false,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: new Renderer(),\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartLists: false,\n smartypants: false,\n tables: true,\n xhtml: false\n };\n};\n\nmarked.defaults = marked.getDefaults();\n\n/**\n * Expose\n */\n\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\n\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\n\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\n\nmarked.InlineLexer = InlineLexer;\nmarked.inlineLexer = InlineLexer.output;\n\nmarked.Slugger = Slugger;\n\nmarked.parse = marked;\n\n// BEGIN MONACOCHANGE\n// if (typeof module !== 'undefined' && typeof exports === 'object') {\n// module.exports = marked;\n// } else if (typeof define === 'function' && define.amd) {\n// define(function() { return marked; });\n// } else {\n// root.marked = marked;\n// }\n// })(this || (typeof window !== 'undefined' ? window : global));\n__marked_exports = marked;\n}).call(this);\n\n// ESM-comment-begin\ndefine(\"vs/base/common/marked/marked\", function() { return __marked_exports; });\n// ESM-comment-end\n\n// ESM-uncomment-begin\n// export var marked = __marked_exports;\n// export var Parser = __marked_exports.Parser;\n// export var parser = __marked_exports.parser;\n// export var Renderer = __marked_exports.Renderer;\n// export var TextRenderer = __marked_exports.TextRenderer;\n// export var Lexer = __marked_exports.Lexer;\n// export var lexer = __marked_exports.lexer;\n// export var InlineLexer = __marked_exports.InlineLexer;\n// export var inlineLexer = __marked_exports.inlineLexer;\n// export var parse = __marked_exports.parse;\n// ESM-uncomment-end\n// END MONACOCHANGE\n","/*---------------------------------------------------------------------------------------------\n * Copyright (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 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: string = 'inmemory';\n\n\t/**\n\t * A schema that is used for setting files\n\t */\n\texport const vscode: string = 'vscode';\n\n\t/**\n\t * A schema that is used for internal private files\n\t */\n\texport const internal: string = 'private';\n\n\t/**\n\t * A walk-through document.\n\t */\n\texport const walkThrough: string = 'walkThrough';\n\n\t/**\n\t * An embedded code snippet.\n\t */\n\texport const walkThroughSnippet: string = 'walkThroughSnippet';\n\n\texport const http: string = 'http';\n\n\texport const https: string = 'https';\n\n\texport const file: string = 'file';\n\n\texport const mailto: string = 'mailto';\n\n\texport const untitled: string = 'untitled';\n\n\texport const data: string = 'data';\n\n\texport const command: string = 'command';\n\n\texport const vscodeRemote: string = 'vscode-remote';\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (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","/*---------------------------------------------------------------------------------------------\n * Copyright (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 _isNative = false;\nlet _isWeb = false;\nlet _locale: string | undefined = undefined;\nlet _language: string = LANGUAGE_DEFAULT;\nlet _translationsConfigFile: 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;\n}\n\ninterface INodeProcess {\n\tplatform: string;\n\tenv: IProcessEnvironment;\n\tnextTick: Function;\n\tversions?: {\n\t\telectron?: string;\n\t};\n\ttype?: string;\n}\ndeclare const process: INodeProcess;\ndeclare const global: any;\n\ninterface INavigator {\n\tuserAgent: string;\n\tlanguage: string;\n}\ndeclare const navigator: INavigator;\ndeclare const self: any;\n\nconst isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\n\n// OS detection\nif (typeof navigator === 'object' && !isElectronRenderer) {\n\tconst userAgent = navigator.userAgent;\n\t_isWindows = userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = userAgent.indexOf('Macintosh') >= 0;\n\t_isLinux = userAgent.indexOf('Linux') >= 0;\n\t_isWeb = true;\n\t_locale = navigator.language;\n\t_language = _locale;\n} else if (typeof process === 'object') {\n\t_isWindows = (process.platform === 'win32');\n\t_isMacintosh = (process.platform === 'darwin');\n\t_isLinux = (process.platform === 'linux');\n\t_locale = LANGUAGE_DEFAULT;\n\t_language = LANGUAGE_DEFAULT;\n\tconst rawNlsConfig = process.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\nexport const enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isNative) {\n\tif (_isMacintosh) {\n\t\t_platform = Platform.Mac;\n\t} else if (_isWindows) {\n\t\t_platform = Platform.Windows;\n\t} else if (_isLinux) {\n\t\t_platform = Platform.Linux;\n\t}\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isWeb = _isWeb;\n\nconst _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {} as any);\nexport const globals: any = _globals;\n\nlet _setImmediate: ((callback: (...args: any[]) => void) => number) | null = null;\nexport function setImmediate(callback: (...args: any[]) => void): number {\n\tif (_setImmediate === null) {\n\t\tif (globals.setImmediate) {\n\t\t\t_setImmediate = globals.setImmediate.bind(globals);\n\t\t} else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {\n\t\t\t_setImmediate = process.nextTick.bind(process);\n\t\t} else {\n\t\t\t_setImmediate = globals.setTimeout.bind(globals);\n\t\t}\n\t}\n\treturn _setImmediate!(callback);\n}\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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, KeyCodeUtils, KeyMod, SimpleKeybinding } from 'vs/base/common/keyCodes';\nimport * as platform from 'vs/base/common/platform';\n\nlet KEY_CODE_MAP: { [keyCode: number]: KeyCode } = new Array(230);\nlet INVERSE_KEY_CODE_MAP: KeyCode[] = new Array(KeyCode.MAX_VALUE);\n\n(function () {\n\tfor (let i = 0; i < INVERSE_KEY_CODE_MAP.length; i++) {\n\t\tINVERSE_KEY_CODE_MAP[i] = -1;\n\t}\n\n\tfunction define(code: number, keyCode: KeyCode): void {\n\t\tKEY_CODE_MAP[code] = keyCode;\n\t\tINVERSE_KEY_CODE_MAP[keyCode] = code;\n\t}\n\n\tdefine(3, KeyCode.PauseBreak); // VK_CANCEL 0x03 Control-break processing\n\tdefine(8, KeyCode.Backspace);\n\tdefine(9, KeyCode.Tab);\n\tdefine(13, KeyCode.Enter);\n\tdefine(16, KeyCode.Shift);\n\tdefine(17, KeyCode.Ctrl);\n\tdefine(18, KeyCode.Alt);\n\tdefine(19, KeyCode.PauseBreak);\n\tdefine(20, KeyCode.CapsLock);\n\tdefine(27, KeyCode.Escape);\n\tdefine(32, KeyCode.Space);\n\tdefine(33, KeyCode.PageUp);\n\tdefine(34, KeyCode.PageDown);\n\tdefine(35, KeyCode.End);\n\tdefine(36, KeyCode.Home);\n\tdefine(37, KeyCode.LeftArrow);\n\tdefine(38, KeyCode.UpArrow);\n\tdefine(39, KeyCode.RightArrow);\n\tdefine(40, KeyCode.DownArrow);\n\tdefine(45, KeyCode.Insert);\n\tdefine(46, KeyCode.Delete);\n\n\tdefine(48, KeyCode.KEY_0);\n\tdefine(49, KeyCode.KEY_1);\n\tdefine(50, KeyCode.KEY_2);\n\tdefine(51, KeyCode.KEY_3);\n\tdefine(52, KeyCode.KEY_4);\n\tdefine(53, KeyCode.KEY_5);\n\tdefine(54, KeyCode.KEY_6);\n\tdefine(55, KeyCode.KEY_7);\n\tdefine(56, KeyCode.KEY_8);\n\tdefine(57, KeyCode.KEY_9);\n\n\tdefine(65, KeyCode.KEY_A);\n\tdefine(66, KeyCode.KEY_B);\n\tdefine(67, KeyCode.KEY_C);\n\tdefine(68, KeyCode.KEY_D);\n\tdefine(69, KeyCode.KEY_E);\n\tdefine(70, KeyCode.KEY_F);\n\tdefine(71, KeyCode.KEY_G);\n\tdefine(72, KeyCode.KEY_H);\n\tdefine(73, KeyCode.KEY_I);\n\tdefine(74, KeyCode.KEY_J);\n\tdefine(75, KeyCode.KEY_K);\n\tdefine(76, KeyCode.KEY_L);\n\tdefine(77, KeyCode.KEY_M);\n\tdefine(78, KeyCode.KEY_N);\n\tdefine(79, KeyCode.KEY_O);\n\tdefine(80, KeyCode.KEY_P);\n\tdefine(81, KeyCode.KEY_Q);\n\tdefine(82, KeyCode.KEY_R);\n\tdefine(83, KeyCode.KEY_S);\n\tdefine(84, KeyCode.KEY_T);\n\tdefine(85, KeyCode.KEY_U);\n\tdefine(86, KeyCode.KEY_V);\n\tdefine(87, KeyCode.KEY_W);\n\tdefine(88, KeyCode.KEY_X);\n\tdefine(89, KeyCode.KEY_Y);\n\tdefine(90, KeyCode.KEY_Z);\n\n\tdefine(93, KeyCode.ContextMenu);\n\n\tdefine(96, KeyCode.NUMPAD_0);\n\tdefine(97, KeyCode.NUMPAD_1);\n\tdefine(98, KeyCode.NUMPAD_2);\n\tdefine(99, KeyCode.NUMPAD_3);\n\tdefine(100, KeyCode.NUMPAD_4);\n\tdefine(101, KeyCode.NUMPAD_5);\n\tdefine(102, KeyCode.NUMPAD_6);\n\tdefine(103, KeyCode.NUMPAD_7);\n\tdefine(104, KeyCode.NUMPAD_8);\n\tdefine(105, KeyCode.NUMPAD_9);\n\tdefine(106, KeyCode.NUMPAD_MULTIPLY);\n\tdefine(107, KeyCode.NUMPAD_ADD);\n\tdefine(108, KeyCode.NUMPAD_SEPARATOR);\n\tdefine(109, KeyCode.NUMPAD_SUBTRACT);\n\tdefine(110, KeyCode.NUMPAD_DECIMAL);\n\tdefine(111, KeyCode.NUMPAD_DIVIDE);\n\n\tdefine(112, KeyCode.F1);\n\tdefine(113, KeyCode.F2);\n\tdefine(114, KeyCode.F3);\n\tdefine(115, KeyCode.F4);\n\tdefine(116, KeyCode.F5);\n\tdefine(117, KeyCode.F6);\n\tdefine(118, KeyCode.F7);\n\tdefine(119, KeyCode.F8);\n\tdefine(120, KeyCode.F9);\n\tdefine(121, KeyCode.F10);\n\tdefine(122, KeyCode.F11);\n\tdefine(123, KeyCode.F12);\n\tdefine(124, KeyCode.F13);\n\tdefine(125, KeyCode.F14);\n\tdefine(126, KeyCode.F15);\n\tdefine(127, KeyCode.F16);\n\tdefine(128, KeyCode.F17);\n\tdefine(129, KeyCode.F18);\n\tdefine(130, KeyCode.F19);\n\n\tdefine(144, KeyCode.NumLock);\n\tdefine(145, KeyCode.ScrollLock);\n\n\tdefine(186, KeyCode.US_SEMICOLON);\n\tdefine(187, KeyCode.US_EQUAL);\n\tdefine(188, KeyCode.US_COMMA);\n\tdefine(189, KeyCode.US_MINUS);\n\tdefine(190, KeyCode.US_DOT);\n\tdefine(191, KeyCode.US_SLASH);\n\tdefine(192, KeyCode.US_BACKTICK);\n\tdefine(193, KeyCode.ABNT_C1);\n\tdefine(194, KeyCode.ABNT_C2);\n\tdefine(219, KeyCode.US_OPEN_SQUARE_BRACKET);\n\tdefine(220, KeyCode.US_BACKSLASH);\n\tdefine(221, KeyCode.US_CLOSE_SQUARE_BRACKET);\n\tdefine(222, KeyCode.US_QUOTE);\n\tdefine(223, KeyCode.OEM_8);\n\n\tdefine(226, KeyCode.OEM_102);\n\n\t/**\n\t * https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html\n\t * If an Input Method Editor is processing key input and the event is keydown, return 229.\n\t */\n\tdefine(229, KeyCode.KEY_IN_COMPOSITION);\n\n\tif (browser.isIE) {\n\t\tdefine(91, KeyCode.Meta);\n\t} else if (browser.isFirefox) {\n\t\tdefine(59, KeyCode.US_SEMICOLON);\n\t\tdefine(107, KeyCode.US_EQUAL);\n\t\tdefine(109, KeyCode.US_MINUS);\n\t\tif (platform.isMacintosh) {\n\t\t\tdefine(224, KeyCode.Meta);\n\t\t}\n\t} else if (browser.isWebKit) {\n\t\tdefine(91, KeyCode.Meta);\n\t\tif (platform.isMacintosh) {\n\t\t\t// the two meta keys in the Mac have different key codes (91 and 93)\n\t\t\tdefine(93, KeyCode.Meta);\n\t\t} else {\n\t\t\tdefine(92, KeyCode.Meta);\n\t\t}\n\t}\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\treturn KEY_CODE_MAP[e.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 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 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\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\tif (this.browserEvent.preventDefault) {\n\t\t\tthis.browserEvent.preventDefault();\n\t\t}\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tif (this.browserEvent.stopPropagation) {\n\t\t\tthis.browserEvent.stopPropagation();\n\t\t}\n\t}\n}\n\nexport interface IDataTransfer {\n\tdropEffect: string;\n\ttypes: any[];\n}\n\nexport class DragMouseEvent extends StandardMouseEvent {\n\n\tpublic readonly dataTransfer: IDataTransfer;\n\n\tconstructor(e: MouseEvent) {\n\t\tsuper(e);\n\t\tthis.dataTransfer = (<any>e).dataTransfer;\n\t}\n\n}\n\nexport interface IMouseWheelEvent extends MouseEvent {\n\treadonly wheelDelta: 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\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}\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}\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\tif (this.browserEvent.preventDefault) {\n\t\t\t\tthis.browserEvent.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tif (this.browserEvent) {\n\t\t\tif (this.browserEvent.stopPropagation) {\n\t\t\t\tthis.browserEvent.stopPropagation();\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 * as browser from 'vs/base/browser/browser';\nimport { domEvent } from 'vs/base/browser/event';\nimport { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { coalesce } from 'vs/base/common/arrays';\n\nexport function clearNode(node: HTMLElement): void {\n\twhile (node.firstChild) {\n\t\tnode.removeChild(node.firstChild);\n\t}\n}\n\nexport function removeNode(node: HTMLElement): void {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\nexport function isInDOM(node: Node | null): boolean {\n\twhile (node) {\n\t\tif (node === document.body) {\n\t\t\treturn true;\n\t\t}\n\t\tnode = node.parentNode;\n\t}\n\treturn false;\n}\n\ninterface IDomClassList {\n\thasClass(node: HTMLElement, className: string): boolean;\n\taddClass(node: HTMLElement, className: string): void;\n\taddClasses(node: HTMLElement, ...classNames: string[]): void;\n\tremoveClass(node: HTMLElement, className: string): void;\n\tremoveClasses(node: HTMLElement, ...classNames: string[]): void;\n\ttoggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void;\n}\n\nconst _manualClassList = new class implements IDomClassList {\n\n\tprivate _lastStart: number;\n\tprivate _lastEnd: number;\n\n\tprivate _findClassName(node: HTMLElement, className: string): void {\n\n\t\tlet classes = node.className;\n\t\tif (!classes) {\n\t\t\tthis._lastStart = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tclassName = className.trim();\n\n\t\tlet classesLen = classes.length,\n\t\t\tclassLen = className.length;\n\n\t\tif (classLen === 0) {\n\t\t\tthis._lastStart = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (classesLen < classLen) {\n\t\t\tthis._lastStart = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (classes === className) {\n\t\t\tthis._lastStart = 0;\n\t\t\tthis._lastEnd = classesLen;\n\t\t\treturn;\n\t\t}\n\n\t\tlet idx = -1,\n\t\t\tidxEnd: number;\n\n\t\twhile ((idx = classes.indexOf(className, idx + 1)) >= 0) {\n\n\t\t\tidxEnd = idx + classLen;\n\n\t\t\t// a class that is followed by another class\n\t\t\tif ((idx === 0 || classes.charCodeAt(idx - 1) === CharCode.Space) && classes.charCodeAt(idxEnd) === CharCode.Space) {\n\t\t\t\tthis._lastStart = idx;\n\t\t\t\tthis._lastEnd = idxEnd + 1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// last class\n\t\t\tif (idx > 0 && classes.charCodeAt(idx - 1) === CharCode.Space && idxEnd === classesLen) {\n\t\t\t\tthis._lastStart = idx - 1;\n\t\t\t\tthis._lastEnd = idxEnd;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// equal - duplicate of cmp above\n\t\t\tif (idx === 0 && idxEnd === classesLen) {\n\t\t\t\tthis._lastStart = 0;\n\t\t\t\tthis._lastEnd = idxEnd;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis._lastStart = -1;\n\t}\n\n\thasClass(node: HTMLElement, className: string): boolean {\n\t\tthis._findClassName(node, className);\n\t\treturn this._lastStart !== -1;\n\t}\n\n\taddClasses(node: HTMLElement, ...classNames: string[]): void {\n\t\tclassNames.forEach(nameValue => nameValue.split(' ').forEach(name => this.addClass(node, name)));\n\t}\n\n\taddClass(node: HTMLElement, className: string): void {\n\t\tif (!node.className) { // doesn't have it for sure\n\t\t\tnode.className = className;\n\t\t} else {\n\t\t\tthis._findClassName(node, className); // see if it's already there\n\t\t\tif (this._lastStart === -1) {\n\t\t\t\tnode.className = node.className + ' ' + className;\n\t\t\t}\n\t\t}\n\t}\n\n\tremoveClass(node: HTMLElement, className: string): void {\n\t\tthis._findClassName(node, className);\n\t\tif (this._lastStart === -1) {\n\t\t\treturn; // Prevent styles invalidation if not necessary\n\t\t} else {\n\t\t\tnode.className = node.className.substring(0, this._lastStart) + node.className.substring(this._lastEnd);\n\t\t}\n\t}\n\n\tremoveClasses(node: HTMLElement, ...classNames: string[]): void {\n\t\tclassNames.forEach(nameValue => nameValue.split(' ').forEach(name => this.removeClass(node, name)));\n\t}\n\n\ttoggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void {\n\t\tthis._findClassName(node, className);\n\t\tif (this._lastStart !== -1 && (shouldHaveIt === undefined || !shouldHaveIt)) {\n\t\t\tthis.removeClass(node, className);\n\t\t}\n\t\tif (this._lastStart === -1 && (shouldHaveIt === undefined || shouldHaveIt)) {\n\t\t\tthis.addClass(node, className);\n\t\t}\n\t}\n};\n\nconst _nativeClassList = new class implements IDomClassList {\n\thasClass(node: HTMLElement, className: string): boolean {\n\t\treturn Boolean(className) && node.classList && node.classList.contains(className);\n\t}\n\n\taddClasses(node: HTMLElement, ...classNames: string[]): void {\n\t\tclassNames.forEach(nameValue => nameValue.split(' ').forEach(name => this.addClass(node, name)));\n\t}\n\n\taddClass(node: HTMLElement, className: string): void {\n\t\tif (className && node.classList) {\n\t\t\tnode.classList.add(className);\n\t\t}\n\t}\n\n\tremoveClass(node: HTMLElement, className: string): void {\n\t\tif (className && node.classList) {\n\t\t\tnode.classList.remove(className);\n\t\t}\n\t}\n\n\tremoveClasses(node: HTMLElement, ...classNames: string[]): void {\n\t\tclassNames.forEach(nameValue => nameValue.split(' ').forEach(name => this.removeClass(node, name)));\n\t}\n\n\ttoggleClass(node: HTMLElement, className: string, shouldHaveIt?: boolean): void {\n\t\tif (node.classList) {\n\t\t\tnode.classList.toggle(className, shouldHaveIt);\n\t\t}\n\t}\n};\n\n// In IE11 there is only partial support for `classList` which makes us keep our\n// custom implementation. Otherwise use the native implementation, see: http://caniuse.com/#search=classlist\nconst _classList: IDomClassList = browser.isIE ? _manualClassList : _nativeClassList;\nexport const hasClass: (node: HTMLElement, className: string) => boolean = _classList.hasClass.bind(_classList);\nexport const addClass: (node: HTMLElement, className: string) => void = _classList.addClass.bind(_classList);\nexport const addClasses: (node: HTMLElement, ...classNames: string[]) => void = _classList.addClasses.bind(_classList);\nexport const removeClass: (node: HTMLElement, className: string) => void = _classList.removeClass.bind(_classList);\nexport const removeClasses: (node: HTMLElement, ...classNames: string[]) => void = _classList.removeClasses.bind(_classList);\nexport const toggleClass: (node: HTMLElement, className: string, shouldHaveIt?: boolean) => void = _classList.toggleClass.bind(_classList);\n\nclass DomListener implements IDisposable {\n\n\tprivate _handler: (e: any) => void;\n\tprivate _node: Element | Window | Document;\n\tprivate readonly _type: string;\n\tprivate readonly _useCapture: boolean;\n\n\tconstructor(node: Element | Window | Document, type: string, handler: (e: any) => void, useCapture?: boolean) {\n\t\tthis._node = node;\n\t\tthis._type = type;\n\t\tthis._handler = handler;\n\t\tthis._useCapture = (useCapture || false);\n\t\tthis._node.addEventListener(this._type, this._handler, this._useCapture);\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._useCapture);\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: Element | Window | Document, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): IDisposable;\nexport function addDisposableListener(node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;\nexport function addDisposableListener(node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable {\n\treturn new DomListener(node, type, handler, useCapture);\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 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 || e.target);\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\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 16ms 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\nexport interface DOMEvent {\n}\n\nconst MINIMUM_TIME_MS = 16;\nconst DEFAULT_EVENT_MERGER: IEventMerger<DOMEvent, DOMEvent> = function (lastEvent: DOMEvent, currentEvent: DOMEvent) {\n\treturn currentEvent;\n};\n\nclass TimeoutThrottledDomListener<R, E extends DOMEvent> 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 DOMEvent = DOMEvent>(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\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 class Dimension {\n\tpublic width: number;\n\tpublic height: number;\n\n\tconstructor(width: number, height: number) {\n\t\tthis.width = width;\n\t\tthis.height = 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, top = element.offsetTop, left = element.offsetLeft;\n\n\twhile ((element = <HTMLElement>element.parentNode) !== null && element !== document.body && element !== document.documentElement) {\n\t\ttop -= element.scrollTop;\n\t\tlet c = 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\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) {\n\t\tif (hasClass(node, 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 (hasClass(node, 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 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 && style.sheet && style.sheet.rules) {\n\t\t// Chrome, IE\n\t\treturn style.sheet.rules;\n\t}\n\tif (style && style.sheet && 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\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\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\tUNLOAD: 'unload',\n\tABORT: 'abort',\n\tERROR: 'error',\n\tRESIZE: 'resize',\n\tSCROLL: 'scroll',\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 {\n\tonDidFocus: Event<void>;\n\tonDidBlur: Event<void>;\n\tdispose(): 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 implements IFocusTracker {\n\n\tprivate _onDidFocus = new Emitter<void>();\n\treadonly onDidFocus: Event<void> = this._onDidFocus.event;\n\n\tprivate _onDidBlur = new Emitter<void>();\n\treadonly onDidBlur: Event<void> = this._onDidBlur.event;\n\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(element: HTMLElement | Window) {\n\t\tlet hasFocus = isAncestor(document.activeElement, <HTMLElement>element);\n\t\tlet loosingFocus = false;\n\n\t\tlet 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\tlet 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\tdomEvent(element, EventType.FOCUS, true)(onFocus, null, this.disposables);\n\t\tdomEvent(element, EventType.BLUR, true)(onBlur, null, this.disposables);\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables = dispose(this.disposables);\n\t\tthis._onDidFocus.dispose();\n\t\tthis._onDidBlur.dispose();\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, ...children: T[]): T {\n\tchildren.forEach(child => parent.appendChild(child));\n\treturn children[children.length - 1];\n}\n\nconst SELECTOR_REGEX = /([\\w\\-]+)?(#([\\w\\-]+))?((.([\\w\\-]+))*)/;\n\nexport function $<T extends HTMLElement>(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\tlet result = document.createElement(match[1] || 'div');\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\tattrs = attrs || {};\n\tObject.keys(attrs).forEach(name => {\n\t\tconst value = attrs![name];\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\tcoalesce(children)\n\t\t.forEach(child => {\n\t\t\tif (child instanceof Node) {\n\t\t\t\tresult.appendChild(child);\n\t\t\t} else {\n\t\t\t\tresult.appendChild(document.createTextNode(child as string));\n\t\t\t}\n\t\t});\n\n\treturn result as T;\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\nfunction findParentWithAttribute(node: Node | null, attribute: string): HTMLElement | null {\n\twhile (node) {\n\t\tif (node instanceof HTMLElement && node.hasAttribute(attribute)) {\n\t\t\treturn node;\n\t\t}\n\n\t\tnode = node.parentNode;\n\t}\n\n\treturn null;\n}\n\nexport function removeTabIndexAndUpdateFocus(node: HTMLElement): void {\n\tif (!node || !node.hasAttribute('tabIndex')) {\n\t\treturn;\n\t}\n\n\t// If we are the currently focused element and tabIndex is removed,\n\t// standard DOM behavior is to move focus to the <body> element. We\n\t// typically never want that, rather put focus to the closest element\n\t// in the hierarchy of the parent DOM nodes.\n\tif (document.activeElement === node) {\n\t\tlet parentFocusable = findParentWithAttribute(node.parentElement, 'tabIndex');\n\t\tif (parentFocusable) {\n\t\t\tparentFocusable.focus();\n\t\t}\n\t}\n\n\tnode.removeAttribute('tabindex');\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 * 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\tif (platform.isNative || browser.isEdgeWebView) {\n\t\t// In VSCode, window.open() always returns null...\n\t\t// The same is true for a WebView (see https://github.com/Microsoft/monaco-editor/issues/628)\n\t\twindow.open(url);\n\t} else {\n\t\tlet newTab = window.open();\n\t\tif (newTab) {\n\t\t\t(newTab as any).opener = null;\n\t\t\tnewTab.location.href = url;\n\t\t}\n\t}\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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';\n\nexport class FastDomNode<T extends HTMLElement> {\n\n\tpublic readonly domNode: T;\n\tprivate _maxWidth: number;\n\tprivate _width: number;\n\tprivate _height: number;\n\tprivate _top: number;\n\tprivate _left: number;\n\tprivate _bottom: number;\n\tprivate _right: number;\n\tprivate _fontFamily: string;\n\tprivate _fontWeight: string;\n\tprivate _fontSize: number;\n\tprivate _lineHeight: number;\n\tprivate _letterSpacing: number;\n\tprivate _className: string;\n\tprivate _display: string;\n\tprivate _position: string;\n\tprivate _visibility: string;\n\tprivate _layerHint: boolean;\n\n\tconstructor(domNode: T) {\n\t\tthis.domNode = domNode;\n\t\tthis._maxWidth = -1;\n\t\tthis._width = -1;\n\t\tthis._height = -1;\n\t\tthis._top = -1;\n\t\tthis._left = -1;\n\t\tthis._bottom = -1;\n\t\tthis._right = -1;\n\t\tthis._fontFamily = '';\n\t\tthis._fontWeight = '';\n\t\tthis._fontSize = -1;\n\t\tthis._lineHeight = -1;\n\t\tthis._letterSpacing = -100;\n\t\tthis._className = '';\n\t\tthis._display = '';\n\t\tthis._position = '';\n\t\tthis._visibility = '';\n\t\tthis._layerHint = false;\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 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\tdom.toggleClass(this.domNode, 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 setLayerHinting(layerHint: boolean): void {\n\t\tif (this._layerHint === layerHint) {\n\t\t\treturn;\n\t\t}\n\t\tthis._layerHint = layerHint;\n\t\t(<any>this.domNode.style).willChange = this._layerHint ? 'transform' : 'auto';\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<any>): void {\n\t\tthis.domNode.appendChild(child.domNode);\n\t}\n\n\tpublic removeChild(child: FastDomNode<any>): 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\nimport * as dom from 'vs/base/browser/dom';\nimport { IframeUtils } from 'vs/base/browser/iframe';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';\n\nexport interface IStandardMouseMoveEventData {\n\tleftButton: boolean;\n\tposx: number;\n\tposy: number;\n}\n\nexport interface IEventMerger<R> {\n\t(lastEvent: R, currentEvent: MouseEvent): R;\n}\n\nexport interface IMouseMoveCallback<R> {\n\t(mouseMoveData: R): void;\n}\n\nexport interface IOnStopCallback {\n\t(): void;\n}\n\nexport function standardMouseMoveMerger(lastEvent: IStandardMouseMoveEventData, currentEvent: MouseEvent): IStandardMouseMoveEventData {\n\tlet ev = new StandardMouseEvent(currentEvent);\n\tev.preventDefault();\n\treturn {\n\t\tleftButton: ev.leftButton,\n\t\tposx: ev.posx,\n\t\tposy: ev.posy\n\t};\n}\n\nexport class GlobalMouseMoveMonitor<R> extends Disposable {\n\n\tprivate hooks: IDisposable[];\n\tprivate mouseMoveEventMerger: IEventMerger<R> | null;\n\tprivate mouseMoveCallback: IMouseMoveCallback<R> | null;\n\tprivate onStopCallback: IOnStopCallback | null;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.hooks = [];\n\t\tthis.mouseMoveEventMerger = null;\n\t\tthis.mouseMoveCallback = null;\n\t\tthis.onStopCallback = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.stopMonitoring(false);\n\t\tsuper.dispose();\n\t}\n\n\tpublic stopMonitoring(invokeStopCallback: boolean): 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 = dispose(this.hooks);\n\t\tthis.mouseMoveEventMerger = null;\n\t\tthis.mouseMoveCallback = null;\n\t\tlet onStopCallback = this.onStopCallback;\n\t\tthis.onStopCallback = null;\n\n\t\tif (invokeStopCallback && onStopCallback) {\n\t\t\tonStopCallback();\n\t\t}\n\t}\n\n\tpublic isMonitoring() {\n\t\treturn this.hooks.length > 0;\n\t}\n\n\tpublic startMonitoring(\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\tlet windowChain = IframeUtils.getSameOriginWindowChain();\n\t\tfor (const element of windowChain) {\n\t\t\tthis.hooks.push(dom.addDisposableThrottledListener(element.window.document, 'mousemove',\n\t\t\t\t(data: R) => this.mouseMoveCallback!(data),\n\t\t\t\t(lastEvent: R, currentEvent) => this.mouseMoveEventMerger!(lastEvent, currentEvent as MouseEvent)\n\t\t\t));\n\t\t\tthis.hooks.push(dom.addDisposableListener(element.window.document, '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.push(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.push(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.push(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 arrays from 'vs/base/common/arrays';\nimport { IDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport * as DomUtils from 'vs/base/browser/dom';\nimport { memoize } from 'vs/base/common/decorators';\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}\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\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 HOLD_DELAY = 700;\n\n\tprivate dispatched: boolean;\n\tprivate targets: HTMLElement[];\n\tprivate handle: IDisposable | null;\n\n\tprivate activeTouches: { [id: number]: TouchData; };\n\n\tprivate constructor() {\n\t\tsuper();\n\n\t\tthis.activeTouches = {};\n\t\tthis.handle = null;\n\t\tthis.targets = [];\n\t\tthis._register(DomUtils.addDisposableListener(document, 'touchstart', (e: TouchEvent) => this.onTouchStart(e)));\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)));\n\t}\n\n\tpublic static addTarget(element: HTMLElement): void {\n\t\tif (!Gesture.isTouchDevice()) {\n\t\t\treturn;\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\t}\n\n\t@memoize\n\tprivate static isTouchDevice(): boolean {\n\t\treturn 'ontouchstart' in window as any || navigator.maxTouchPoints > 0 || window.navigator.msMaxTouchPoints > 0;\n\t}\n\n\tpublic 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 = <GestureEvent>(<any>document.createEvent('CustomEvent'));\n\t\tevent.initEvent(type, false, true);\n\t\tevent.initialTarget = initialTarget;\n\t\treturn event;\n\t}\n\n\tprivate dispatchEvent(event: GestureEvent): void {\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 { IListRenderer } from './list';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { $, removeClass } from 'vs/base/browser/dom';\n\nexport interface IRow {\n\tdomNode: HTMLElement | null;\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\tremoveClass(domNode, '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\tprivate garbageCollect(): void {\n\t\tif (!this.renderers) {\n\t\t\treturn;\n\t\t}\n\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.domNode = null;\n\t\t\t\tcachedRow.templateData = null;\n\t\t\t}\n\t\t});\n\n\t\tthis.cache.clear();\n\t}\n\n\tdispose(): void {\n\t\tthis.garbageCollect();\n\t\tthis.cache.clear();\n\t\tthis.renderers = null!; // StrictNullOverride: nulling out ok in dispose\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 * Copyright (c) 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 { 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 onchange(domNode: HTMLElement, listener: (e: Event) => void): void {\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.CHANGE, listener));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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';\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\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.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\tlet 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\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 { FastDomNode, createFastDomNode } 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}\n\nexport abstract class AbstractScrollbar extends Widget {\n\n\tprotected _host: ScrollbarHost;\n\tprotected _scrollable: Scrollable;\n\tprivate _lazyRender: boolean;\n\tprotected _scrollbarState: ScrollbarState;\n\tprivate _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._scrollbarState = opts.scrollbarState;\n\t\tthis._visibilityController = this._register(new ScrollbarVisibilityController(opts.visibility, 'visible scrollbar ' + opts.extraScrollbarClassName, 'invisible scrollbar ' + opts.extraScrollbarClassName));\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\tlet 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\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\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\tlet domTop = this.domNode.domNode.getClientRects()[0].top;\n\t\tlet sliderStart = domTop + this._scrollbarState.getSliderPosition();\n\t\tlet sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize();\n\t\tlet 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\t\tthis._setDesiredScrollPositionNow(this._scrollbarState.getDesiredScrollPositionFromOffset(this._mouseDownRelativePosition(offsetX, offsetY)));\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: ISimplifiedMouseEvent, 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\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\tlet desiredScrollPosition: INewScrollPosition = {};\n\t\tthis.writeScrollPosition(desiredScrollPosition, _desiredScrollPosition);\n\n\t\tthis._scrollable.setScrollPositionNow(desiredScrollPosition);\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\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 { INewScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable';\n\nexport class HorizontalScrollbar extends AbstractScrollbar {\n\n\tconstructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) {\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),\n\t\t\tvisibility: options.horizontal,\n\t\t\textraScrollbarClassName: 'horizontal',\n\t\t\tscrollable: scrollable\n\t\t});\n\n\t\tif (options.horizontalHasArrows) {\n\t\t\tlet arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;\n\t\t\tlet scrollbarDelta = (options.horizontalScrollbarSize - ARROW_IMG_SIZE) / 2;\n\n\t\t\tthis._createArrow({\n\t\t\t\tclassName: 'left-arrow',\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: 'right-arrow',\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\tpublic writeScrollPosition(target: INewScrollPosition, scrollPosition: number): void {\n\t\ttarget.scrollLeft = scrollPosition;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { INewScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable';\n\nexport class VerticalScrollbar extends AbstractScrollbar {\n\n\tconstructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) {\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),\n\t\t\tvisibility: options.vertical,\n\t\t\textraScrollbarClassName: 'vertical',\n\t\t\tscrollable: scrollable\n\t\t});\n\n\t\tif (options.verticalHasArrows) {\n\t\t\tlet arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;\n\t\t\tlet scrollbarDelta = (options.verticalScrollbarSize - ARROW_IMG_SIZE) / 2;\n\n\t\t\tthis._createArrow({\n\t\t\t\tclassName: 'up-arrow',\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: 'down-arrow',\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\tpublic writeScrollPosition(target: INewScrollPosition, scrollPosition: number): void {\n\t\ttarget.scrollTop = scrollPosition;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isWindows, isMacintosh, setImmediate } from 'vs/base/common/platform';\n\ninterface IProcess {\n\tplatform: string;\n\tenv: object;\n\n\tcwd(): string;\n\tnextTick(callback: (...args: any[]) => void): number;\n}\n\ndeclare const process: IProcess;\nconst safeProcess: IProcess = (typeof process === 'undefined') ? {\n\tcwd(): string { return '/'; },\n\tenv: Object.create(null),\n\tget platform(): string { return isWindows ? 'win32' : isMacintosh ? 'darwin' : 'linux'; },\n\tnextTick(callback: (...args: any[]) => void): number { return setImmediate(callback); }\n} : process;\n\nexport const cwd = safeProcess.cwd;\nexport const env = safeProcess.env;\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/tree/43dd49c9782848c25e5b03448c8a0f923f13c158\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\tconstructor(name: string, expected: string, actual: any) {\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\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) {\n\treturn code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n}\n\nfunction isPosixPathSeparator(code: number) {\n\treturn code === CHAR_FORWARD_SLASH;\n}\n\nfunction isWindowsDeviceRoot(code: number) {\n\treturn code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z ||\n\t\tcode >= 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;\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 (lastSlash !== i - 1 && 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 === 2 || res.length === 1) {\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\tif (res.length > 0) {\n\t\t\t\t\t\tres += `${separator}..`;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tres = '..';\n\t\t\t\t\t}\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\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\tif (dir === pathObject.root) {\n\t\treturn dir + base;\n\t}\n\treturn dir + sep + base;\n}\n\ninterface ParsedPath {\n\troot: string;\n\tdir: string;\n\tbase: string;\n\text: string;\n\tname: string;\n}\n\ninterface 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} else if (!resolvedDevice) {\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\tpath.slice(0, 3).toLowerCase() !==\n\t\t\t\t\tresolvedDevice.toLowerCase() + '\\\\') {\n\t\t\t\t\tpath = resolvedDevice + '\\\\';\n\t\t\t\t}\n\t\t\t}\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\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// Possible UNC root\n\n\t\t\t\t\t// If we started with a separator, we know we at least have an\n\t\t\t\t\t// absolute path of some kind (UNC or otherwise)\n\t\t\t\t\tisAbsolute = true;\n\n\t\t\t\t\tif (isPathSeparator(path.charCodeAt(1))) {\n\t\t\t\t\t\t// Matched double path separator at beginning\n\t\t\t\t\t\tlet j = 2;\n\t\t\t\t\t\tlet last = j;\n\t\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\t\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\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\tconst firstPart = path.slice(last, j);\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 path separators\n\t\t\t\t\t\t\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\t\tif (!isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\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// Matched!\n\t\t\t\t\t\t\t\tlast = j;\n\t\t\t\t\t\t\t\t// Match 1 or more non-path separators\n\t\t\t\t\t\t\t\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\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}\n\t\t\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t\t\t// We matched a UNC root only\n\n\t\t\t\t\t\t\t\t\tdevice = '\\\\\\\\' + firstPart + '\\\\' + path.slice(last);\n\t\t\t\t\t\t\t\t\trootEnd = j;\n\t\t\t\t\t\t\t\t} else if (j !== last) {\n\t\t\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\n\t\t\t\t\t\t\t\t\tdevice = '\\\\\\\\' + firstPart + '\\\\' + path.slice(last, j);\n\t\t\t\t\t\t\t\t\trootEnd = j;\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} else {\n\t\t\t\t\t\trootEnd = 1;\n\t\t\t\t\t}\n\t\t\t\t} else if (isWindowsDeviceRoot(code)) {\n\t\t\t\t\t// Possible device root\n\n\t\t\t\t\tif (path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\t\t\tdevice = path.slice(0, 2);\n\t\t\t\t\t\trootEnd = 2;\n\t\t\t\t\t\tif (len > 2) {\n\t\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t\t\t\t\t// Treat separator following drive name as an absolute path\n\t\t\t\t\t\t\t\t// indicator\n\t\t\t\t\t\t\t\tisAbsolute = true;\n\t\t\t\t\t\t\t\trootEnd = 3;\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} else if (isPathSeparator(code)) {\n\t\t\t\t// `path` contains just a path separator\n\t\t\t\trootEnd = 1;\n\t\t\t\tisAbsolute = true;\n\t\t\t}\n\n\t\t\tif (device.length > 0 &&\n\t\t\t\tresolvedDevice.length > 0 &&\n\t\t\t\tdevice.toLowerCase() !== resolvedDevice.toLowerCase()) {\n\t\t\t\t// This path points to another device so it is not applicable\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (resolvedDevice.length === 0 && device.length > 0) {\n\t\t\t\tresolvedDevice = device;\n\t\t\t}\n\t\t\tif (!resolvedAbsolute) {\n\t\t\t\tresolvedTail = path.slice(rootEnd) + '\\\\' + resolvedTail;\n\t\t\t\tresolvedAbsolute = isAbsolute;\n\t\t\t}\n\n\t\t\tif (resolvedDevice.length > 0 && resolvedAbsolute) {\n\t\t\t\tbreak;\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 (resolvedDevice + (resolvedAbsolute ? '\\\\' : '') + resolvedTail) ||\n\t\t\t'.';\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\tif (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 absolute\n\t\t\t\t// 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\tfor (; j < len; ++j) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\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 (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\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\tif (!isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\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\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t\t// We matched a UNC root only\n\t\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\t// is nothing left to process\n\n\t\t\t\t\t\t\t\treturn '\\\\\\\\' + firstPart + '\\\\' + path.slice(last) + '\\\\';\n\t\t\t\t\t\t\t} else if (j !== last) {\n\t\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\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\t// Possible device root\n\n\t\t\t\tif (path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\t\tdevice = path.slice(0, 2);\n\t\t\t\t\trootEnd = 2;\n\t\t\t\t\tif (len > 2) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t\t\t\t// Treat separator following drive name as an absolute path\n\t\t\t\t\t\t\t// indicator\n\t\t\t\t\t\t\tisAbsolute = true;\n\t\t\t\t\t\t\trootEnd = 3;\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 (isPathSeparator(code)) {\n\t\t\t// `path` contains just a path separator, exit early to avoid unnecessary\n\t\t\t// work\n\t\t\treturn '\\\\';\n\t\t}\n\n\t\tlet tail;\n\t\tif (rootEnd < len) {\n\t\t\ttail = normalizeString(path.slice(rootEnd), !isAbsolute, '\\\\',\n\t\t\t\tisPathSeparator);\n\t\t} else {\n\t\t\ttail = '';\n\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\tif (isAbsolute) {\n\t\t\t\tif (tail.length > 0) {\n\t\t\t\t\treturn '\\\\' + tail;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn '\\\\';\n\t\t\t\t}\n\t\t\t} else if (tail.length > 0) {\n\t\t\t\treturn tail;\n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t} else if (isAbsolute) {\n\t\t\tif (tail.length > 0) {\n\t\t\t\treturn device + '\\\\' + tail;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn device + '\\\\';\n\t\t\t}\n\t\t} else if (tail.length > 0) {\n\t\t\treturn device + tail;\n\t\t} else {\n\t\t\treturn device;\n\t\t}\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\tif (isPathSeparator(code)) {\n\t\t\treturn true;\n\t\t} else if (isWindowsDeviceRoot(code)) {\n\t\t\t// Possible device root\n\n\t\t\tif (len > 2 && path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\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\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 an 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 an 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 an 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) {\n\t\t\t\tif (isPathSeparator(firstPart.charCodeAt(1))) {\n\t\t\t\t\t++slashCount;\n\t\t\t\t\tif (firstLen > 2) {\n\t\t\t\t\t\tif (isPathSeparator(firstPart.charCodeAt(2))) {\n\t\t\t\t\t\t\t++slashCount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// We matched a UNC path in the first part\n\t\t\t\t\t\t\tneedsReplace = 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\tif (needsReplace) {\n\t\t\t// Find any more consecutive slashes we need to replace\n\t\t\tfor (; slashCount < joined.length; ++slashCount) {\n\t\t\t\tif (!isPathSeparator(joined.charCodeAt(slashCount))) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\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\tfor (; fromStart < from.length; ++fromStart) {\n\t\t\tif (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Trim trailing backslashes (applicable to UNC paths only)\n\t\tlet fromEnd = from.length;\n\t\tfor (; fromEnd - 1 > fromStart; --fromEnd) {\n\t\t\tif (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst fromLen = (fromEnd - fromStart);\n\n\t\t// Trim any leading backslashes\n\t\tlet toStart = 0;\n\t\tfor (; toStart < to.length; ++toStart) {\n\t\t\tif (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Trim trailing backslashes (applicable to UNC paths only)\n\t\tlet toEnd = to.length;\n\t\tfor (; toEnd - 1 > toStart; --toEnd) {\n\t\t\tif (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) {\n\t\t\t\tbreak;\n\t\t\t}\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\tif (i === length) {\n\t\t\t\tif (toLen > length) {\n\t\t\t\t\tif (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t\t\t// We get here if `from` is the exact base path for `to`.\n\t\t\t\t\t\t// For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n\t\t\t\t\t\treturn toOrig.slice(toStart + i + 1);\n\t\t\t\t\t} else if (i === 2) {\n\t\t\t\t\t\t// We get here if `from` is the device root.\n\t\t\t\t\t\t// For example: from='C:\\\\'; to='C:\\\\foo'\n\t\t\t\t\t\treturn toOrig.slice(toStart + i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (fromLen > length) {\n\t\t\t\t\tif (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t\t\t// We get here if `to` is the exact base path for `from`.\n\t\t\t\t\t\t// For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n\t\t\t\t\t\tlastCommonSep = i;\n\t\t\t\t\t} else if (i === 2) {\n\t\t\t\t\t\t// We get here if `to` is the device root.\n\t\t\t\t\t\t// For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n\t\t\t\t\t\tlastCommonSep = 3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst fromCode = from.charCodeAt(fromStart + i);\n\t\t\tconst toCode = to.charCodeAt(toStart + i);\n\t\t\tif (fromCode !== toCode) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse 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 && lastCommonSep === -1) {\n\t\t\treturn toOrig;\n\t\t}\n\n\t\tlet out = '';\n\t\tif (lastCommonSep === -1) {\n\t\t\tlastCommonSep = 0;\n\t\t}\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\tif (out.length === 0) {\n\t\t\t\t\tout += '..';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tout += '\\\\..';\n\t\t\t\t}\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\tif (out.length > 0) {\n\t\t\treturn out + toOrig.slice(toStart + lastCommonSep, toEnd);\n\t\t}\n\t\telse {\n\t\t\ttoStart += lastCommonSep;\n\t\t\tif (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t++toStart;\n\t\t\t}\n\t\t\treturn toOrig.slice(toStart, toEnd);\n\t\t}\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 >= 3) {\n\t\t\tif (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t// Possible UNC root\n\n\t\t\t\tif (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t\tconst code = resolvedPath.charCodeAt(2);\n\t\t\t\t\tif (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\n\t\t\t\t\t\t// Matched non-long UNC root, convert the path to a long UNC path\n\t\t\t\t\t\treturn '\\\\\\\\?\\\\UNC\\\\' + resolvedPath.slice(2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {\n\t\t\t\t// Possible device root\n\n\t\t\t\tif (resolvedPath.charCodeAt(1) === CHAR_COLON &&\n\t\t\t\t\tresolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\n\t\t\t\t\t// Matched device root, convert the path to a long UNC path\n\t\t\t\t\treturn '\\\\\\\\?\\\\' + resolvedPath;\n\t\t\t\t}\n\t\t\t}\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 end = -1;\n\t\tlet matchedSlash = true;\n\t\tlet offset = 0;\n\t\tconst code = path.charCodeAt(0);\n\n\t\t// Try to match a root\n\t\tif (len > 1) {\n\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t// Possible UNC root\n\n\t\t\t\trootEnd = offset = 1;\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\tfor (; j < len; ++j) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\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 (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 path separators\n\t\t\t\t\t\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\tif (!isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\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\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t\t// We matched a UNC root only\n\t\t\t\t\t\t\t\treturn path;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j !== last) {\n\t\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\n\t\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\t// treat it as a \"normal root\" on top of a (UNC) root\n\t\t\t\t\t\t\t\trootEnd = offset = j + 1;\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} else if (isWindowsDeviceRoot(code)) {\n\t\t\t\t// Possible device root\n\n\t\t\t\tif (path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\t\trootEnd = offset = 2;\n\t\t\t\t\tif (len > 2) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t\t\t\trootEnd = offset = 3;\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 (isPathSeparator(code)) {\n\t\t\t// `path` contains just a path separator, exit early to avoid\n\t\t\t// unnecessary work\n\t\t\treturn path;\n\t\t}\n\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\t\t\telse {\n\t\t\t\tend = rootEnd;\n\t\t\t}\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\tconst drive = path.charCodeAt(0);\n\t\t\tif (isWindowsDeviceRoot(drive)) {\n\t\t\t\tif (path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\t\tstart = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n\t\t\tif (ext.length === path.length && 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}\n\t\t\telse 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} else {\n\t\t\tfor (i = path.length - 1; i >= start; --i) {\n\t\t\t\tif (isPathSeparator(path.charCodeAt(i))) {\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 if (end === -1) {\n\t\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t\t// path component\n\t\t\t\t\tmatchedSlash = false;\n\t\t\t\t\tend = i + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (end === -1) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn path.slice(start, end);\n\t\t}\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(pathObject): string {\n\t\tif (pathObject === null || typeof pathObject !== 'object') {\n\t\t\tthrow new ErrorInvalidArgType('pathObject', 'Object', pathObject);\n\t\t}\n\n\t\treturn _format('\\\\', pathObject);\n\t},\n\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\t// Try to match a root\n\t\tif (len > 1) {\n\t\t\tif (isPathSeparator(code)) {\n\t\t\t\t// Possible UNC root\n\n\t\t\t\trootEnd = 1;\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\tfor (; j < len; ++j) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\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 (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 path separators\n\t\t\t\t\t\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\tif (!isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\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\tfor (; j < len; ++j) {\n\t\t\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(j))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j === len) {\n\t\t\t\t\t\t\t\t// We matched a UNC root only\n\n\t\t\t\t\t\t\t\trootEnd = j;\n\t\t\t\t\t\t\t} else if (j !== last) {\n\t\t\t\t\t\t\t\t// We matched a UNC root with leftovers\n\n\t\t\t\t\t\t\t\trootEnd = j + 1;\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} else if (isWindowsDeviceRoot(code)) {\n\t\t\t\t// Possible device root\n\n\t\t\t\tif (path.charCodeAt(1) === CHAR_COLON) {\n\t\t\t\t\trootEnd = 2;\n\t\t\t\t\tif (len > 2) {\n\t\t\t\t\t\tif (isPathSeparator(path.charCodeAt(2))) {\n\t\t\t\t\t\t\tif (len === 3) {\n\t\t\t\t\t\t\t\t// `path` contains just a drive root, exit early to avoid\n\t\t\t\t\t\t\t\t// unnecessary work\n\t\t\t\t\t\t\t\tret.root = ret.dir = path;\n\t\t\t\t\t\t\t\treturn ret;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trootEnd = 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// `path` contains just a drive root, exit early to avoid\n\t\t\t\t\t\t// unnecessary work\n\t\t\t\t\t\tret.root = ret.dir = path;\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isPathSeparator(code)) {\n\t\t\t// `path` contains just a path separator, exit early to avoid\n\t\t\t// unnecessary work\n\t\t\tret.root = ret.dir = path;\n\t\t\treturn ret;\n\t\t}\n\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}\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\tif (end !== -1) {\n\t\t\t\tret.base = ret.name = path.slice(startPart, end);\n\t\t\t}\n\t\t} else {\n\t\t\tret.name = path.slice(startPart, startDot);\n\t\t\tret.base = path.slice(startPart, end);\n\t\t\tret.ext = path.slice(startDot, end);\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}\n\t\telse {\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\tlet path;\n\t\t\tif (i >= 0) {\n\t\t\t\tpath = pathSegments[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpath = process.cwd();\n\t\t\t}\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\tif (resolvedPath.length > 0) {\n\t\t\t\treturn '/' + resolvedPath;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn '/';\n\t\t\t}\n\t\t} else if (resolvedPath.length > 0) {\n\t\t\treturn resolvedPath;\n\t\t} else {\n\t\t\treturn '.';\n\t\t}\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 && !isAbsolute) {\n\t\t\tpath = '.';\n\t\t}\n\t\tif (path.length > 0 && trailingSeparator) {\n\t\t\tpath += '/';\n\t\t}\n\n\t\tif (isAbsolute) {\n\t\t\treturn '/' + path;\n\t\t}\n\t\treturn 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 = arguments[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}\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\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\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\t// Trim any leading backslashes\n\t\tlet fromStart = 1;\n\t\tfor (; fromStart < from.length; ++fromStart) {\n\t\t\tif (from.charCodeAt(fromStart) !== CHAR_FORWARD_SLASH) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst fromEnd = from.length;\n\t\tconst fromLen = (fromEnd - fromStart);\n\n\t\t// Trim any leading backslashes\n\t\tlet toStart = 1;\n\t\tfor (; toStart < to.length; ++toStart) {\n\t\t\tif (to.charCodeAt(toStart) !== CHAR_FORWARD_SLASH) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst toEnd = to.length;\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\tif (i === length) {\n\t\t\t\tif (toLen > length) {\n\t\t\t\t\tif (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {\n\t\t\t\t\t\t// We get here if `from` is the exact base path for `to`.\n\t\t\t\t\t\t// For example: from='/foo/bar'; to='/foo/bar/baz'\n\t\t\t\t\t\treturn to.slice(toStart + i + 1);\n\t\t\t\t\t} else if (i === 0) {\n\t\t\t\t\t\t// We get here if `from` is the root\n\t\t\t\t\t\t// For example: from='/'; to='/foo'\n\t\t\t\t\t\treturn to.slice(toStart + i);\n\t\t\t\t\t}\n\t\t\t\t} else if (fromLen > length) {\n\t\t\t\t\tif (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {\n\t\t\t\t\t\t// We get here if `to` is the exact base path for `from`.\n\t\t\t\t\t\t// For example: from='/foo/bar/baz'; to='/foo/bar'\n\t\t\t\t\t\tlastCommonSep = i;\n\t\t\t\t\t} else if (i === 0) {\n\t\t\t\t\t\t// We get here if `to` is the root.\n\t\t\t\t\t\t// For example: from='/foo'; to='/'\n\t\t\t\t\t\tlastCommonSep = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst fromCode = from.charCodeAt(fromStart + i);\n\t\t\tconst toCode = to.charCodeAt(toStart + i);\n\t\t\tif (fromCode !== toCode) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (fromCode === CHAR_FORWARD_SLASH) {\n\t\t\t\tlastCommonSep = i;\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\tif (out.length === 0) {\n\t\t\t\t\tout += '..';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tout += '/..';\n\t\t\t\t}\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\tif (out.length > 0) {\n\t\t\treturn out + to.slice(toStart + lastCommonSep);\n\t\t}\n\t\telse {\n\t\t\ttoStart += lastCommonSep;\n\t\t\tif (to.charCodeAt(toStart) === CHAR_FORWARD_SLASH) {\n\t\t\t\t++toStart;\n\t\t\t}\n\t\t\treturn to.slice(toStart);\n\t\t}\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.length === path.length && 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}\n\t\t\telse 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} else {\n\t\t\tfor (i = path.length - 1; i >= 0; --i) {\n\t\t\t\tif (path.charCodeAt(i) === 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 if (end === -1) {\n\t\t\t\t\t// We saw the first non-path separator, mark this as the end of our\n\t\t\t\t\t// path component\n\t\t\t\t\tmatchedSlash = false;\n\t\t\t\t\tend = i + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (end === -1) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn path.slice(start, end);\n\t\t}\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(pathObject): string {\n\t\tif (pathObject === null || typeof pathObject !== 'object') {\n\t\t\tthrow new ErrorInvalidArgType('pathObject', 'Object', pathObject);\n\t\t}\n\n\t\treturn _format('/', pathObject);\n\t},\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}\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\tif (end !== -1) {\n\t\t\t\tif (startPart === 0 && isAbsolute) {\n\t\t\t\t\tret.base = ret.name = path.slice(1, end);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tret.base = ret.name = path.slice(startPart, end);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (startPart === 0 && isAbsolute) {\n\t\t\t\tret.name = path.slice(1, startDot);\n\t\t\t\tret.base = path.slice(1, 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}\n\t\t\tret.ext = path.slice(startDot, end);\n\t\t}\n\n\t\tif (startPart > 0) {\n\t\t\tret.dir = path.slice(0, startPart - 1);\n\t\t}\n\t\telse 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 join = (process.platform === 'win32' ? win32.join : posix.join);\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\tdispose() {\n\t\tthis.groups = null!; // StrictNullOverride: nulling out ok in dispose\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 { 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\twidth: number;\n\tscrollWidth: number;\n\tscrollLeft: 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;\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\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\twidth = width | 0;\n\t\tscrollWidth = scrollWidth | 0;\n\t\tscrollLeft = scrollLeft | 0;\n\t\theight = height | 0;\n\t\tscrollHeight = scrollHeight | 0;\n\t\tscrollTop = scrollTop | 0;\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.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): ScrollState {\n\t\treturn new ScrollState(\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\tthis.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\tthis.scrollTop\n\t\t);\n\t}\n\n\tpublic withScrollPosition(update: INewScrollPosition): ScrollState {\n\t\treturn new ScrollState(\n\t\t\tthis.width,\n\t\t\tthis.scrollWidth,\n\t\t\t(typeof update.scrollLeft !== 'undefined' ? update.scrollLeft : this.scrollLeft),\n\t\t\tthis.height,\n\t\t\tthis.scrollHeight,\n\t\t\t(typeof update.scrollTop !== 'undefined' ? update.scrollTop : this.scrollTop)\n\t\t);\n\t}\n\n\tpublic createScrollEvent(previous: ScrollState): 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\twidth: this.width,\n\t\t\tscrollWidth: this.scrollWidth,\n\t\t\tscrollLeft: this.scrollLeft,\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 class Scrollable extends Disposable {\n\n\t_scrollableBrand: void;\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(smoothScrollDuration: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) {\n\t\tsuper();\n\n\t\tthis._smoothScrollDuration = smoothScrollDuration;\n\t\tthis._scheduleAtNextAnimationFrame = scheduleAtNextAnimationFrame;\n\t\tthis._state = new ScrollState(0, 0, 0, 0, 0, 0);\n\t\tthis._smoothScrolling = null;\n\t}\n\n\tpublic 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): void {\n\t\tconst newState = this._state.withScrollDimensions(dimensions);\n\t\tthis._setState(newState);\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);\n\t}\n\n\tpublic setScrollPositionSmooth(update: INewScrollPosition): 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\n\t\t\tconst newSmoothScrolling = this._smoothScrolling.combine(this._state, validTarget, this._smoothScrollDuration);\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);\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): 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));\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\tprivate readonly _startTime: number;\n\tpublic animationFrameDisposable: IDisposable | null;\n\n\tprivate scrollLeft!: IAnimation;\n\tprivate scrollTop!: IAnimation;\n\n\tprotected constructor(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 { 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() : new Date().getTime();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 * The empty string.\n */\nexport const empty = '';\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\n/**\n * @returns the provided number with the given number of preceding zeros.\n */\nexport function pad(n: number, l: number, char: string = '0'): string {\n\tconst str = '' + n;\n\tconst r = [str];\n\n\tfor (let i = str.length; i < l; i++) {\n\t\tr.push(char);\n\t}\n\n\treturn r.reverse().join('');\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\n/**\n * Determines if haystack starts with needle.\n */\nexport function startsWith(haystack: string, needle: string): boolean {\n\tif (haystack.length < needle.length) {\n\t\treturn false;\n\t}\n\n\tif (haystack === needle) {\n\t\treturn true;\n\t}\n\n\tfor (let i = 0; i < needle.length; i++) {\n\t\tif (haystack[i] !== needle[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Determines if haystack ends with needle.\n */\nexport function endsWith(haystack: string, needle: string): boolean {\n\tconst diff = haystack.length - needle.length;\n\tif (diff > 0) {\n\t\treturn haystack.indexOf(needle, diff) === diff;\n\t} else if (diff === 0) {\n\t\treturn haystack === needle;\n\t} else {\n\t\treturn false;\n\t}\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 && <any>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).unicode ? 'u' : '');\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 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\nfunction isAsciiLetter(code: number): boolean {\n\treturn isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\n}\n\nexport function equalsIgnoreCase(a: string, b: string): boolean {\n\tconst len1 = a ? a.length : 0;\n\tconst len2 = b ? b.length : 0;\n\n\tif (len1 !== len2) {\n\t\treturn false;\n\t}\n\n\treturn doEqualsIgnoreCase(a, b);\n}\n\nfunction doEqualsIgnoreCase(a: string, b: string, stopAt = a.length): boolean {\n\tif (typeof a !== 'string' || typeof b !== 'string') {\n\t\treturn false;\n\t}\n\n\tfor (let i = 0; i < stopAt; i++) {\n\t\tconst codeA = a.charCodeAt(i);\n\t\tconst codeB = b.charCodeAt(i);\n\n\t\tif (codeA === codeB) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// a-z A-Z\n\t\tif (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {\n\t\t\tconst diff = Math.abs(codeA - codeB);\n\t\t\tif (diff !== 0 && diff !== 32) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Any other charcode\n\t\telse {\n\t\t\tif (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\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 doEqualsIgnoreCase(str, candidate, candidateLength);\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// --- unicode\n// http://en.wikipedia.org/wiki/Surrogate_pair\n// Returns the code point starting at a specified index in a string\n// Code points U+0000 to U+D7FF and U+E000 to U+FFFF are represented on a single character\n// Code points U+10000 to U+10FFFF are represented on two consecutive characters\n//export function getUnicodePoint(str:string, index:number, len:number):number {\n//\tconst chrCode = str.charCodeAt(index);\n//\tif (0xD800 <= chrCode && chrCode <= 0xDBFF && index + 1 < len) {\n//\t\tconst nextChrCode = str.charCodeAt(index + 1);\n//\t\tif (0xDC00 <= nextChrCode && nextChrCode <= 0xDFFF) {\n//\t\t\treturn (chrCode - 0xD800) << 10 + (nextChrCode - 0xDC00) + 0x10000;\n//\t\t}\n//\t}\n//\treturn chrCode;\n//}\nexport function isHighSurrogate(charCode: number): boolean {\n\treturn (0xD800 <= charCode && charCode <= 0xDBFF);\n}\n\nexport function isLowSurrogate(charCode: number): boolean {\n\treturn (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\n\n/**\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-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-\\u0815\\u081A\\u0824\\u0828\\u0830-\\u0858\\u085E-\\u08BD\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFD3D\\uFD50-\\uFDFC\\uFE70-\\uFEFC]|\\uD802[\\uDC00-\\uDD1B\\uDD20-\\uDE00\\uDE10-\\uDE33\\uDE40-\\uDEE4\\uDEEB-\\uDF35\\uDF40-\\uDFFF]|\\uD803[\\uDC00-\\uDCFF]|\\uD83A[\\uDC00-\\uDCCF\\uDD00-\\uDD43\\uDD50-\\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\n/**\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js\n */\nconst CONTAINS_EMOJI = /(?:[\\u231A\\u231B\\u23F0\\u23F3\\u2600-\\u27BF\\u2B50\\u2B55]|\\uD83C[\\uDDE6-\\uDDFF\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDE4F\\uDE80-\\uDEF8]|\\uD83E[\\uDD00-\\uDDE6])/;\n\nexport function containsEmoji(str: string): boolean {\n\treturn CONTAINS_EMOJI.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 function containsFullWidthCharacter(str: string): boolean {\n\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\tif (isFullWidthCharacter(str.charCodeAt(i))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\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\tcharCode = +charCode; // @perf\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// -- 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 safeBtoa(str: string): string {\n\treturn btoa(encodeURIComponent(str)); // we use encodeURIComponent because btoa fails for non Latin 1 values\n}\n\nexport function repeat(s: string, count: number): string {\n\tlet result = '';\n\tfor (let i = 0; i < count; i++) {\n\t\tresult += s;\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 { escape } from 'vs/base/common/strings';\n\nexport function renderOcticons(text: string): string {\n\treturn escape(text);\n}\n","\nimport { startsWithIgnoreCase } from 'vs/base/common/strings';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { sep, posix } from 'vs/base/common/path';\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\nexport function isEqualOrParent(path: string, candidate: string, ignoreCase?: boolean, separator = sep): boolean {\n\tif (path === candidate) {\n\t\treturn true;\n\t}\n\n\tif (!path || !candidate) {\n\t\treturn false;\n\t}\n\n\tif (candidate.length > path.length) {\n\t\treturn false;\n\t}\n\n\tif (ignoreCase) {\n\t\tconst beginsWith = startsWithIgnoreCase(path, candidate);\n\t\tif (!beginsWith) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (candidate.length === path.length) {\n\t\t\treturn true; // same path, different casing\n\t\t}\n\n\t\tlet sepOffset = candidate.length;\n\t\tif (candidate.charAt(candidate.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 path.charAt(sepOffset) === separator;\n\t}\n\n\tif (candidate.charAt(candidate.length - 1) !== separator) {\n\t\tcandidate += separator;\n\t}\n\n\treturn path.indexOf(candidate) === 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 * Copyright (c) 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}\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'`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?'\n\t.split('')\n\t.forEach(s => wordSeparators.add(s.charCodeAt(0)));\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// 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 result = fuzzyScore(pattern, lowPattern, 0, word, lowWord, 0, true);\n\tif (result) {\n\t\treturn result;\n\t}\n\tlet matches = 0;\n\tlet score = 0;\n\tlet idx = _wordPos;\n\tfor (let patternPos = 0; patternPos < lowPattern.length && patternPos < _maxLen; ++patternPos) {\n\t\tconst wordPos = lowWord.indexOf(lowPattern.charAt(patternPos), idx);\n\t\tif (wordPos >= 0) {\n\t\t\tscore += 1;\n\t\t\tmatches += 2 ** wordPos;\n\t\t\tidx = wordPos + 1;\n\t\t}\n\t}\n\treturn [score, matches, _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\n\tconst matches = score[1].toString(2);\n\tconst wordStart = score[2];\n\tconst res: IMatch[] = [];\n\n\tfor (let pos = wordStart; pos < _maxLen; pos++) {\n\t\tif (matches[matches.length - (pos + 1)] === '1') {\n\t\t\tconst last = res[res.length - 1];\n\t\t\tif (last && last.end === pos) {\n\t\t\t\tlast.end = pos + 1;\n\t\t\t} else {\n\t\t\t\tres.push({ start: pos, end: pos + 1 });\n\t\t\t}\n\t\t}\n\t}\n\treturn res;\n}\n\nconst _maxLen = 53;\n\nfunction initTable() {\n\tconst table: number[][] = [];\n\tconst row: number[] = [0];\n\tfor (let i = 1; i <= _maxLen; i++) {\n\t\trow.push(-i);\n\t}\n\tfor (let i = 0; i <= _maxLen; i++) {\n\t\tconst thisRow = row.slice(0);\n\t\tthisRow[0] = -i;\n\t\ttable.push(thisRow);\n\t}\n\treturn table;\n}\n\nconst _table = initTable();\nconst _scores = 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 isSeparatorAtPos(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.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\t\treturn true;\n\t\tdefault:\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\nfunction isPatternInWord(patternLow: string, patternPos: number, patternLen: number, wordLow: string, wordPos: number, wordLen: number): boolean {\n\twhile (patternPos < patternLen && wordPos < wordLen) {\n\t\tif (patternLow[patternPos] === wordLow[wordPos]) {\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 { Top = 0b1, Diag = 0b10, Left = 0b100 }\n\n/**\n * A tuple of three values.\n * 0. the score\n * 1. the matches encoded as bitmask (2^53)\n * 2. the offset at which matching started\n */\nexport type FuzzyScore = [number, number, number];\n\nexport namespace FuzzyScore {\n\t/**\n\t * No matches and value `-100`\n\t */\n\texport const Default: [-100, 0, 0] = [-100, 0, 0];\n\n\texport function isDefault(score?: FuzzyScore): score is [-100, 0, 0] {\n\t\treturn !score || (score[0] === -100 && score[1] === 0 && score[2] === 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, patternPos: number, word: string, wordLow: string, wordPos: 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 (patternPos >= patternLen || wordPos >= wordLen || patternLen > wordLen) {\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, patternPos, patternLen, wordLow, wordPos, wordLen)) {\n\t\treturn undefined;\n\t}\n\n\tconst patternStartPos = patternPos;\n\tconst wordStartPos = wordPos;\n\n\t// There will be a mach, fill in tables\n\tfor (patternPos = patternStartPos + 1; patternPos <= patternLen; patternPos++) {\n\n\t\tfor (wordPos = 1; wordPos <= wordLen; wordPos++) {\n\n\t\t\tlet score = -1;\n\t\t\tif (patternLow[patternPos - 1] === wordLow[wordPos - 1]) {\n\n\t\t\t\tif (wordPos === (patternPos - patternStartPos)) {\n\t\t\t\t\t// common prefix: `foobar <-> foobaz`\n\t\t\t\t\t// ^^^^^\n\t\t\t\t\tif (pattern[patternPos - 1] === word[wordPos - 1]) {\n\t\t\t\t\t\tscore = 7;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscore = 5;\n\t\t\t\t\t}\n\t\t\t\t} else if (isUpperCaseAtPos(wordPos - 1, word, wordLow) && (wordPos === 1 || !isUpperCaseAtPos(wordPos - 2, word, wordLow))) {\n\t\t\t\t\t// hitting upper-case: `foo <-> forOthers`\n\t\t\t\t\t// ^^ ^\n\t\t\t\t\tif (pattern[patternPos - 1] === word[wordPos - 1]) {\n\t\t\t\t\t\tscore = 7;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscore = 5;\n\t\t\t\t\t}\n\t\t\t\t} else if (isSeparatorAtPos(wordLow, wordPos - 2) || isWhitespaceAtPos(wordLow, wordPos - 2)) {\n\t\t\t\t\t// post separator: `foo <-> bar_foo`\n\t\t\t\t\t// ^^^\n\t\t\t\t\tscore = 5;\n\n\t\t\t\t} else {\n\t\t\t\t\tscore = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_scores[patternPos][wordPos] = score;\n\n\t\t\tconst diag = _table[patternPos - 1][wordPos - 1] + (score > 1 ? 1 : score);\n\t\t\tconst top = _table[patternPos - 1][wordPos] + -1;\n\t\t\tconst left = _table[patternPos][wordPos - 1] + -1;\n\n\t\t\tif (left >= top) {\n\t\t\t\t// left or diag\n\t\t\t\tif (left > diag) {\n\t\t\t\t\t_table[patternPos][wordPos] = left;\n\t\t\t\t\t_arrows[patternPos][wordPos] = Arrow.Left;\n\t\t\t\t} else if (left === diag) {\n\t\t\t\t\t_table[patternPos][wordPos] = left;\n\t\t\t\t\t_arrows[patternPos][wordPos] = Arrow.Left | Arrow.Diag;\n\t\t\t\t} else {\n\t\t\t\t\t_table[patternPos][wordPos] = diag;\n\t\t\t\t\t_arrows[patternPos][wordPos] = Arrow.Diag;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// top or diag\n\t\t\t\tif (top > diag) {\n\t\t\t\t\t_table[patternPos][wordPos] = top;\n\t\t\t\t\t_arrows[patternPos][wordPos] = Arrow.Top;\n\t\t\t\t} else if (top === diag) {\n\t\t\t\t\t_table[patternPos][wordPos] = top;\n\t\t\t\t\t_arrows[patternPos][wordPos] = Arrow.Top | Arrow.Diag;\n\t\t\t\t} else {\n\t\t\t\t\t_table[patternPos][wordPos] = diag;\n\t\t\t\t\t_arrows[patternPos][wordPos] = Arrow.Diag;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (_debug) {\n\t\tconsole.log(printTable(_table, pattern, patternLen, word, wordLen));\n\t\tconsole.log(printTable(_arrows, pattern, patternLen, word, wordLen));\n\t\tconsole.log(printTable(_scores, pattern, patternLen, word, wordLen));\n\t}\n\n\t_matchesCount = 0;\n\t_topScore = -100;\n\t_patternStartPos = patternStartPos;\n\t_firstMatchCanBeWeak = firstMatchCanBeWeak;\n\t_findAllMatches2(patternLen, wordLen, patternLen === wordLen ? 1 : 0, 0, false);\n\tif (_matchesCount === 0) {\n\t\treturn undefined;\n\t}\n\n\treturn [_topScore, _topMatch2, wordStartPos];\n}\n\n\nlet _matchesCount: number = 0;\nlet _topMatch2: number = 0;\nlet _topScore: number = 0;\nlet _patternStartPos: number = 0;\nlet _firstMatchCanBeWeak: boolean = false;\n\nfunction _findAllMatches2(patternPos: number, wordPos: number, total: number, matches: number, lastMatched: boolean): void {\n\n\tif (_matchesCount >= 10 || total < -25) {\n\t\t// stop when having already 10 results, or\n\t\t// when a potential alignment as already 5 gaps\n\t\treturn;\n\t}\n\n\tlet simpleMatchCount = 0;\n\n\twhile (patternPos > _patternStartPos && wordPos > 0) {\n\n\t\tconst score = _scores[patternPos][wordPos];\n\t\tconst arrow = _arrows[patternPos][wordPos];\n\n\t\tif (arrow === Arrow.Left) {\n\t\t\t// left -> no match, skip a word character\n\t\t\twordPos -= 1;\n\t\t\tif (lastMatched) {\n\t\t\t\ttotal -= 5; // new gap penalty\n\t\t\t} else if (matches !== 0) {\n\t\t\t\ttotal -= 1; // gap penalty after first match\n\t\t\t}\n\t\t\tlastMatched = false;\n\t\t\tsimpleMatchCount = 0;\n\n\t\t} else if (arrow & Arrow.Diag) {\n\n\t\t\tif (arrow & Arrow.Left) {\n\t\t\t\t// left\n\t\t\t\t_findAllMatches2(\n\t\t\t\t\tpatternPos,\n\t\t\t\t\twordPos - 1,\n\t\t\t\t\tmatches !== 0 ? total - 1 : total, // gap penalty after first match\n\t\t\t\t\tmatches,\n\t\t\t\t\tlastMatched\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// diag\n\t\t\ttotal += score;\n\t\t\tpatternPos -= 1;\n\t\t\twordPos -= 1;\n\t\t\tlastMatched = true;\n\n\t\t\t// match -> set a 1 at the word pos\n\t\t\tmatches += 2 ** wordPos;\n\n\t\t\t// count simple matches and boost a row of\n\t\t\t// simple matches when they yield in a\n\t\t\t// strong match.\n\t\t\tif (score === 1) {\n\t\t\t\tsimpleMatchCount += 1;\n\n\t\t\t\tif (patternPos === _patternStartPos && !_firstMatchCanBeWeak) {\n\t\t\t\t\t// when the first match is a weak\n\t\t\t\t\t// match we discard it\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// boost\n\t\t\t\ttotal += 1 + (simpleMatchCount * (score - 1));\n\t\t\t\tsimpleMatchCount = 0;\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\ttotal -= wordPos >= 3 ? 9 : wordPos * 3; // late start penalty\n\n\t// dynamically keep track of the current top score\n\t// and insert the current best score at head, the rest at tail\n\t_matchesCount += 1;\n\tif (total > _topScore) {\n\t\t_topScore = total;\n\t\t_topMatch2 = matches;\n\t}\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 strings from 'vs/base/common/strings';\nimport * as extpath from 'vs/base/common/extpath';\nimport * as paths from 'vs/base/common/path';\nimport { LRUCache } from 'vs/base/common/map';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { isThenable } from 'vs/base/common/async';\n\nexport interface IExpression {\n\t[pattern: string]: boolean | SiblingClause;\n}\n\nexport interface IRelativePattern {\n\tbase: string;\n\tpattern: string;\n}\n\nexport interface SiblingClause {\n\twhen: string;\n}\n\nconst GLOBSTAR = '**';\nconst GLOB_SPLIT = '/';\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 = strings.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\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 += strings.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 trival glob patterns that just check for String#endsWith\nconst T1 = /^\\*\\*\\/\\*\\.[\\w\\.-]+$/; \t\t\t\t\t\t \t\t\t// **/*.something\nconst T2 = /^\\*\\*\\/([\\w\\.-]+)\\/?$/; \t\t\t\t\t\t\t \t\t\t// **/something\nconst T3 = /^{\\*\\*\\/[\\*\\.]?[\\w\\.-]+\\/?(,\\*\\*\\/[\\*\\.]?[\\w\\.-]+\\/?)*}$/; \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// **/something/else\nconst T5 = /^([\\w\\.-]+(\\/[\\w\\.-]+)*)\\/?$/; \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 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\t/**\n\t * Simplify patterns for use as exclusion filters during tree traversal to skip entire subtrees. Cannot be used 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 Trivias\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' && strings.endsWith(path, 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 (!extpath.isEqualOrParent(path, arg2.base)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn parsedPattern(paths.relative(arg2.base, path), basename);\n\t};\n}\n\nfunction trimForExclusions(pattern: string, options: IGlobOptions): string {\n\treturn options.trimForExclusions && strings.endsWith(pattern, '/**') ? 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 || strings.endsWith(path, slashBase) || strings.endsWith(path, 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 = arrays.first(parsedPatterns, 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(path: string, pattern: string, matchPathEnds: boolean): ParsedStringPattern {\n\tconst nativePath = paths.sep !== paths.posix.sep ? path.replace(ALL_FORWARD_SLASHES, paths.sep) : path;\n\tconst nativePathEnd = paths.sep + nativePath;\n\tconst parsedPattern: ParsedStringPattern = matchPathEnds ? function (path, basename) {\n\t\treturn typeof path === 'string' && (path === nativePath || strings.endsWith(path, nativePathEnd)) ? pattern : null;\n\t} : function (path, basename) {\n\t\treturn typeof path === 'string' && path === nativePath ? pattern : null;\n\t};\n\tparsedPattern.allPaths = [(matchPathEnds ? '*/' : './') + path];\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, basename: 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 * - * matches anything inside a path segment\n * - ? matches 1 character inside a path segment\n * - ** matches anything including an empty path segment\n * - simple brace expansion ({js,ts} => js or ts)\n * - character ranges (using [...])\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 * - * matches anything inside a path segment\n * - ? matches 1 character inside a path segment\n * - ** matches anything including an empty path segment\n * - simple brace expansion ({js,ts} => js or ts)\n * - character ranges (using [...])\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 = function (path: string, basename: string) {\n\t\t\treturn !!parsedPattern(path, basename);\n\t\t};\n\t\tif (parsedPattern.allBasenames) {\n\t\t\t(<ParsedStringPattern><any>resultPattern).allBasenames = parsedPattern.allBasenames;\n\t\t}\n\t\tif (parsedPattern.allPaths) {\n\t\t\t(<ParsedStringPattern><any>resultPattern).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;\n\n\treturn rp && 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 = arrays.first(parsedPatterns, 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, basename: 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 (!basename) {\n\t\t\t\t\tbasename = paths.basename(path);\n\t\t\t\t}\n\t\t\t\tif (!name) {\n\t\t\t\t\tname = basename.substr(0, basename.length - paths.extname(path).length);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst result = parsedPattern(path, basename, 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 = arrays.first(parsedPatterns, 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\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 { basename, posix } from 'vs/base/common/path';\nimport { endsWith, startsWithUTF8BOM } from 'vs/base/common/strings';\nimport { match } from 'vs/base/common/glob';\n\nexport const MIME_TEXT = 'text/plain';\nexport const MIME_UNKNOWN = 'application/unknown';\n\nexport interface ITextMimeAssociation {\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\treadonly userConfigured?: boolean;\n}\n\ninterface ITextMimeAssociationItem extends ITextMimeAssociation {\n\treadonly filenameLowercase?: string;\n\treadonly extensionLowercase?: string;\n\treadonly filepatternLowercase?: string;\n\treadonly filepatternOnPath?: boolean;\n}\n\nlet registeredAssociations: ITextMimeAssociationItem[] = [];\nlet nonUserRegisteredAssociations: ITextMimeAssociationItem[] = [];\nlet userRegisteredAssociations: ITextMimeAssociationItem[] = [];\n\n/**\n * Associate a text mime to the registry.\n */\nexport function registerTextMime(association: ITextMimeAssociation, warnOnOverwrite = false): void {\n\n\t// Register\n\tconst associationItem = toTextMimeAssociationItem(association);\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 toTextMimeAssociationItem(association: ITextMimeAssociation): ITextMimeAssociationItem {\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: association.userConfigured,\n\t\tfilenameLowercase: association.filename ? association.filename.toLowerCase() : undefined,\n\t\textensionLowercase: association.extension ? association.extension.toLowerCase() : undefined,\n\t\tfilepatternLowercase: association.filepattern ? association.filepattern.toLowerCase() : undefined,\n\t\tfilepatternOnPath: association.filepattern ? association.filepattern.indexOf(posix.sep) >= 0 : false\n\t};\n}\n\n/**\n * Given a file, return the best matching mime type for it\n */\nexport function guessMimeTypes(path: string | null, firstLine?: string): string[] {\n\tif (!path) {\n\t\treturn [MIME_UNKNOWN];\n\t}\n\n\tpath = path.toLowerCase();\n\tconst filename = basename(path);\n\n\t// 1.) User configured mappings have highest priority\n\tconst configuredMime = guessMimeTypeByPath(path, filename, userRegisteredAssociations);\n\tif (configuredMime) {\n\t\treturn [configuredMime, MIME_TEXT];\n\t}\n\n\t// 2.) Registered mappings have middle priority\n\tconst registeredMime = guessMimeTypeByPath(path, filename, nonUserRegisteredAssociations);\n\tif (registeredMime) {\n\t\treturn [registeredMime, MIME_TEXT];\n\t}\n\n\t// 3.) Firstline has lowest priority\n\tif (firstLine) {\n\t\tconst firstlineMime = guessMimeTypeByFirstline(firstLine);\n\t\tif (firstlineMime) {\n\t\t\treturn [firstlineMime, MIME_TEXT];\n\t\t}\n\t}\n\n\treturn [MIME_UNKNOWN];\n}\n\nfunction guessMimeTypeByPath(path: string, filename: string, associations: ITextMimeAssociationItem[]): string | null {\n\tlet filenameMatch: ITextMimeAssociationItem | null = null;\n\tlet patternMatch: ITextMimeAssociationItem | null = null;\n\tlet extensionMatch: ITextMimeAssociationItem | null = null;\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 (match(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 (endsWith(filename, 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 prio\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 null;\n}\n\nfunction guessMimeTypeByFirstline(firstLine: string): string | null {\n\tif (startsWithUTF8BOM(firstLine)) {\n\t\tfirstLine = firstLine.substr(1);\n\t}\n\n\tif (firstLine.length > 0) {\n\t\tfor (const association of registeredAssociations) {\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 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\nconst _typeof = {\n\tnumber: 'number',\n\tstring: 'string',\n\tundefined: 'undefined',\n\tobject: 'object',\n\tfunction: 'function'\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\tif (Array.isArray) {\n\t\treturn Array.isArray(array);\n\t}\n\n\tif (array && typeof (array.length) === _typeof.number && array.constructor === Array) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript String or not.\n */\nexport function isString(str: any): str is string {\n\tif (typeof (str) === _typeof.string || str instanceof String) {\n\t\treturn true;\n\t}\n\n\treturn false;\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: any): 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 === _typeof.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: any): obj is number {\n\tif ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript Boolean or not.\n */\nexport function isBoolean(obj: any): 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: any): obj is undefined {\n\treturn typeof (obj) === _typeof.undefined;\n}\n\n/**\n * @returns whether the provided parameter is undefined or null.\n */\nexport function isUndefinedOrNull(obj: any): obj is undefined | null {\n\treturn isUndefined(obj) || obj === null;\n}\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * @returns whether the provided parameter is an empty JavaScript Object or not.\n */\nexport function isEmptyObject(obj: any): obj is any {\n\tif (!isObject(obj)) {\n\t\treturn false;\n\t}\n\n\tfor (let key in obj) {\n\t\tif (hasOwnProperty.call(obj, key)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript Function or not.\n */\nexport function isFunction(obj: any): obj is Function {\n\treturn typeof obj === _typeof.function;\n}\n\nexport type TypeConstraint = string | Function;\n\nexport function validateConstraints(args: any[], 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: any, 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.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\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\n/**\n * Converts undefined to null, passes all other values through.\n */\nexport function withUndefinedAsNull<T>(x: T | undefined): T | null {\n\treturn typeof x === 'undefined' ? null : x;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isObject, isUndefinedOrNull, isArray } 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(obj).forEach((key: string) => {\n\t\tif (obj[key] && typeof obj[key] === 'object') {\n\t\t\tresult[key] = deepClone(obj[key]);\n\t\t} else {\n\t\t\tresult[key] = 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 assign<T>(destination: T): T;\nexport function assign<T, U>(destination: T, u: U): T & U;\nexport function assign<T, U, V>(destination: T, u: U, v: V): T & U & V;\nexport function assign<T, U, V, W>(destination: T, u: U, v: V, w: W): T & U & V & W;\nexport function assign(destination: any, ...sources: any[]): any {\n\tsources.forEach(source => Object.keys(source).forEach(key => destination[key] = source[key]));\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\nimport * as objects from 'vs/base/common/objects';\nimport { renderOcticons } from 'vs/base/browser/ui/octiconLabel/octiconLabel';\nimport { escape } from 'vs/base/common/strings';\n\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n}\n\nexport class HighlightedLabel {\n\n\tprivate domNode: HTMLElement;\n\tprivate text: string;\n\tprivate title: string;\n\tprivate highlights: IHighlight[];\n\tprivate didEverRender: boolean;\n\n\tconstructor(container: HTMLElement, private supportOcticons: boolean) {\n\t\tthis.domNode = document.createElement('span');\n\t\tthis.domNode.className = 'monaco-highlighted-label';\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(text: string | undefined, highlights: IHighlight[] = [], title: string = '', escapeNewLines?: boolean) {\n\t\tif (!text) {\n\t\t\ttext = '';\n\t\t}\n\t\tif (escapeNewLines) {\n\t\t\t// adjusts highlights inplace\n\t\t\ttext = HighlightedLabel.escapeNewLines(text, highlights);\n\t\t}\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\tif (!Array.isArray(highlights)) {\n\t\t\thighlights = [];\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\tlet htmlContent = '';\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\t\t\tif (pos < highlight.start) {\n\t\t\t\thtmlContent += '<span>';\n\t\t\t\tconst substring = this.text.substring(pos, highlight.start);\n\t\t\t\thtmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);\n\t\t\t\thtmlContent += '</span>';\n\t\t\t\tpos = highlight.end;\n\t\t\t}\n\t\t\thtmlContent += '<span class=\"highlight\">';\n\t\t\tconst substring = this.text.substring(highlight.start, highlight.end);\n\t\t\thtmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);\n\t\t\thtmlContent += '</span>';\n\t\t\tpos = highlight.end;\n\t\t}\n\n\t\tif (pos < this.text.length) {\n\t\t\thtmlContent += '<span>';\n\t\t\tconst substring = this.text.substring(pos);\n\t\t\thtmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);\n\t\t\thtmlContent += '</span>';\n\t\t}\n\n\t\tthis.domNode.innerHTML = htmlContent;\n\t\tthis.domNode.title = this.title;\n\t\tthis.didEverRender = true;\n\t}\n\n\tstatic escapeNewLines(text: string, highlights: IHighlight[]): string {\n\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 { isWindows } from 'vs/base/common/platform';\nimport { CharCode } from 'vs/base/common/charCode';\n\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\nconst _singleSlashStart = /^\\//;\nconst _doubleSlashStart = /^\\/\\//;\n\nlet _throwOnMissingSchema: boolean = true;\n\nfunction _validateUri(ret: URI, _strict?: boolean): void {\n\n\t// scheme, must be set\n\tif (!ret.scheme) {\n\t\tif (_strict || _throwOnMissingSchema) {\n\t\t\tthrow new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\n\t\t} else {\n\t\t\tconsole.warn(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\n\t\t}\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 (_strict || _throwOnMissingSchema) {\n\t\treturn scheme || _empty;\n\t}\n\tif (!scheme) {\n\t\tconsole.trace('BAD uri lacks scheme, falling back to file-scheme.');\n\t\tscheme = '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 * 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 */\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 === 'function'\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.msft.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.msft.com' part of 'http://www.msft.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.msft.com/some/path?query#fragment'.\n\t */\n\treadonly path: string;\n\n\t/**\n\t * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.\n\t */\n\treadonly query: string;\n\n\t/**\n\t * fragment is the 'fragment' part of 'http://www.msft.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 _makeFsPath(this);\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.msft.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\tdecodeURIComponent(match[4] || _empty),\n\t\t\tdecodeURIComponent(match[5] || _empty),\n\t\t\tdecodeURIComponent(match[7] || _empty),\n\t\t\tdecodeURIComponent(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\treturn 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}\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._fsPath = (<UriState>data).fsPath;\n\t\t\tresult._formatted = (<UriState>data).external;\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: number;\n\tfsPath: string;\n\texternal: string;\n}\n\n\n// tslint:disable-next-line:class-name\nclass _URI extends URI {\n\n\t_formatted: string | null = null;\n\t_fsPath: string | null = null;\n\n\tget fsPath(): string {\n\t\tif (!this._fsPath) {\n\t\t\tthis._fsPath = _makeFsPath(this);\n\t\t}\n\t\treturn this._fsPath;\n\t}\n\n\ttoString(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\ttoJSON(): UriComponents {\n\t\tconst res = <UriState>{\n\t\t\t$mid: 1\n\t\t};\n\t\t// cached state\n\t\tif (this._fsPath) {\n\t\t\tres.fsPath = this._fsPath;\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 */\nfunction _makeFsPath(uri: URI): 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\t// windows drive letter: file:///c:/far/boo\n\t\tvalue = uri.path[1].toLowerCase() + uri.path.substr(2);\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 * Copyright (c) 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';\n\nexport function parse(text: string): any {\n\tlet data = JSON.parse(text);\n\tdata = revive(data, 0);\n\treturn data;\n}\n\nexport interface MarshalledObject {\n\t$mid: number;\n}\n\nexport function revive(obj: any, depth: number): any {\n\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 1: return URI.revive(obj);\n\t\t\tcase 2: return new RegExp(obj.source, obj.flags);\n\t\t}\n\n\t\t// walk object (or array)\n\t\tfor (let key in obj) {\n\t\t\tif (Object.hasOwnProperty.call(obj, key)) {\n\t\t\t\tobj[key] = revive(obj[key], depth + 1);\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 DOM from 'vs/base/browser/dom';\nimport { defaultGenerator } from 'vs/base/common/idGenerator';\nimport { escape } from 'vs/base/common/strings';\nimport { removeMarkdownEscapes, IMarkdownString } from 'vs/base/common/htmlContent';\nimport * as marked from 'vs/base/common/marked/marked';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { parse } from 'vs/base/common/marshalling';\nimport { cloneAndChange } from 'vs/base/common/objects';\n\nexport interface IContentActionHandler {\n\tcallback: (content: string, event?: IMouseEvent) => void;\n\tdisposeables: IDisposable[];\n}\n\nexport interface RenderOptions {\n\tclassName?: string;\n\tinline?: boolean;\n\tactionHandler?: IContentActionHandler;\n\tcodeBlockRenderer?: (modeId: string, value: string) => Promise<string>;\n\tcodeBlockRenderCallback?: () => void;\n}\n\nfunction createElement(options: RenderOptions): 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\nexport function renderText(text: string, options: RenderOptions = {}): HTMLElement {\n\tconst element = createElement(options);\n\telement.textContent = text;\n\treturn element;\n}\n\nexport function renderFormattedText(formattedText: string, options: RenderOptions = {}): HTMLElement {\n\tconst element = createElement(options);\n\t_renderFormattedText(element, parseFormattedText(formattedText), options.actionHandler);\n\treturn element;\n}\n\n/**\n * Create html nodes for the given content element.\n */\nexport function renderMarkdown(markdown: IMarkdownString, options: RenderOptions = {}): HTMLElement {\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): string {\n\t\tconst data = markdown.uris && markdown.uris[href];\n\t\tif (!data) {\n\t\t\treturn href;\n\t\t}\n\t\tlet uri = URI.revive(data);\n\t\tif (uri.query) {\n\t\t\turi = uri.with({ query: _uriMassage(uri.query) });\n\t\t}\n\t\tif (data) {\n\t\t\thref = uri.toString(true);\n\t\t}\n\t\treturn href;\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(c => signalInnerHTML = c);\n\n\tconst renderer = new marked.Renderer();\n\trenderer.image = (href: string, title: string, text: string) => {\n\t\thref = _href(href);\n\t\tlet dimensions: string[] = [];\n\t\tif (href) {\n\t\t\tconst splitted = href.split('|').map(s => s.trim());\n\t\t\thref = splitted[0];\n\t\t\tconst parameters = splitted[1];\n\t\t\tif (parameters) {\n\t\t\t\tconst heightFromParams = /height=(\\d+)/.exec(parameters);\n\t\t\t\tconst widthFromParams = /width=(\\d+)/.exec(parameters);\n\t\t\t\tconst height = heightFromParams ? heightFromParams[1] : '';\n\t\t\t\tconst width = widthFromParams ? widthFromParams[1] : '';\n\t\t\t\tconst widthIsFinite = isFinite(parseInt(width));\n\t\t\t\tconst heightIsFinite = isFinite(parseInt(height));\n\t\t\t\tif (widthIsFinite) {\n\t\t\t\t\tdimensions.push(`width=\"${width}\"`);\n\t\t\t\t}\n\t\t\t\tif (heightIsFinite) {\n\t\t\t\t\tdimensions.push(`height=\"${height}\"`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlet attributes: string[] = [];\n\t\tif (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\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);\n\t\ttitle = removeMarkdownEscapes(title);\n\t\thref = removeMarkdownEscapes(href);\n\t\tif (\n\t\t\t!href\n\t\t\t|| href.match(/^data:|javascript:/i)\n\t\t\t|| (href.match(/^command:/i) && !markdown.isTrusted)\n\t\t\t|| href.match(/^command:(\\/\\/\\/)?_workbench\\.downloadResource/i)\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 href=\"#\" 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\tconst promise = Promise.all([value, withInnerHTML]).then(values => {\n\t\t\t\tconst strValue = values[0];\n\t\t\t\tconst span = element.querySelector(`div[data-code=\"${id}\"]`);\n\t\t\t\tif (span) {\n\t\t\t\t\tspan.innerHTML = strValue;\n\t\t\t\t}\n\t\t\t}).catch(err => {\n\t\t\t\t// ignore\n\t\t\t});\n\n\t\t\tif (options.codeBlockRenderCallback) {\n\t\t\t\tpromise.then(options.codeBlockRenderCallback);\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\toptions.actionHandler.disposeables.push(DOM.addStandardDisposableListener(element, 'click', event => {\n\t\t\tlet target: HTMLElement | null = event.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\tconst href = target.dataset['href'];\n\t\t\t\tif (href) {\n\t\t\t\t\toptions.actionHandler!.callback(href, event);\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\tevent.preventDefault();\n\t\t\t}\n\t\t}));\n\t}\n\n\tconst markedOptions: marked.MarkedOptions = {\n\t\tsanitize: true,\n\t\trenderer\n\t};\n\n\telement.innerHTML = marked.parse(markdown.value, markedOptions);\n\tsignalInnerHTML!();\n\n\treturn element;\n}\n\n// --- formatted string parsing\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\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) {\n\tlet child: Node | undefined;\n\n\tif (treeNode.type === FormatType.Text) {\n\t\tchild = document.createTextNode(treeNode.content || '');\n\t}\n\telse if (treeNode.type === FormatType.Bold) {\n\t\tchild = document.createElement('b');\n\t}\n\telse if (treeNode.type === FormatType.Italics) {\n\t\tchild = document.createElement('i');\n\t}\n\telse if (treeNode.type === FormatType.Action && actionHandler) {\n\t\tconst a = document.createElement('a');\n\t\ta.href = '#';\n\t\tactionHandler.disposeables.push(DOM.addStandardDisposableListener(a, 'click', (event) => {\n\t\t\tactionHandler.callback(String(treeNode.index), event);\n\t\t}));\n\n\t\tchild = a;\n\t}\n\telse if (treeNode.type === FormatType.NewLine) {\n\t\tchild = document.createElement('br');\n\t}\n\telse 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);\n\t\t});\n\t}\n}\n\nfunction parseFormattedText(content: string): IFormatParseTree {\n\n\tconst root: IFormatParseTree = {\n\t\ttype: FormatType.Root,\n\t\tchildren: []\n\t};\n\n\tlet actionItemIndex = 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()) !== 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) && 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);\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 = actionItemIndex;\n\t\t\t\t\tactionItemIndex++;\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): boolean {\n\treturn formatTagType(char) !== FormatType.Invalid;\n}\n\nfunction formatTagType(char: string): 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\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 extpath from 'vs/base/common/extpath';\nimport * as paths from 'vs/base/common/path';\nimport { URI } from 'vs/base/common/uri';\nimport { equalsIgnoreCase } from 'vs/base/common/strings';\nimport { Schemas } from 'vs/base/common/network';\nimport { isLinux, isWindows } from 'vs/base/common/platform';\nimport { CharCode } from 'vs/base/common/charCode';\n\nexport function hasToIgnoreCase(resource: URI | undefined): boolean {\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 resource && resource.scheme === Schemas.file ? !isLinux : true;\n}\n\nexport function basenameOrAuthority(resource: URI): string {\n\treturn basename(resource) || resource.authority;\n}\n\n/**\n * Tests wheter the two authorities are the same\n */\nexport function isEqualAuthority(a1: string, a2: string) {\n\treturn a1 === a2 || equalsIgnoreCase(a1, a2);\n}\n\nexport function isEqual(first: URI | undefined, second: URI | undefined, ignoreCase = hasToIgnoreCase(first)): boolean {\n\tif (first === second) {\n\t\treturn true;\n\t}\n\n\tif (!first || !second) {\n\t\treturn false;\n\t}\n\n\tif (first.scheme !== second.scheme || !isEqualAuthority(first.authority, second.authority)) {\n\t\treturn false;\n\t}\n\n\tconst p1 = first.path || '/', p2 = second.path || '/';\n\treturn p1 === p2 || ignoreCase && equalsIgnoreCase(p1 || '/', p2 || '/');\n}\n\nexport function basename(resource: URI): string {\n\treturn paths.posix.basename(resource.path);\n}\n\n/**\n * Return a URI representing the directory of a URI path.\n *\n * @param resource The input URI.\n * @returns The URI representing the directory of the input URI.\n */\nexport function dirname(resource: URI): URI {\n\tif (resource.path.length === 0) {\n\t\treturn resource;\n\t}\n\tif (resource.scheme === Schemas.file) {\n\t\treturn URI.file(paths.dirname(originalFSPath(resource)));\n\t}\n\tlet dirname = paths.posix.dirname(resource.path);\n\tif (resource.authority && dirname.length && dirname.charCodeAt(0) !== CharCode.Slash) {\n\t\tconsole.error(`dirname(\"${resource.toString})) resulted in a relative path`);\n\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}\n\treturn resource.with({\n\t\tpath: dirname\n\t});\n}\n\n/**\n * Join a URI path with path fragments and normalizes the resulting path.\n *\n * @param resource The input URI.\n * @param pathFragment The path fragment to add to the URI path.\n * @returns The resulting URI.\n */\nexport function joinPath(resource: URI, ...pathFragment: string[]): URI {\n\tlet joinedPath: string;\n\tif (resource.scheme === Schemas.file) {\n\t\tjoinedPath = URI.file(paths.join(originalFSPath(resource), ...pathFragment)).path;\n\t} else {\n\t\tjoinedPath = paths.posix.join(resource.path || '/', ...pathFragment);\n\t}\n\treturn resource.with({\n\t\tpath: joinedPath\n\t});\n}\n\n/**\n * Normalizes the path part of a URI: Resolves `.` and `..` elements with directory names.\n *\n * @param resource The URI to normalize the path.\n * @returns The URI with the normalized path.\n */\nexport function normalizePath(resource: URI): URI {\n\tif (!resource.path.length) {\n\t\treturn resource;\n\t}\n\tlet normalizedPath: string;\n\tif (resource.scheme === Schemas.file) {\n\t\tnormalizedPath = URI.file(paths.normalize(originalFSPath(resource))).path;\n\t} else {\n\t\tnormalizedPath = paths.posix.normalize(resource.path);\n\t}\n\treturn resource.with({\n\t\tpath: normalizedPath\n\t});\n}\n\n/**\n * Returns the fsPath of an URI where the drive letter is not normalized.\n * See #56403.\n */\nexport function originalFSPath(uri: URI): string {\n\tlet value: string;\n\tconst uriPath = uri.path;\n\tif (uri.authority && uriPath.length > 1 && uri.scheme === Schemas.file) {\n\t\t// unc path: file://shares/c$/far/boo\n\t\tvalue = `//${uri.authority}${uriPath}`;\n\t} else if (\n\t\tisWindows\n\t\t&& uriPath.charCodeAt(0) === CharCode.Slash\n\t\t&& extpath.isWindowsDriveLetter(uriPath.charCodeAt(1))\n\t\t&& uriPath.charCodeAt(2) === CharCode.Colon\n\t) {\n\t\tvalue = uriPath.substr(1);\n\t} else {\n\t\t// other path\n\t\tvalue = uriPath;\n\t}\n\tif (isWindows) {\n\t\tvalue = value.replace(/\\//g, '\\\\');\n\t}\n\treturn value;\n}\n\n\n/**\n * Returns a relative path between two URIs. If the URIs don't have the same schema or authority, `undefined` is returned.\n * The returned relative path always uses forward slashes.\n */\nexport function relativePath(from: URI, to: URI): string | undefined {\n\tif (from.scheme !== to.scheme || !isEqualAuthority(from.authority, to.authority)) {\n\t\treturn undefined;\n\t}\n\tif (from.scheme === Schemas.file) {\n\t\tconst relativePath = paths.relative(from.path, to.path);\n\t\treturn isWindows ? extpath.toSlashes(relativePath) : relativePath;\n\t}\n\treturn paths.posix.relative(from.path || '/', to.path || '/');\n}\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 * Copyright (c) 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 { posix, normalize } from 'vs/base/common/path';\nimport { startsWithIgnoreCase, rtrim, startsWith } from 'vs/base/common/strings';\nimport { Schemas } from 'vs/base/common/network';\nimport { isLinux, isWindows } from 'vs/base/common/platform';\nimport { isEqual, basename, relativePath } from 'vs/base/common/resources';\n\nexport interface IWorkspaceFolderProvider {\n\tgetWorkspaceFolder(resource: URI): { uri: URI, name?: string } | null;\n\tgetWorkspace(): {\n\t\tfolders: { uri: URI, name?: string }[];\n\t};\n}\n\nexport interface IUserHomeProvider {\n\tuserHome: string;\n}\n\n/**\n * @deprecated use LabelService instead\n */\nexport function getPathLabel(resource: URI | string, userHomeProvider?: IUserHomeProvider, rootProvider?: IWorkspaceFolderProvider): string {\n\tif (typeof resource === 'string') {\n\t\tresource = URI.file(resource);\n\t}\n\n\t// return early if we can resolve a relative path label from the root\n\tif (rootProvider) {\n\t\tconst baseResource = rootProvider.getWorkspaceFolder(resource);\n\t\tif (baseResource) {\n\t\t\tconst hasMultipleRoots = rootProvider.getWorkspace().folders.length > 1;\n\n\t\t\tlet pathLabel: string;\n\t\t\tif (isEqual(baseResource.uri, resource)) {\n\t\t\t\tpathLabel = ''; // no label if paths are identical\n\t\t\t} else {\n\t\t\t\tpathLabel = relativePath(baseResource.uri, resource)!;\n\t\t\t}\n\n\t\t\tif (hasMultipleRoots) {\n\t\t\t\tconst rootName = (baseResource && baseResource.name) ? baseResource.name : basename(baseResource.uri);\n\t\t\t\tpathLabel = pathLabel ? (rootName + ' • ' + pathLabel) : rootName; // always show root basename if there are multiple\n\t\t\t}\n\n\t\t\treturn pathLabel;\n\t\t}\n\t}\n\n\t// return if the resource is neither file:// nor untitled:// and no baseResource was provided\n\tif (resource.scheme !== Schemas.file && resource.scheme !== Schemas.untitled) {\n\t\treturn resource.with({ query: null, fragment: null }).toString(true);\n\t}\n\n\t// convert c:\\something => C:\\something\n\tif (hasDriveLetter(resource.fsPath)) {\n\t\treturn normalize(normalizeDriveLetter(resource.fsPath));\n\t}\n\n\t// normalize and tildify (macOS, Linux only)\n\tlet res = normalize(resource.fsPath);\n\tif (!isWindows && userHomeProvider) {\n\t\tres = tildify(res, userHomeProvider.userHome);\n\t}\n\n\treturn res;\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 (hasDriveLetter(base)) {\n\t\treturn normalizeDriveLetter(base);\n\t}\n\n\treturn base;\n}\n\nfunction hasDriveLetter(path: string): boolean {\n\treturn !!(isWindows && path && path[1] === ':');\n}\n\nexport function normalizeDriveLetter(path: string): string {\n\tif (hasDriveLetter(path)) {\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);\nexport function tildify(path: string, userHome: string): string {\n\tif (isWindows || !path || !userHome) {\n\t\treturn path; // unsupported\n\t}\n\n\t// Keep a normalized user home path as cache to prevent accumulated string creation\n\tlet normalizedUserHome = normalizedUserHomeCached.original === userHome ? normalizedUserHomeCached.normalized : undefined;\n\tif (!normalizedUserHome) {\n\t\tnormalizedUserHome = `${rtrim(userHome, posix.sep)}${posix.sep}`;\n\t\tnormalizedUserHomeCached = { original: userHome, normalized: normalizedUserHome };\n\t}\n\n\t// Linux: case sensitive, macOS: case insensitive\n\tif (isLinux ? startsWith(path, normalizedUserHome) : startsWithIgnoreCase(path, normalizedUserHome)) {\n\t\tpath = `~/${path.substr(normalizedUserHome.length)}`;\n\t}\n\n\treturn path;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Disposable } from 'vs/base/common/lifecycle';\nimport { isWeb } from 'vs/base/common/platform';\nimport { getAllPropertyNames } from 'vs/base/common/types';\n\nconst INITIALIZE = '$initialize';\n\nexport interface IWorker {\n\tgetId(): number;\n\tpostMessage(message: string): void;\n\tdispose(): void;\n}\n\nexport interface IWorkerCallback {\n\t(message: string): 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\ninterface IMessage {\n\tvsWorker: number;\n\tseq?: string;\n}\n\ninterface IRequestMessage extends IMessage {\n\treq: string;\n\tmethod: string;\n\targs: any[];\n}\n\ninterface IReplyMessage extends IMessage {\n\tseq: string;\n\terr: any;\n\tres: any;\n}\n\ninterface IMessageReply {\n\tresolve: (value?: any) => void;\n\treject: (error?: any) => void;\n}\n\ninterface IMessageHandler {\n\tsendMessage(msg: string): void;\n\thandleMessage(method: string, args: any[]): Promise<any>;\n}\n\nclass SimpleWorkerProtocol {\n\n\tprivate _workerId: number;\n\tprivate _lastSentReq: number;\n\tprivate _pendingReplies: { [req: string]: IMessageReply; };\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}\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\tlet 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({\n\t\t\t\tvsWorker: this._workerId,\n\t\t\t\treq: req,\n\t\t\t\tmethod: method,\n\t\t\t\targs: args\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic handleMessage(serializedMessage: string): void {\n\t\tlet message: IMessage;\n\t\ttry {\n\t\t\tmessage = JSON.parse(serializedMessage);\n\t\t} catch (e) {\n\t\t\t// nothing\n\t\t\treturn;\n\t\t}\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: IMessage): void {\n\t\tif (msg.seq) {\n\t\t\tlet replyMessage = <IReplyMessage>msg;\n\t\t\tif (!this._pendingReplies[replyMessage.seq]) {\n\t\t\t\tconsole.warn('Got reply to unknown seq');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet reply = this._pendingReplies[replyMessage.seq];\n\t\t\tdelete this._pendingReplies[replyMessage.seq];\n\n\t\t\tif (replyMessage.err) {\n\t\t\t\tlet err = replyMessage.err;\n\t\t\t\tif (replyMessage.err.$isError) {\n\t\t\t\t\terr = new Error();\n\t\t\t\t\terr.name = replyMessage.err.name;\n\t\t\t\t\terr.message = replyMessage.err.message;\n\t\t\t\t\terr.stack = replyMessage.err.stack;\n\t\t\t\t}\n\t\t\t\treply.reject(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treply.resolve(replyMessage.res);\n\t\t\treturn;\n\t\t}\n\n\t\tlet requestMessage = <IRequestMessage>msg;\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({\n\t\t\t\tvsWorker: this._workerId,\n\t\t\t\tseq: req,\n\t\t\t\tres: r,\n\t\t\t\terr: undefined\n\t\t\t});\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({\n\t\t\t\tvsWorker: this._workerId,\n\t\t\t\tseq: req,\n\t\t\t\tres: undefined,\n\t\t\t\terr: transformErrorForSerialization(e)\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate _send(msg: IRequestMessage | IReplyMessage): void {\n\t\tlet strMsg = JSON.stringify(msg);\n\t\t// console.log('SENDING: ' + strMsg);\n\t\tthis._handler.sendMessage(strMsg);\n\t}\n}\n\n/**\n * Main thread side\n */\nexport class SimpleWorkerClient<T> extends Disposable {\n\n\tprivate _worker: IWorker;\n\tprivate _onModuleLoaded: Promise<string[]>;\n\tprivate _protocol: SimpleWorkerProtocol;\n\tprivate _lazyProxy: Promise<T>;\n\n\tconstructor(workerFactory: IWorkerFactory, moduleId: string) {\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: string) => {\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: string): void => {\n\t\t\t\tthis._worker.postMessage(msg);\n\t\t\t},\n\t\t\thandleMessage: (method: string, args: any[]): Promise<any> => {\n\t\t\t\t// Intentionally not supporting worker -> main requests\n\t\t\t\treturn Promise.resolve(null);\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 (<any>self).require !== 'undefined' && typeof (<any>self).require.getConfig === 'function') {\n\t\t\t// Get the configuration from the Monaco AMD Loader\n\t\t\tloaderConfiguration = (<any>self).require.getConfig();\n\t\t} else if (typeof (<any>self).requirejs !== 'undefined') {\n\t\t\t// Get the configuration from requirejs\n\t\t\tloaderConfiguration = (<any>self).requirejs.s.contexts._.config;\n\t\t}\n\n\t\t// Send initialize message\n\t\tthis._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\n\t\t\tthis._worker.getId(),\n\t\t\tmoduleId,\n\t\t\tloaderConfiguration\n\t\t]);\n\n\t\tthis._lazyProxy = new Promise<T>((resolve, reject) => {\n\t\t\tlazyProxyReject = reject;\n\t\t\tthis._onModuleLoaded.then((availableMethods: string[]) => {\n\t\t\t\tlet proxy = <T>{};\n\t\t\t\tfor (const methodName of availableMethods) {\n\t\t\t\t\t(proxy as any)[methodName] = createProxyMethod(methodName, proxyMethodRequest);\n\t\t\t\t}\n\t\t\t\tresolve(proxy);\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\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\n\t\tconst createProxyMethod = (method: string, proxyMethodRequest: (method: string, args: any[]) => Promise<any>): () => Promise<any> => {\n\t\t\treturn function () {\n\t\t\t\tlet args = Array.prototype.slice.call(arguments, 0);\n\t\t\t\treturn proxyMethodRequest(method, args);\n\t\t\t};\n\t\t};\n\t}\n\n\tpublic getProxyObject(): Promise<T> {\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\nexport interface IRequestHandler {\n\t_requestHandlerBrand: any;\n\t[prop: string]: any;\n}\n\n/**\n * Worker side\n */\nexport class SimpleWorkerServer {\n\n\tprivate _requestHandler: IRequestHandler | null;\n\tprivate _protocol: SimpleWorkerProtocol;\n\n\tconstructor(postSerializedMessage: (msg: string) => void, requestHandler: IRequestHandler | null) {\n\t\tthis._requestHandler = requestHandler;\n\t\tthis._protocol = new SimpleWorkerProtocol({\n\t\t\tsendMessage: (msg: string): void => {\n\t\t\t\tpostSerializedMessage(msg);\n\t\t\t},\n\t\t\thandleMessage: (method: string, args: any[]): Promise<any> => this._handleMessage(method, args)\n\t\t});\n\t}\n\n\tpublic onmessage(msg: string): 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], <string>args[1], <any>args[2]);\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 initialize(workerId: number, moduleId: string, loaderConfig: any): Promise<string[]> {\n\t\tthis._protocol.setWorkerId(workerId);\n\n\t\tif (this._requestHandler) {\n\t\t\t// static request handler\n\t\t\tlet methods: string[] = [];\n\t\t\tfor (const prop of getAllPropertyNames(this._requestHandler)) {\n\t\t\t\tif (typeof this._requestHandler[prop] === 'function') {\n\t\t\t\t\tmethods.push(prop);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Promise.resolve(methods);\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\n\t\t\t// Since this is in a web worker, enable catching errors\n\t\t\tloaderConfig.catchError = true;\n\t\t\t(<any>self).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\t\t\t(<any>self).require([moduleId], (...result: any[]) => {\n\t\t\t\tlet handlerModule = result[0];\n\t\t\t\tthis._requestHandler = handlerModule.create();\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\tlet methods: string[] = [];\n\t\t\t\tfor (const prop of getAllPropertyNames(this._requestHandler)) {\n\t\t\t\t\tif (typeof this._requestHandler[prop] === 'function') {\n\t\t\t\t\t\tmethods.push(prop);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tresolve(methods);\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: string) => void): SimpleWorkerServer {\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 { isFunction } from 'vs/base/common/types';\nimport { ITree, IRenderer, IFilter, IDataSource, IAccessibilityProvider } from 'vs/base/parts/tree/browser/tree';\nimport { IModel } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { IQuickOpenStyles } from 'vs/base/parts/quickopen/browser/quickOpenWidget';\n\nexport interface IModelProvider {\n\tgetModel<T>(): IModel<T>;\n}\n\nexport class DataSource implements IDataSource {\n\n\tprivate modelProvider: IModelProvider;\n\n\tconstructor(model: IModel<any>);\n\tconstructor(modelProvider: IModelProvider);\n\tconstructor(arg: any) {\n\t\tthis.modelProvider = isFunction(arg.getModel) ? arg : { getModel: () => arg };\n\t}\n\n\tgetId(tree: ITree, element: any): string {\n\t\tif (!element) {\n\t\t\treturn null!;\n\t\t}\n\n\t\tconst model = this.modelProvider.getModel();\n\t\treturn model === element ? '__root__' : model.dataSource.getId(element);\n\t}\n\n\thasChildren(tree: ITree, element: any): boolean {\n\t\tconst model = this.modelProvider.getModel();\n\t\treturn !!(model && model === element && model.entries.length > 0);\n\t}\n\n\tgetChildren(tree: ITree, element: any): Promise<any[]> {\n\t\tconst model = this.modelProvider.getModel();\n\t\treturn Promise.resolve(model === element ? model.entries : []);\n\t}\n\n\tgetParent(tree: ITree, element: any): Promise<any> {\n\t\treturn Promise.resolve(null);\n\t}\n}\n\nexport class AccessibilityProvider implements IAccessibilityProvider {\n\tconstructor(private modelProvider: IModelProvider) { }\n\n\tgetAriaLabel(tree: ITree, element: any): string | null {\n\t\tconst model = this.modelProvider.getModel();\n\n\t\treturn model.accessibilityProvider ? model.accessibilityProvider.getAriaLabel(element) : null;\n\t}\n\n\tgetPosInSet(tree: ITree, element: any): string {\n\t\tconst model = this.modelProvider.getModel();\n\t\tlet i = 0;\n\t\tif (model.filter) {\n\t\t\tfor (const entry of model.entries) {\n\t\t\t\tif (model.filter.isVisible(entry)) {\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (entry === element) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\ti = model.entries.indexOf(element) + 1;\n\t\t}\n\t\treturn String(i);\n\t}\n\n\tgetSetSize(): string {\n\t\tconst model = this.modelProvider.getModel();\n\t\tlet n = 0;\n\t\tif (model.filter) {\n\t\t\tfor (const entry of model.entries) {\n\t\t\t\tif (model.filter.isVisible(entry)) {\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tn = model.entries.length;\n\t\t}\n\t\treturn String(n);\n\t}\n}\n\nexport class Filter implements IFilter {\n\n\tconstructor(private modelProvider: IModelProvider) { }\n\n\tisVisible(tree: ITree, element: any): boolean {\n\t\tconst model = this.modelProvider.getModel();\n\n\t\tif (!model.filter) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn model.filter.isVisible(element);\n\t}\n}\n\nexport class Renderer implements IRenderer {\n\tprivate styles: IQuickOpenStyles;\n\n\tconstructor(private modelProvider: IModelProvider, styles: IQuickOpenStyles) {\n\t\tthis.styles = styles;\n\t}\n\n\tupdateStyles(styles: IQuickOpenStyles): void {\n\t\tthis.styles = styles;\n\t}\n\n\tgetHeight(tree: ITree, element: any): number {\n\t\tconst model = this.modelProvider.getModel();\n\t\treturn model.renderer.getHeight(element);\n\t}\n\n\tgetTemplateId(tree: ITree, element: any): string {\n\t\tconst model = this.modelProvider.getModel();\n\t\treturn model.renderer.getTemplateId(element);\n\t}\n\n\trenderTemplate(tree: ITree, templateId: string, container: HTMLElement): any {\n\t\tconst model = this.modelProvider.getModel();\n\t\treturn model.renderer.renderTemplate(templateId, container, this.styles);\n\t}\n\n\trenderElement(tree: ITree, element: any, templateId: string, templateData: any): void {\n\t\tconst model = this.modelProvider.getModel();\n\t\tmodel.renderer.renderElement(element, templateId, templateData, this.styles);\n\t}\n\n\tdisposeTemplate(tree: ITree, templateId: string, templateData: any): void {\n\t\tconst model = this.modelProvider.getModel();\n\t\tmodel.renderer.disposeTemplate(templateId, templateData);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 Touch from 'vs/base/browser/touch';\nimport * as Mouse from 'vs/base/browser/mouseEvent';\nimport * as Keyboard from 'vs/base/browser/keyboardEvent';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { Event } from 'vs/base/common/event';\nimport { IAction } from 'vs/base/common/actions';\nimport { Color } from 'vs/base/common/color';\nimport { IDragAndDropData } from 'vs/base/browser/dnd';\n\nexport interface ITree {\n\n\tonDidFocus: Event<void>;\n\tonDidChangeFocus: Event<IFocusEvent>;\n\tonDidChangeSelection: Event<ISelectionEvent>;\n\tonDidDispose: Event<void>;\n\n\t/**\n\t * Returns the tree's DOM element.\n\t */\n\tgetHTMLElement(): HTMLElement;\n\n\t/**\n\t * Lays out the tree.\n\t * Provide a specific height to save an (expensive) height computation.\n\t */\n\tlayout(height?: number): void;\n\n\t/**\n\t * Sets the input of the tree.\n\t */\n\tsetInput(element: any): Promise<any>;\n\n\t/**\n\t * Returns the tree's input.\n\t */\n\tgetInput(): any;\n\n\t/**\n\t * Sets DOM focus on the tree.\n\t */\n\tdomFocus(): void;\n\n\t/**\n\t * Returns whether the tree has DOM focus.\n\t */\n\tisDOMFocused(): boolean;\n\n\t/**\n\t * Removes DOM focus from the tree.\n\t */\n\tdomBlur(): void;\n\n\t/**\n\t * Expands an element.\n\t * The returned promise returns a boolean for whether the element was expanded or not.\n\t */\n\texpand(element: any): Promise<any>;\n\n\t/**\n\t * Collapses an element.\n\t * The returned promise returns a boolean for whether the element was collapsed or not.\n\t */\n\tcollapse(element: any, recursive?: boolean): Promise<any>;\n\n\t/**\n\t * Toggles an element's expansion state.\n\t */\n\ttoggleExpansion(element: any, recursive?: boolean): Promise<any>;\n\n\t/**\n\t * Returns whether an element is expanded or not.\n\t */\n\tisExpanded(element: any): boolean;\n\n\t/**\n\t * Reveals an element in the tree. The relativeTop is a value between 0 and 1. The closer to 0 the more the\n\t * element will scroll up to the top.\n\t */\n\treveal(element: any, relativeTop?: number): Promise<any>;\n\n\t/**\n\t * Returns the currently highlighted element.\n\t */\n\tgetHighlight(includeHidden?: boolean): any;\n\n\t/**\n\t * Clears the highlight.\n\t */\n\tclearHighlight(eventPayload?: any): void;\n\n\t/**\n\t * Replaces the current selection with the given elements.\n\t */\n\tsetSelection(elements: any[], eventPayload?: any): void;\n\n\t/**\n\t * Returns the currently selected elements.\n\t */\n\tgetSelection(includeHidden?: boolean): any[];\n\n\t/**\n\t * Clears the selection.\n\t */\n\tclearSelection(eventPayload?: any): void;\n\n\t/**\n\t * Sets the focused element.\n\t */\n\tsetFocus(element?: any, eventPayload?: any): void;\n\n\t/**\n\t * Returns focused element.\n\t */\n\tgetFocus(includeHidden?: boolean): any;\n\n\t/**\n\t * Focuses the next `count`-nth element, in visible order.\n\t */\n\tfocusNext(count?: number, eventPayload?: any): void;\n\n\t/**\n\t * Focuses the previous `count`-nth element, in visible order.\n\t */\n\tfocusPrevious(count?: number, eventPayload?: any): void;\n\n\t/**\n\t * Focuses the currently focused element's parent.\n\t */\n\tfocusParent(eventPayload?: any): void;\n\n\t/**\n\t * Focuses the first child of the currently focused element.\n\t */\n\tfocusFirstChild(eventPayload?: any): void;\n\n\t/**\n\t * Focuses the second element, in visible order. Will focus the first\n\t * child from the provided element's parent if any.\n\t */\n\tfocusFirst(eventPayload?: any, from?: any): void;\n\n\t/**\n\t * Focuses the nth element, in visible order.\n\t */\n\tfocusNth(index: number, eventPayload?: any): void;\n\n\t/**\n\t * Focuses the last element, in visible order. Will focus the last\n\t * child from the provided element's parent if any.\n\t */\n\tfocusLast(eventPayload?: any, from?: any): void;\n\n\t/**\n\t * Focuses the element at the end of the next page, in visible order.\n\t */\n\tfocusNextPage(eventPayload?: any): void;\n\n\t/**\n\t * Focuses the element at the beginning of the previous page, in visible order.\n\t */\n\tfocusPreviousPage(eventPayload?: any): void;\n\n\t/**\n\t * Clears the focus.\n\t */\n\tclearFocus(eventPayload?: any): void;\n\n\t/**\n\t * Apply styles to the tree.\n\t */\n\tstyle(styles: ITreeStyles): void;\n\n\t/**\n\t * Disposes the tree\n\t */\n\tdispose(): void;\n}\n\nexport interface IDataSource {\n\n\t/**\n\t * Returns the unique identifier of the given element.\n\t * No more than one element may use a given identifier.\n\t *\n\t * You should not attempt to \"move\" an element to a different\n\t * parent by keeping its ID. The idea here is to have tree location\n\t * related IDs (eg. full file path, in the Explorer example).\n\t */\n\tgetId(tree: ITree, element: any): string;\n\n\t/**\n\t * Returns a boolean value indicating whether the element has children.\n\t */\n\thasChildren(tree: ITree, element: any): boolean;\n\n\t/**\n\t * Returns the element's children as an array in a promise.\n\t */\n\tgetChildren(tree: ITree, element: any): Promise<any>;\n\n\t/**\n\t * Returns the element's parent in a promise.\n\t */\n\tgetParent(tree: ITree, element: any): Promise<any>;\n\n\t/**\n\t * Returns whether an element should be expanded when first added to the tree.\n\t */\n\tshouldAutoexpand?(tree: ITree, element: any): boolean;\n}\n\nexport interface IRenderer {\n\n\t/**\n\t * Returns the element's height in the tree, in pixels.\n\t */\n\tgetHeight(tree: ITree, element: any): number;\n\n\t/**\n\t * Returns a template ID for a given element. This will be used as an identifier\n\t * for the next 3 methods.\n\t */\n\tgetTemplateId(tree: ITree, element: any): string;\n\n\t/**\n\t * Renders the template in a DOM element. This method should render all the DOM\n\t * structure for an hypothetical element leaving its contents blank. It should\n\t * return an object bag which will be passed along to `renderElement` and used\n\t * to fill in those blanks.\n\t *\n\t * You should do all DOM creating and object allocation in this method. It\n\t * will be called only a few times.\n\t */\n\trenderTemplate(tree: ITree, templateId: string, container: HTMLElement): any;\n\n\t/**\n\t * Renders an element, given an object bag returned by `renderTemplate`.\n\t * This method should do as little as possible and ideally it should only fill\n\t * in the blanks left by `renderTemplate`.\n\t *\n\t * Try to make this method do as little possible, since it will be called very\n\t * often.\n\t */\n\trenderElement(tree: ITree, element: any, templateId: string, templateData: any): void;\n\n\t/**\n\t * Disposes a template that was once rendered.\n\t */\n\tdisposeTemplate(tree: ITree, templateId: string, templateData: any): void;\n}\n\nexport interface IAccessibilityProvider {\n\n\t/**\n\t * Given an element in the tree, return the ARIA label that should be associated with the\n\t * item. This helps screen readers to provide a meaningful label for the currently focused\n\t * tree element.\n\t *\n\t * Returning null will not disable ARIA for the element. Instead it is up to the screen reader\n\t * to compute a meaningful label based on the contents of the element in the DOM\n\t *\n\t * See also: https://www.w3.org/TR/wai-aria/states_and_properties#aria-label\n\t */\n\tgetAriaLabel(tree: ITree, element: any): string | null;\n\n\t/**\n\t * Given an element in the tree return its aria-posinset. Should be between 1 and aria-setsize\n\t * https://www.w3.org/TR/wai-aria/states_and_properties#aria-posinset\n\t */\n\tgetPosInSet?(tree: ITree, element: any): string;\n\n\t/**\n\t * Return the aria-setsize of the tree.\n\t * https://www.w3.org/TR/wai-aria/states_and_properties#aria-setsize\n\t */\n\tgetSetSize?(): string;\n}\n\nexport /* abstract */ class ContextMenuEvent {\n\n\tprivate _posx: number;\n\tprivate _posy: number;\n\tprivate _target: HTMLElement;\n\n\tconstructor(posx: number, posy: number, target: HTMLElement) {\n\t\tthis._posx = posx;\n\t\tthis._posy = posy;\n\t\tthis._target = target;\n\t}\n\n\tpublic preventDefault(): void {\n\t\t// no-op\n\t}\n\n\tpublic stopPropagation(): void {\n\t\t// no-op\n\t}\n\n\tpublic get target(): HTMLElement {\n\t\treturn this._target;\n\t}\n}\n\nexport class MouseContextMenuEvent extends ContextMenuEvent {\n\n\tprivate originalEvent: Mouse.IMouseEvent;\n\n\tconstructor(originalEvent: Mouse.IMouseEvent) {\n\t\tsuper(originalEvent.posx, originalEvent.posy, originalEvent.target);\n\t\tthis.originalEvent = originalEvent;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.originalEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.originalEvent.stopPropagation();\n\t}\n}\n\nexport class KeyboardContextMenuEvent extends ContextMenuEvent {\n\n\tprivate originalEvent: Keyboard.IKeyboardEvent;\n\n\tconstructor(posx: number, posy: number, originalEvent: Keyboard.IKeyboardEvent) {\n\t\tsuper(posx, posy, originalEvent.target);\n\t\tthis.originalEvent = originalEvent;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.originalEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.originalEvent.stopPropagation();\n\t}\n}\n\nexport interface IController {\n\n\t/**\n\t * Called when an element is clicked.\n\t */\n\tonClick(tree: ITree, element: any, event: Mouse.IMouseEvent): boolean;\n\n\t/**\n\t * Called when an element is requested for a context menu.\n\t */\n\tonContextMenu(tree: ITree, element: any, event: ContextMenuEvent): boolean;\n\n\t/**\n\t * Called when an element is tapped.\n\t */\n\tonTap(tree: ITree, element: any, event: Touch.GestureEvent): boolean;\n\n\t/**\n\t * Called when a key is pressed down while selecting elements.\n\t */\n\tonKeyDown(tree: ITree, event: Keyboard.IKeyboardEvent): boolean;\n\n\t/**\n\t * Called when a key is released while selecting elements.\n\t */\n\tonKeyUp(tree: ITree, event: Keyboard.IKeyboardEvent): boolean;\n\n\t/**\n\t * Called when a mouse middle button is pressed down on an element.\n\t */\n\tonMouseMiddleClick?(tree: ITree, element: any, event: Mouse.IMouseEvent): boolean;\n\n\t/**\n\t * Called when a mouse button is pressed down on an element.\n\t */\n\tonMouseDown?(tree: ITree, element: any, event: Mouse.IMouseEvent): boolean;\n\n\t/**\n\t * Called when a mouse button goes up on an element.\n\t */\n\tonMouseUp?(tree: ITree, element: any, event: Mouse.IMouseEvent): boolean;\n}\n\nexport const enum DragOverEffect {\n\tCOPY,\n\tMOVE\n}\n\nexport const enum DragOverBubble {\n\tBUBBLE_DOWN,\n\tBUBBLE_UP\n}\n\nexport interface IDragOverReaction {\n\taccept: boolean;\n\teffect?: DragOverEffect;\n\tbubble?: DragOverBubble;\n\tautoExpand?: boolean;\n}\n\nexport interface IDragAndDrop {\n\n\t/**\n\t * Returns a uri if the given element should be allowed to drag.\n\t * Returns null, otherwise.\n\t */\n\tgetDragURI(tree: ITree, element: any): string | null;\n\n\t/**\n\t * Returns a label to display when dragging the element.\n\t */\n\tgetDragLabel?(tree: ITree, elements: any[]): string;\n\n\t/**\n\t * Sent when the drag operation is starting.\n\t */\n\tonDragStart(tree: ITree, data: IDragAndDropData, originalEvent: Mouse.DragMouseEvent): void;\n\n\t/**\n\t * Returns a DragOverReaction indicating whether sources can be\n\t * dropped into target or some parent of the target.\n\t */\n\tonDragOver(tree: ITree, data: IDragAndDropData, targetElement: any, originalEvent: Mouse.DragMouseEvent): IDragOverReaction | null;\n\n\t/**\n\t * Handles the action of dropping sources into target.\n\t */\n\tdrop(tree: ITree, data: IDragAndDropData, targetElement: any, originalEvent: Mouse.DragMouseEvent): void;\n}\n\nexport interface IFilter {\n\n\t/**\n\t * Returns whether the given element should be visible.\n\t */\n\tisVisible(tree: ITree, element: any): boolean;\n}\n\nexport interface ISorter {\n\n\t/**\n\t * Compare two elements in the viewer to define the sorting order.\n\t */\n\tcompare(tree: ITree, element: any, otherElement: any): number;\n}\n\n// Events\n\nexport interface ISelectionEvent {\n\tselection: any[];\n\tpayload?: any;\n}\n\nexport interface IFocusEvent {\n\tfocus: any;\n\tpayload?: any;\n}\n\nexport interface IHighlightEvent {\n\thighlight: any;\n\tpayload?: any;\n}\n\n// Options\n\nexport interface ITreeConfiguration {\n\tdataSource: IDataSource;\n\trenderer?: IRenderer;\n\tcontroller?: IController;\n\tdnd?: IDragAndDrop;\n\tfilter?: IFilter;\n\tsorter?: ISorter;\n\taccessibilityProvider?: IAccessibilityProvider;\n\tstyler?: ITreeStyler;\n}\n\nexport interface ITreeOptions extends ITreeStyles {\n\ttwistiePixels?: number;\n\tshowTwistie?: boolean;\n\tindentPixels?: number;\n\tverticalScrollMode?: ScrollbarVisibility;\n\thorizontalScrollMode?: ScrollbarVisibility;\n\talwaysFocused?: boolean;\n\tautoExpandSingleChildren?: boolean;\n\tuseShadows?: boolean;\n\tpaddingOnRow?: boolean;\n\tariaLabel?: string;\n\tkeyboardSupport?: boolean;\n\tpreventRootFocus?: boolean;\n\tshowLoading?: boolean;\n}\n\nexport interface ITreeStyler {\n\tstyle(styles: ITreeStyles): void;\n}\n\nexport interface ITreeStyles {\n\tlistFocusBackground?: Color;\n\tlistFocusForeground?: Color;\n\tlistActiveSelectionBackground?: Color;\n\tlistActiveSelectionForeground?: Color;\n\tlistFocusAndSelectionBackground?: Color;\n\tlistFocusAndSelectionForeground?: Color;\n\tlistInactiveSelectionBackground?: Color;\n\tlistInactiveSelectionForeground?: Color;\n\tlistHoverBackground?: Color;\n\tlistHoverForeground?: Color;\n\tlistDropBackground?: Color;\n\tlistFocusOutline?: Color;\n}\n\nexport interface ITreeContext extends ITreeConfiguration {\n\ttree: ITree;\n\toptions: ITreeOptions;\n}\n\nexport interface IActionProvider {\n\n\t/**\n\t * Returns whether or not the element has actions. These show up in place right to the element in the tree.\n\t */\n\thasActions(tree: ITree | null, element: any): boolean;\n\n\t/**\n\t * Returns a promise of an array with the actions of the element that should show up in place right to the element in the tree.\n\t */\n\tgetActions(tree: ITree | null, element: any): IAction[] | null;\n}\n","\nimport * as platform from 'vs/base/common/platform';\nimport * as touch from 'vs/base/browser/touch';\nimport * as errors from 'vs/base/common/errors';\nimport * as dom from 'vs/base/browser/dom';\nimport * as mouse from 'vs/base/browser/mouseEvent';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport * as _ from 'vs/base/parts/tree/browser/tree';\nimport { IDragAndDropData } from 'vs/base/browser/dnd';\nimport { KeyCode, KeyMod, Keybinding, SimpleKeybinding, createKeybinding } from 'vs/base/common/keyCodes';\n\nexport interface IKeyBindingCallback {\n\t(tree: _.ITree, event: IKeyboardEvent): void;\n}\n\nexport interface ICancelableEvent {\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport const enum ClickBehavior {\n\n\t/**\n\t * Handle the click when the mouse button is pressed but not released yet.\n\t */\n\tON_MOUSE_DOWN,\n\n\t/**\n\t * Handle the click when the mouse button is released.\n\t */\n\tON_MOUSE_UP\n}\n\nexport const enum OpenMode {\n\tSINGLE_CLICK,\n\tDOUBLE_CLICK\n}\n\nexport interface IControllerOptions {\n\tclickBehavior?: ClickBehavior;\n\topenMode?: OpenMode;\n\tkeyboardSupport?: boolean;\n}\n\ninterface IKeybindingDispatcherItem {\n\tkeybinding: Keybinding | null;\n\tcallback: IKeyBindingCallback;\n}\n\nexport class KeybindingDispatcher {\n\n\tprivate _arr: IKeybindingDispatcherItem[];\n\n\tconstructor() {\n\t\tthis._arr = [];\n\t}\n\n\tpublic set(keybinding: number, callback: IKeyBindingCallback) {\n\t\tthis._arr.push({\n\t\t\tkeybinding: createKeybinding(keybinding, platform.OS),\n\t\t\tcallback: callback\n\t\t});\n\t}\n\n\tpublic dispatch(keybinding: SimpleKeybinding): IKeyBindingCallback | null {\n\t\t// Loop from the last to the first to handle overwrites\n\t\tfor (let i = this._arr.length - 1; i >= 0; i--) {\n\t\t\tlet item = this._arr[i];\n\t\t\tif (keybinding.toChord().equals(item.keybinding)) {\n\t\t\t\treturn item.callback;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n\nexport class DefaultController implements _.IController {\n\n\tprotected downKeyBindingDispatcher: KeybindingDispatcher;\n\tprotected upKeyBindingDispatcher: KeybindingDispatcher;\n\n\tprivate options: IControllerOptions;\n\n\tconstructor(options: IControllerOptions = { clickBehavior: ClickBehavior.ON_MOUSE_DOWN, keyboardSupport: true, openMode: OpenMode.SINGLE_CLICK }) {\n\t\tthis.options = options;\n\n\t\tthis.downKeyBindingDispatcher = new KeybindingDispatcher();\n\t\tthis.upKeyBindingDispatcher = new KeybindingDispatcher();\n\n\t\tif (typeof options.keyboardSupport !== 'boolean' || options.keyboardSupport) {\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.UpArrow, (t, e) => this.onUp(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.DownArrow, (t, e) => this.onDown(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.LeftArrow, (t, e) => this.onLeft(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.RightArrow, (t, e) => this.onRight(t, e));\n\t\t\tif (platform.isMacintosh) {\n\t\t\t\tthis.downKeyBindingDispatcher.set(KeyMod.CtrlCmd | KeyCode.UpArrow, (t, e) => this.onLeft(t, e));\n\t\t\t\tthis.downKeyBindingDispatcher.set(KeyMod.WinCtrl | KeyCode.KEY_N, (t, e) => this.onDown(t, e));\n\t\t\t\tthis.downKeyBindingDispatcher.set(KeyMod.WinCtrl | KeyCode.KEY_P, (t, e) => this.onUp(t, e));\n\t\t\t}\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.PageUp, (t, e) => this.onPageUp(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.PageDown, (t, e) => this.onPageDown(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.Home, (t, e) => this.onHome(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.End, (t, e) => this.onEnd(t, e));\n\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.Space, (t, e) => this.onSpace(t, e));\n\t\t\tthis.downKeyBindingDispatcher.set(KeyCode.Escape, (t, e) => this.onEscape(t, e));\n\n\t\t\tthis.upKeyBindingDispatcher.set(KeyCode.Enter, this.onEnter.bind(this));\n\t\t\tthis.upKeyBindingDispatcher.set(KeyMod.CtrlCmd | KeyCode.Enter, this.onEnter.bind(this));\n\t\t}\n\t}\n\n\tpublic onMouseDown(tree: _.ITree, element: any, event: mouse.IMouseEvent, origin: string = 'mouse'): boolean {\n\t\tif (this.options.clickBehavior === ClickBehavior.ON_MOUSE_DOWN && (event.leftButton || event.middleButton)) {\n\t\t\tif (event.target) {\n\t\t\t\tif (event.target.tagName && event.target.tagName.toLowerCase() === 'input') {\n\t\t\t\t\treturn false; // Ignore event if target is a form input field (avoids browser specific issues)\n\t\t\t\t}\n\n\t\t\t\tif (dom.findParentWithClass(event.target, 'scrollbar', 'monaco-tree')) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (dom.findParentWithClass(event.target, 'monaco-action-bar', 'row')) { // TODO@Joao not very nice way of checking for the action bar (implicit knowledge)\n\t\t\t\t\treturn false; // Ignore event if target is over an action bar of the row\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Propagate to onLeftClick now\n\t\t\treturn this.onLeftClick(tree, element, event, origin);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic onClick(tree: _.ITree, element: any, event: mouse.IMouseEvent): boolean {\n\t\tconst isMac = platform.isMacintosh;\n\n\t\t// A Ctrl click on the Mac is a context menu event\n\t\tif (isMac && event.ctrlKey) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') {\n\t\t\treturn false; // Ignore event if target is a form input field (avoids browser specific issues)\n\t\t}\n\n\t\tif (this.options.clickBehavior === ClickBehavior.ON_MOUSE_DOWN && (event.leftButton || event.middleButton)) {\n\t\t\treturn false; // Already handled by onMouseDown\n\t\t}\n\n\t\treturn this.onLeftClick(tree, element, event);\n\t}\n\n\tprotected onLeftClick(tree: _.ITree, element: any, eventish: ICancelableEvent, origin: string = 'mouse'): boolean {\n\t\tconst event = <mouse.IMouseEvent>eventish;\n\t\tconst payload = { origin: origin, originalEvent: eventish, didClickOnTwistie: this.isClickOnTwistie(event) };\n\n\t\tif (tree.getInput() === element) {\n\t\t\ttree.clearFocus(payload);\n\t\t\ttree.clearSelection(payload);\n\t\t} else {\n\t\t\tconst isSingleMouseDown = eventish && event.browserEvent && event.browserEvent.type === 'mousedown' && event.browserEvent.detail === 1;\n\t\t\tif (!isSingleMouseDown) {\n\t\t\t\teventish.preventDefault(); // we cannot preventDefault onMouseDown with single click because this would break DND otherwise\n\t\t\t}\n\t\t\teventish.stopPropagation();\n\n\t\t\ttree.domFocus();\n\t\t\ttree.setSelection([element], payload);\n\t\t\ttree.setFocus(element, payload);\n\n\t\t\tif (this.shouldToggleExpansion(element, event, origin)) {\n\t\t\t\tif (tree.isExpanded(element)) {\n\t\t\t\t\ttree.collapse(element).then(undefined, errors.onUnexpectedError);\n\t\t\t\t} else {\n\t\t\t\t\ttree.expand(element).then(undefined, errors.onUnexpectedError);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprotected shouldToggleExpansion(element: any, event: mouse.IMouseEvent, origin: string): boolean {\n\t\tconst isDoubleClick = (origin === 'mouse' && event.detail === 2);\n\t\treturn this.openOnSingleClick || isDoubleClick || this.isClickOnTwistie(event);\n\t}\n\n\tprotected get openOnSingleClick(): boolean {\n\t\treturn this.options.openMode === OpenMode.SINGLE_CLICK;\n\t}\n\n\tprotected isClickOnTwistie(event: mouse.IMouseEvent): boolean {\n\t\tlet element = event.target as HTMLElement;\n\n\t\tif (!dom.hasClass(element, 'content')) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst twistieStyle = window.getComputedStyle(element, ':before');\n\n\t\tif (twistieStyle.backgroundImage === 'none' || twistieStyle.display === 'none') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst twistieWidth = parseInt(twistieStyle.width!) + parseInt(twistieStyle.paddingRight!);\n\t\treturn event.browserEvent.offsetX <= twistieWidth;\n\t}\n\n\tpublic onContextMenu(tree: _.ITree, element: any, event: _.ContextMenuEvent): boolean {\n\t\tif (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') {\n\t\t\treturn false; // allow context menu on input fields\n\t\t}\n\n\t\t// Prevent native context menu from showing up\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic onTap(tree: _.ITree, element: any, event: touch.GestureEvent): boolean {\n\t\tconst target = <HTMLElement>event.initialTarget;\n\n\t\tif (target && target.tagName && target.tagName.toLowerCase() === 'input') {\n\t\t\treturn false; // Ignore event if target is a form input field (avoids browser specific issues)\n\t\t}\n\n\t\treturn this.onLeftClick(tree, element, event, 'touch');\n\t}\n\n\tpublic onKeyDown(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\treturn this.onKey(this.downKeyBindingDispatcher, tree, event);\n\t}\n\n\tpublic onKeyUp(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\treturn this.onKey(this.upKeyBindingDispatcher, tree, event);\n\t}\n\n\tprivate onKey(bindings: KeybindingDispatcher, tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst handler: any = bindings.dispatch(event.toKeybinding());\n\t\tif (handler) {\n\t\t\t// TODO: TS 3.1 upgrade. Why are we checking against void?\n\t\t\tif (handler(tree, event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected onUp(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\ttree.focusPrevious(1, payload);\n\t\t\ttree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onPageUp(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\ttree.focusPreviousPage(payload);\n\t\t\ttree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onDown(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\ttree.focusNext(1, payload);\n\t\t\ttree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onPageDown(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\ttree.focusNextPage(payload);\n\t\t\ttree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onHome(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\ttree.focusFirst(payload);\n\t\t\ttree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onEnd(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\ttree.focusLast(payload);\n\t\t\ttree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onLeft(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\tconst focus = tree.getFocus();\n\t\t\ttree.collapse(focus).then(didCollapse => {\n\t\t\t\tif (focus && !didCollapse) {\n\t\t\t\t\ttree.focusParent(payload);\n\t\t\t\t\treturn tree.reveal(tree.getFocus());\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t}).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onRight(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t} else {\n\t\t\tconst focus = tree.getFocus();\n\t\t\ttree.expand(focus).then(didExpand => {\n\t\t\t\tif (focus && !didExpand) {\n\t\t\t\t\ttree.focusFirstChild(payload);\n\t\t\t\t\treturn tree.reveal(tree.getFocus());\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t}).then(undefined, errors.onUnexpectedError);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onEnter(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst focus = tree.getFocus();\n\t\tif (focus) {\n\t\t\ttree.setSelection([focus], payload);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onSpace(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tif (tree.getHighlight()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst focus = tree.getFocus();\n\t\tif (focus) {\n\t\t\ttree.toggleExpansion(focus);\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected onEscape(tree: _.ITree, event: IKeyboardEvent): boolean {\n\t\tconst payload = { origin: 'keyboard', originalEvent: event };\n\n\t\tif (tree.getHighlight()) {\n\t\t\ttree.clearHighlight(payload);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (tree.getSelection().length) {\n\t\t\ttree.clearSelection(payload);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (tree.getFocus()) {\n\t\t\ttree.clearFocus(payload);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nexport class DefaultDragAndDrop implements _.IDragAndDrop {\n\n\tpublic getDragURI(tree: _.ITree, element: any): string | null {\n\t\treturn null;\n\t}\n\n\tpublic onDragStart(tree: _.ITree, data: IDragAndDropData, originalEvent: mouse.DragMouseEvent): void {\n\t\treturn;\n\t}\n\n\tpublic onDragOver(tree: _.ITree, data: IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): _.IDragOverReaction | null {\n\t\treturn null;\n\t}\n\n\tpublic drop(tree: _.ITree, data: IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): void {\n\t\treturn;\n\t}\n}\n\nexport class DefaultFilter implements _.IFilter {\n\n\tpublic isVisible(tree: _.ITree, element: any): boolean {\n\t\treturn true;\n\t}\n}\n\nexport class DefaultAccessibilityProvider implements _.IAccessibilityProvider {\n\n\tgetAriaLabel(tree: _.ITree, element: any): string | null {\n\t\treturn null;\n\t}\n}\n\nexport class DefaultTreestyler implements _.ITreeStyler {\n\n\tconstructor(private styleElement: HTMLStyleElement, private selectorSuffix?: string) { }\n\n\tstyle(styles: _.ITreeStyles): void {\n\t\tconst suffix = this.selectorSuffix ? `.${this.selectorSuffix}` : '';\n\t\tconst content: string[] = [];\n\n\t\tif (styles.listFocusBackground) {\n\t\t\tcontent.push(`.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { background-color: ${styles.listFocusBackground}; }`);\n\t\t}\n\n\t\tif (styles.listFocusForeground) {\n\t\t\tcontent.push(`.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { color: ${styles.listFocusForeground}; }`);\n\t\t}\n\n\t\tif (styles.listActiveSelectionBackground) {\n\t\t\tcontent.push(`.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${styles.listActiveSelectionBackground}; }`);\n\t\t}\n\n\t\tif (styles.listActiveSelectionForeground) {\n\t\t\tcontent.push(`.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: ${styles.listActiveSelectionForeground}; }`);\n\t\t}\n\n\t\tif (styles.listFocusAndSelectionBackground) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-tree-drag-image,\n\t\t\t\t.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { 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-tree-drag-image,\n\t\t\t\t.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { color: ${styles.listFocusAndSelectionForeground}; }\n\t\t\t`);\n\t\t}\n\n\t\tif (styles.listInactiveSelectionBackground) {\n\t\t\tcontent.push(`.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: ${styles.listInactiveSelectionBackground}; }`);\n\t\t}\n\n\t\tif (styles.listInactiveSelectionForeground) {\n\t\t\tcontent.push(`.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: ${styles.listInactiveSelectionForeground}; }`);\n\t\t}\n\n\t\tif (styles.listHoverBackground) {\n\t\t\tcontent.push(`.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`);\n\t\t}\n\n\t\tif (styles.listHoverForeground) {\n\t\t\tcontent.push(`.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`);\n\t\t}\n\n\t\tif (styles.listDropBackground) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-wrapper.drop-target,\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; }\n\t\t\t`);\n\t\t}\n\n\t\tif (styles.listFocusOutline) {\n\t\t\tcontent.push(`\n\t\t\t\t.monaco-tree-drag-image\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px solid ${styles.listFocusOutline}; background: #000; }\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row \t\t\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px solid transparent; }\n\t\t\t\t.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) \t\t\t\t\t\t{ border: 1px dotted ${styles.listFocusOutline}; }\n\t\t\t\t.monaco-tree${suffix}.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) \t\t\t\t\t\t{ border: 1px solid ${styles.listFocusOutline}; }\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) \t\t\t\t\t\t\t{ border: 1px solid ${styles.listFocusOutline}; }\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) \t{ border: 1px dashed ${styles.listFocusOutline}; }\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-wrapper.drop-target,\n\t\t\t\t.monaco-tree${suffix} .monaco-tree-rows > .monaco-tree-row.drop-target\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px dashed ${styles.listFocusOutline}; }\n\t\t\t`);\n\t\t}\n\n\t\tconst newStyles = content.join('\\n');\n\t\tif (newStyles !== this.styleElement.innerHTML) {\n\t\t\tthis.styleElement.innerHTML = newStyles;\n\t\t}\n\t}\n}\n","\nimport { IDragAndDropData } from 'vs/base/browser/dnd';\n\nexport class ElementsDragAndDropData implements IDragAndDropData {\n\n\tprivate elements: any[];\n\n\tconstructor(elements: any[]) {\n\t\tthis.elements = elements;\n\t}\n\n\tpublic update(dataTransfer: DataTransfer): void {\n\t\t// no-op\n\t}\n\n\tpublic getData(): any {\n\t\treturn this.elements;\n\t}\n}\n\nexport class ExternalElementsDragAndDropData implements IDragAndDropData {\n\n\tprivate elements: any[];\n\n\tconstructor(elements: any[]) {\n\t\tthis.elements = elements;\n\t}\n\n\tpublic update(dataTransfer: DataTransfer): void {\n\t\t// no-op\n\t}\n\n\tpublic getData(): any {\n\t\treturn this.elements;\n\t}\n}\n\nexport class DesktopDragAndDropData implements IDragAndDropData {\n\n\tprivate types: any[];\n\tprivate files: any[];\n\n\tconstructor() {\n\t\tthis.types = [];\n\t\tthis.files = [];\n\t}\n\n\tpublic update(dataTransfer: DataTransfer): void {\n\t\tif (dataTransfer.types) {\n\t\t\tthis.types = [];\n\t\t\tArray.prototype.push.apply(this.types, dataTransfer.types as any);\n\t\t}\n\n\t\tif (dataTransfer.files) {\n\t\t\tthis.files = [];\n\t\t\tArray.prototype.push.apply(this.files, dataTransfer.files as any);\n\n\t\t\tthis.files = this.files.filter(f => f.size || f.type);\n\t\t}\n\t}\n\n\tpublic getData(): any {\n\t\treturn {\n\t\t\ttypes: this.types,\n\t\t\tfiles: this.files\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 * as Assert from 'vs/base/common/assert';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';\nimport { INavigator } from 'vs/base/common/iterator';\nimport * as _ from './tree';\nimport { Event, Emitter, EventMultiplexer, Relay } from 'vs/base/common/event';\n\ninterface IMap<T> { [id: string]: T; }\ninterface IItemMap extends IMap<Item> { }\ninterface ITraitMap extends IMap<IItemMap> { }\n\nexport class LockData {\n\n\tprivate _item: Item;\n\tprivate _onDispose?= new Emitter<void>();\n\treadonly onDispose: Event<void> = this._onDispose!.event;\n\n\tconstructor(item: Item) {\n\t\tthis._item = item;\n\t}\n\n\tget item(): Item {\n\t\treturn this._item;\n\t}\n\n\tdispose(): void {\n\t\tif (this._onDispose) {\n\t\t\tthis._onDispose.fire();\n\t\t\tthis._onDispose.dispose();\n\t\t\tthis._onDispose = undefined;\n\t\t}\n\t}\n}\n\nexport class Lock {\n\n\t/* When refreshing tree items, the tree's structured can be altered, by\n\t\tinserting and removing sub-items. This lock helps to manage several\n\t\tpossibly-structure-changing calls.\n\n\t\tAPI-wise, there are two possibly-structure-changing: refresh(...),\n\t\texpand(...) and collapse(...). All these calls must call Lock#run(...).\n\n\t\tAny call to Lock#run(...) needs to provide the affecting item and a\n\t\tcallback to execute when unlocked. It must also return a promise\n\t\twhich fulfills once the operation ends. Once it is called, there\n\t\tare three possibilities:\n\n\t\t- Nothing is currently running. The affecting item is remembered, and\n\t\tthe callback is executed.\n\n\t\t- Or, there are on-going operations. There are two outcomes:\n\n\t\t\t- The affecting item intersects with any other affecting items\n\t\t\tof on-going run calls. In such a case, the given callback should\n\t\t\tbe executed only when the on-going one completes.\n\n\t\t\t- Or, it doesn't. In such a case, both operations can be run in\n\t\t\tparallel.\n\n\t\tNote: two items A and B intersect if A is a descendant of B, or\n\t\tvice-versa.\n\t*/\n\n\tprivate locks: { [id: string]: LockData; };\n\n\tconstructor() {\n\t\tthis.locks = Object.create({});\n\t}\n\n\tpublic isLocked(item: Item): boolean {\n\t\treturn !!this.locks[item.id];\n\t}\n\n\tpublic run(item: Item, fn: () => Promise<any>): Promise<any> {\n\t\tconst lock = this.getLock(item);\n\n\t\tif (lock) {\n\t\t\treturn new Promise((c, e) => {\n\t\t\t\tEvent.once(lock.onDispose)(() => {\n\t\t\t\t\treturn this.run(item, fn).then(c, e);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tlet result: Promise<any>;\n\n\t\treturn new Promise((c, e) => {\n\n\t\t\tif (item.isDisposed()) {\n\t\t\t\treturn e(new Error('Item is disposed.'));\n\t\t\t}\n\n\t\t\tlet lock = this.locks[item.id] = new LockData(item);\n\n\t\t\tresult = fn().then((r) => {\n\t\t\t\tdelete this.locks[item.id];\n\t\t\t\tlock.dispose();\n\n\t\t\t\treturn r;\n\t\t\t}).then(c, e);\n\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tprivate getLock(item: Item): LockData | null {\n\t\tlet key: string;\n\n\t\tfor (key in this.locks) {\n\t\t\tlet lock = this.locks[key];\n\n\t\t\tif (item.intersects(lock.item)) {\n\t\t\t\treturn lock;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nexport class ItemRegistry {\n\n\tprivate _isDisposed = false;\n\tprivate items: IMap<{ item: Item; disposable: IDisposable; }>;\n\n\tprivate _onDidRevealItem = new EventMultiplexer<IItemRevealEvent>();\n\treadonly onDidRevealItem: Event<IItemRevealEvent> = this._onDidRevealItem.event;\n\tprivate _onExpandItem = new EventMultiplexer<IItemExpandEvent>();\n\treadonly onExpandItem: Event<IItemExpandEvent> = this._onExpandItem.event;\n\tprivate _onDidExpandItem = new EventMultiplexer<IItemExpandEvent>();\n\treadonly onDidExpandItem: Event<IItemExpandEvent> = this._onDidExpandItem.event;\n\tprivate _onCollapseItem = new EventMultiplexer<IItemCollapseEvent>();\n\treadonly onCollapseItem: Event<IItemCollapseEvent> = this._onCollapseItem.event;\n\tprivate _onDidCollapseItem = new EventMultiplexer<IItemCollapseEvent>();\n\treadonly onDidCollapseItem: Event<IItemCollapseEvent> = this._onDidCollapseItem.event;\n\tprivate _onDidAddTraitItem = new EventMultiplexer<IItemTraitEvent>();\n\treadonly onDidAddTraitItem: Event<IItemTraitEvent> = this._onDidAddTraitItem.event;\n\tprivate _onDidRemoveTraitItem = new EventMultiplexer<IItemCollapseEvent>();\n\treadonly onDidRemoveTraitItem: Event<IItemCollapseEvent> = this._onDidRemoveTraitItem.event;\n\tprivate _onDidRefreshItem = new EventMultiplexer<Item>();\n\treadonly onDidRefreshItem: Event<Item> = this._onDidRefreshItem.event;\n\tprivate _onRefreshItemChildren = new EventMultiplexer<IItemChildrenRefreshEvent>();\n\treadonly onRefreshItemChildren: Event<IItemChildrenRefreshEvent> = this._onRefreshItemChildren.event;\n\tprivate _onDidRefreshItemChildren = new EventMultiplexer<IItemChildrenRefreshEvent>();\n\treadonly onDidRefreshItemChildren: Event<IItemChildrenRefreshEvent> = this._onDidRefreshItemChildren.event;\n\tprivate _onDidDisposeItem = new EventMultiplexer<Item>();\n\treadonly onDidDisposeItem: Event<Item> = this._onDidDisposeItem.event;\n\n\tconstructor() {\n\t\tthis.items = {};\n\t}\n\n\tpublic register(item: Item): void {\n\t\tAssert.ok(!this.isRegistered(item.id), 'item already registered: ' + item.id);\n\n\t\tconst disposable = combinedDisposable([\n\t\t\tthis._onDidRevealItem.add(item.onDidReveal),\n\t\t\tthis._onExpandItem.add(item.onExpand),\n\t\t\tthis._onDidExpandItem.add(item.onDidExpand),\n\t\t\tthis._onCollapseItem.add(item.onCollapse),\n\t\t\tthis._onDidCollapseItem.add(item.onDidCollapse),\n\t\t\tthis._onDidAddTraitItem.add(item.onDidAddTrait),\n\t\t\tthis._onDidRemoveTraitItem.add(item.onDidRemoveTrait),\n\t\t\tthis._onDidRefreshItem.add(item.onDidRefresh),\n\t\t\tthis._onRefreshItemChildren.add(item.onRefreshChildren),\n\t\t\tthis._onDidRefreshItemChildren.add(item.onDidRefreshChildren),\n\t\t\tthis._onDidDisposeItem.add(item.onDidDispose)\n\t\t]);\n\n\t\tthis.items[item.id] = { item, disposable };\n\t}\n\n\tpublic deregister(item: Item): void {\n\t\tAssert.ok(this.isRegistered(item.id), 'item not registered: ' + item.id);\n\t\tthis.items[item.id].disposable.dispose();\n\t\tdelete this.items[item.id];\n\t}\n\n\tpublic isRegistered(id: string): boolean {\n\t\treturn this.items.hasOwnProperty(id);\n\t}\n\n\tpublic getItem(id: string): Item | null {\n\t\tconst result = this.items[id];\n\t\treturn result ? result.item : null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.items = null!; // StrictNullOverride: nulling out ok in dispose\n\n\t\tthis._onDidRevealItem.dispose();\n\t\tthis._onExpandItem.dispose();\n\t\tthis._onDidExpandItem.dispose();\n\t\tthis._onCollapseItem.dispose();\n\t\tthis._onDidCollapseItem.dispose();\n\t\tthis._onDidAddTraitItem.dispose();\n\t\tthis._onDidRemoveTraitItem.dispose();\n\t\tthis._onDidRefreshItem.dispose();\n\t\tthis._onRefreshItemChildren.dispose();\n\t\tthis._onDidRefreshItemChildren.dispose();\n\n\t\tthis._isDisposed = true;\n\t}\n\n\tpublic isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n}\n\nexport interface IBaseItemEvent {\n\titem: Item;\n}\nexport interface IItemExpandEvent extends IBaseItemEvent { }\nexport interface IItemCollapseEvent extends IBaseItemEvent { }\n\nexport interface IItemTraitEvent extends IBaseItemEvent {\n\ttrait: string;\n}\n\nexport interface IItemRevealEvent extends IBaseItemEvent {\n\trelativeTop: number | null;\n}\n\nexport interface IItemChildrenRefreshEvent extends IBaseItemEvent {\n\tisNested: boolean;\n}\n\nexport class Item {\n\n\tprivate registry: ItemRegistry;\n\tprivate context: _.ITreeContext;\n\tprivate element: any;\n\tprivate lock: Lock;\n\n\tpublic id: string;\n\n\tprivate needsChildrenRefresh: boolean;\n\tprivate doesHaveChildren: boolean;\n\n\tpublic parent: Item | null;\n\tpublic previous: Item | null;\n\tpublic next: Item | null;\n\tpublic firstChild: Item | null;\n\tpublic lastChild: Item | null;\n\n\tprivate height: number;\n\tprivate depth: number;\n\n\tprivate visible: boolean;\n\tprivate expanded: boolean;\n\n\tprivate traits: { [trait: string]: boolean; };\n\n\tprivate _onDidCreate = new Emitter<Item>();\n\tprivate _onDidReveal = new Emitter<IItemRevealEvent>();\n\treadonly onDidReveal: Event<IItemRevealEvent> = this._onDidReveal.event;\n\tprivate _onExpand = new Emitter<IItemExpandEvent>();\n\treadonly onExpand: Event<IItemExpandEvent> = this._onExpand.event;\n\tprivate _onDidExpand = new Emitter<IItemExpandEvent>();\n\treadonly onDidExpand: Event<IItemExpandEvent> = this._onDidExpand.event;\n\tprivate _onCollapse = new Emitter<IItemCollapseEvent>();\n\treadonly onCollapse: Event<IItemCollapseEvent> = this._onCollapse.event;\n\tprivate _onDidCollapse = new Emitter<IItemCollapseEvent>();\n\treadonly onDidCollapse: Event<IItemCollapseEvent> = this._onDidCollapse.event;\n\tprivate _onDidAddTrait = new Emitter<IItemTraitEvent>();\n\treadonly onDidAddTrait: Event<IItemTraitEvent> = this._onDidAddTrait.event;\n\tprivate _onDidRemoveTrait = new Emitter<IItemCollapseEvent>();\n\treadonly onDidRemoveTrait: Event<IItemCollapseEvent> = this._onDidRemoveTrait.event;\n\tprivate _onDidRefresh = new Emitter<Item>();\n\treadonly onDidRefresh: Event<Item> = this._onDidRefresh.event;\n\tprivate _onRefreshChildren = new Emitter<IItemChildrenRefreshEvent>();\n\treadonly onRefreshChildren: Event<IItemChildrenRefreshEvent> = this._onRefreshChildren.event;\n\tprivate _onDidRefreshChildren = new Emitter<IItemChildrenRefreshEvent>();\n\treadonly onDidRefreshChildren: Event<IItemChildrenRefreshEvent> = this._onDidRefreshChildren.event;\n\tprivate _onDidDispose = new Emitter<Item>();\n\treadonly onDidDispose: Event<Item> = this._onDidDispose.event;\n\n\tprivate _isDisposed: boolean;\n\n\tconstructor(id: string, registry: ItemRegistry, context: _.ITreeContext, lock: Lock, element: any) {\n\t\tthis.registry = registry;\n\t\tthis.context = context;\n\t\tthis.lock = lock;\n\t\tthis.element = element;\n\n\t\tthis.id = id;\n\t\tthis.registry.register(this);\n\n\t\tthis.doesHaveChildren = this.context.dataSource.hasChildren(this.context.tree, this.element);\n\t\tthis.needsChildrenRefresh = true;\n\n\t\tthis.parent = null;\n\t\tthis.previous = null;\n\t\tthis.next = null;\n\t\tthis.firstChild = null;\n\t\tthis.lastChild = null;\n\n\t\tthis.traits = {};\n\t\tthis.depth = 0;\n\t\tthis.expanded = !!(this.context.dataSource.shouldAutoexpand && this.context.dataSource.shouldAutoexpand(this.context.tree, element));\n\n\t\tthis._onDidCreate.fire(this);\n\n\t\tthis.visible = this._isVisible();\n\t\tthis.height = this._getHeight();\n\n\t\tthis._isDisposed = false;\n\t}\n\n\tpublic getElement(): any {\n\t\treturn this.element;\n\t}\n\n\tpublic hasChildren(): boolean {\n\t\treturn this.doesHaveChildren;\n\t}\n\n\tpublic getDepth(): number {\n\t\treturn this.depth;\n\t}\n\n\tpublic isVisible(): boolean {\n\t\treturn this.visible;\n\t}\n\n\tpublic setVisible(value: boolean): void {\n\t\tthis.visible = value;\n\t}\n\n\tpublic isExpanded(): boolean {\n\t\treturn this.expanded;\n\t}\n\n\t/* protected */ public _setExpanded(value: boolean): void {\n\t\tthis.expanded = value;\n\t}\n\n\tpublic reveal(relativeTop: number | null = null): void {\n\t\tlet eventData: IItemRevealEvent = { item: this, relativeTop: relativeTop };\n\t\tthis._onDidReveal.fire(eventData);\n\t}\n\n\tpublic expand(): Promise<any> {\n\t\tif (this.isExpanded() || !this.doesHaveChildren || this.lock.isLocked(this)) {\n\t\t\treturn Promise.resolve(false);\n\t\t}\n\n\t\tlet result = this.lock.run(this, () => {\n\t\t\tif (this.isExpanded() || !this.doesHaveChildren) {\n\t\t\t\treturn Promise.resolve(false);\n\t\t\t}\n\n\t\t\tlet eventData: IItemExpandEvent = { item: this };\n\t\t\tlet result: Promise<any>;\n\t\t\tthis._onExpand.fire(eventData);\n\n\t\t\tif (this.needsChildrenRefresh) {\n\t\t\t\tresult = this.refreshChildren(false, true, true);\n\t\t\t} else {\n\t\t\t\tresult = Promise.resolve(null);\n\t\t\t}\n\n\t\t\treturn result.then(() => {\n\t\t\t\tthis._setExpanded(true);\n\t\t\t\tthis._onDidExpand.fire(eventData);\n\t\t\t\treturn true;\n\t\t\t});\n\t\t});\n\n\t\treturn result.then((r) => {\n\t\t\tif (this.isDisposed()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Auto expand single child folders\n\t\t\tif (this.context.options.autoExpandSingleChildren && r && this.firstChild !== null && this.firstChild === this.lastChild && this.firstChild.isVisible()) {\n\t\t\t\treturn this.firstChild.expand().then(() => { return true; });\n\t\t\t}\n\n\t\t\treturn r;\n\t\t});\n\t}\n\n\tpublic collapse(recursive: boolean = false): Promise<any> {\n\t\tif (recursive) {\n\t\t\tlet collapseChildrenPromise = Promise.resolve(null);\n\t\t\tthis.forEachChild((child) => {\n\t\t\t\tcollapseChildrenPromise = collapseChildrenPromise.then(() => child.collapse(true));\n\t\t\t});\n\t\t\treturn collapseChildrenPromise.then(() => {\n\t\t\t\treturn this.collapse(false);\n\t\t\t});\n\t\t} else {\n\t\t\tif (!this.isExpanded() || this.lock.isLocked(this)) {\n\t\t\t\treturn Promise.resolve(false);\n\t\t\t}\n\n\t\t\treturn this.lock.run(this, () => {\n\t\t\t\tlet eventData: IItemCollapseEvent = { item: this };\n\t\t\t\tthis._onCollapse.fire(eventData);\n\t\t\t\tthis._setExpanded(false);\n\t\t\t\tthis._onDidCollapse.fire(eventData);\n\n\t\t\t\treturn Promise.resolve(true);\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic addTrait(trait: string): void {\n\t\tlet eventData: IItemTraitEvent = { item: this, trait: trait };\n\t\tthis.traits[trait] = true;\n\t\tthis._onDidAddTrait.fire(eventData);\n\t}\n\n\tpublic removeTrait(trait: string): void {\n\t\tlet eventData: IItemTraitEvent = { item: this, trait: trait };\n\t\tdelete this.traits[trait];\n\t\tthis._onDidRemoveTrait.fire(eventData);\n\t}\n\n\tpublic hasTrait(trait: string): boolean {\n\t\treturn this.traits[trait] || false;\n\t}\n\n\tpublic getAllTraits(): string[] {\n\t\tlet result: string[] = [];\n\t\tlet trait: string;\n\t\tfor (trait in this.traits) {\n\t\t\tif (this.traits.hasOwnProperty(trait) && this.traits[trait]) {\n\t\t\t\tresult.push(trait);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getHeight(): number {\n\t\treturn this.height;\n\t}\n\n\tprivate refreshChildren(recursive: boolean, safe: boolean = false, force: boolean = false): Promise<any> {\n\t\tif (!force && !this.isExpanded()) {\n\t\t\tconst setNeedsChildrenRefresh = (item: Item) => {\n\t\t\t\titem.needsChildrenRefresh = true;\n\t\t\t\titem.forEachChild(setNeedsChildrenRefresh);\n\t\t\t};\n\n\t\t\tsetNeedsChildrenRefresh(this);\n\n\t\t\treturn Promise.resolve(this);\n\t\t}\n\n\t\tthis.needsChildrenRefresh = false;\n\n\t\tlet doRefresh = () => {\n\t\t\tlet eventData: IItemChildrenRefreshEvent = { item: this, isNested: safe };\n\t\t\tthis._onRefreshChildren.fire(eventData);\n\n\t\t\tlet childrenPromise: Promise<any>;\n\t\t\tif (this.doesHaveChildren) {\n\t\t\t\tchildrenPromise = this.context.dataSource.getChildren(this.context.tree, this.element);\n\t\t\t} else {\n\t\t\t\tchildrenPromise = Promise.resolve([]);\n\t\t\t}\n\n\t\t\tconst result = childrenPromise.then((elements: any[]) => {\n\t\t\t\tif (this.isDisposed() || this.registry.isDisposed()) {\n\t\t\t\t\treturn Promise.resolve(null);\n\t\t\t\t}\n\n\t\t\t\tif (!Array.isArray(elements)) {\n\t\t\t\t\treturn Promise.reject(new Error('Please return an array of children.'));\n\t\t\t\t}\n\n\t\t\t\telements = !elements ? [] : elements.slice(0);\n\t\t\t\telements = this.sort(elements);\n\n\t\t\t\tlet staleItems: IItemMap = {};\n\t\t\t\twhile (this.firstChild !== null) {\n\t\t\t\t\tstaleItems[this.firstChild.id] = this.firstChild;\n\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0, len = elements.length; i < len; i++) {\n\t\t\t\t\tlet element = elements[i];\n\t\t\t\t\tlet id = this.context.dataSource.getId(this.context.tree, element);\n\t\t\t\t\tlet item = staleItems[id] || new Item(id, this.registry, this.context, this.lock, element);\n\t\t\t\t\titem.element = element;\n\t\t\t\t\tif (recursive) {\n\t\t\t\t\t\titem.needsChildrenRefresh = recursive;\n\t\t\t\t\t}\n\t\t\t\t\tdelete staleItems[id];\n\t\t\t\t\tthis.addChild(item);\n\t\t\t\t}\n\n\t\t\t\tfor (let staleItemId in staleItems) {\n\t\t\t\t\tif (staleItems.hasOwnProperty(staleItemId)) {\n\t\t\t\t\t\tstaleItems[staleItemId].dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (recursive) {\n\t\t\t\t\treturn Promise.all(this.mapEachChild((child) => {\n\t\t\t\t\t\treturn child.doRefresh(recursive, true);\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.all(this.mapEachChild((child) => {\n\t\t\t\t\t\tif (child.isExpanded() && child.needsChildrenRefresh) {\n\t\t\t\t\t\t\treturn child.doRefresh(recursive, true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchild.updateVisibility();\n\t\t\t\t\t\t\treturn Promise.resolve(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\treturn result\n\t\t\t\t.then(undefined, onUnexpectedError)\n\t\t\t\t.then(() => this._onDidRefreshChildren.fire(eventData));\n\t\t};\n\n\t\treturn safe ? doRefresh() : this.lock.run(this, doRefresh);\n\t}\n\n\tprivate doRefresh(recursive: boolean, safe: boolean = false): Promise<any> {\n\t\tthis.doesHaveChildren = this.context.dataSource.hasChildren(this.context.tree, this.element);\n\t\tthis.height = this._getHeight();\n\t\tthis.updateVisibility();\n\n\t\tthis._onDidRefresh.fire(this);\n\n\t\treturn this.refreshChildren(recursive, safe);\n\t}\n\n\tprivate updateVisibility(): void {\n\t\tthis.setVisible(this._isVisible());\n\t}\n\n\tpublic refresh(recursive: boolean): Promise<any> {\n\t\treturn this.doRefresh(recursive);\n\t}\n\n\tpublic getNavigator(): INavigator<Item> {\n\t\treturn new TreeNavigator(this);\n\t}\n\n\tpublic intersects(other: Item): boolean {\n\t\treturn this.isAncestorOf(other) || other.isAncestorOf(this);\n\t}\n\n\tprivate isAncestorOf(startItem: Item): boolean {\n\t\tlet item: Item | null = startItem;\n\t\twhile (item) {\n\t\t\tif (item.id === this.id) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\titem = item.parent;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate addChild(item: Item, afterItem: Item | null = this.lastChild): void {\n\t\tlet isEmpty = this.firstChild === null;\n\t\tlet atHead = afterItem === null;\n\t\tlet atTail = afterItem === this.lastChild;\n\n\t\tif (isEmpty) {\n\t\t\tthis.firstChild = this.lastChild = item;\n\t\t\titem.next = item.previous = null;\n\t\t} else if (atHead) {\n\t\t\tif (!this.firstChild) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\tthis.firstChild.previous = item;\n\t\t\titem.next = this.firstChild;\n\t\t\titem.previous = null;\n\t\t\tthis.firstChild = item;\n\t\t} else if (atTail) {\n\t\t\tif (!this.lastChild) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\tthis.lastChild.next = item;\n\t\t\titem.next = null;\n\t\t\titem.previous = this.lastChild;\n\t\t\tthis.lastChild = item;\n\t\t} else {\n\t\t\titem.previous = afterItem;\n\t\t\tif (!afterItem) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\titem.next = afterItem.next;\n\t\t\tif (!afterItem.next) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\tafterItem.next.previous = item;\n\t\t\tafterItem.next = item;\n\t\t}\n\n\t\titem.parent = this;\n\t\titem.depth = this.depth + 1;\n\t}\n\n\tprivate removeChild(item: Item): void {\n\t\tlet isFirstChild = this.firstChild === item;\n\t\tlet isLastChild = this.lastChild === item;\n\n\t\tif (isFirstChild && isLastChild) {\n\t\t\tthis.firstChild = this.lastChild = null;\n\t\t} else if (isFirstChild) {\n\t\t\tif (!item.next) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\titem.next.previous = null;\n\t\t\tthis.firstChild = item.next;\n\t\t} else if (isLastChild) {\n\t\t\tif (!item.previous) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\titem.previous.next = null;\n\t\t\tthis.lastChild = item.previous;\n\t\t} else {\n\t\t\tif (!item.next) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\titem.next.previous = item.previous;\n\t\t\tif (!item.previous) {\n\t\t\t\tthrow new Error('Invalid tree state');\n\t\t\t}\n\t\t\titem.previous.next = item.next;\n\t\t}\n\n\t\titem.parent = null;\n\t\titem.depth = NaN;\n\t}\n\n\tprivate forEachChild(fn: (child: Item) => void): void {\n\t\tlet child = this.firstChild;\n\t\tlet next: Item | null;\n\t\twhile (child) {\n\t\t\tnext = child.next;\n\t\t\tfn(child);\n\t\t\tchild = next;\n\t\t}\n\t}\n\n\tprivate mapEachChild<T>(fn: (child: Item) => T): T[] {\n\t\tlet result: T[] = [];\n\t\tthis.forEachChild((child) => {\n\t\t\tresult.push(fn(child));\n\t\t});\n\t\treturn result;\n\t}\n\n\tprivate sort(elements: any[]): any[] {\n\t\tconst sorter = this.context.sorter;\n\t\tif (sorter) {\n\t\t\treturn elements.sort((element, otherElement) => {\n\t\t\t\treturn sorter.compare(this.context.tree, element, otherElement);\n\t\t\t});\n\t\t}\n\n\t\treturn elements;\n\t}\n\n\t/* protected */ public _getHeight(): number {\n\t\tif (!this.context.renderer) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.context.renderer.getHeight(this.context.tree, this.element);\n\t}\n\n\t/* protected */ public _isVisible(): boolean {\n\t\tif (!this.context.filter) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.context.filter.isVisible(this.context.tree, this.element);\n\t}\n\n\tpublic isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.forEachChild((child) => child.dispose());\n\n\t\tthis.parent = null;\n\t\tthis.previous = null;\n\t\tthis.next = null;\n\t\tthis.firstChild = null;\n\t\tthis.lastChild = null;\n\n\t\tthis._onDidDispose.fire(this);\n\n\t\tthis.registry.deregister(this);\n\n\t\tthis._onDidCreate.dispose();\n\t\tthis._onDidReveal.dispose();\n\t\tthis._onExpand.dispose();\n\t\tthis._onDidExpand.dispose();\n\t\tthis._onCollapse.dispose();\n\t\tthis._onDidCollapse.dispose();\n\t\tthis._onDidAddTrait.dispose();\n\t\tthis._onDidRemoveTrait.dispose();\n\t\tthis._onDidRefresh.dispose();\n\t\tthis._onRefreshChildren.dispose();\n\t\tthis._onDidRefreshChildren.dispose();\n\t\tthis._onDidDispose.dispose();\n\n\t\tthis._isDisposed = true;\n\t}\n}\n\nclass RootItem extends Item {\n\n\tconstructor(id: string, registry: ItemRegistry, context: _.ITreeContext, lock: Lock, element: any) {\n\t\tsuper(id, registry, context, lock, element);\n\t}\n\n\tpublic isVisible(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic setVisible(value: boolean): void {\n\t\t// no-op\n\t}\n\n\tpublic isExpanded(): boolean {\n\t\treturn true;\n\t}\n\n\t/* protected */ public _setExpanded(value: boolean): void {\n\t\t// no-op\n\t}\n\n\t/* protected */ public _getHeight(): number {\n\t\treturn 0;\n\t}\n\n\t/* protected */ public _isVisible(): boolean {\n\t\treturn false;\n\t}\n}\n\nexport class TreeNavigator implements INavigator<Item> {\n\n\tprivate start: Item | null;\n\tprivate item: Item | null;\n\n\tstatic lastDescendantOf(item: Item | null): Item | null {\n\t\tif (!item) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (item instanceof RootItem) {\n\t\t\treturn TreeNavigator.lastDescendantOf(item.lastChild);\n\t\t}\n\n\t\tif (!item.isVisible()) {\n\t\t\treturn TreeNavigator.lastDescendantOf(item.previous);\n\t\t}\n\n\t\tif (!item.isExpanded() || item.lastChild === null) {\n\t\t\treturn item;\n\t\t}\n\n\t\treturn TreeNavigator.lastDescendantOf(item.lastChild);\n\t}\n\n\tconstructor(item: Item | null, subTreeOnly: boolean = true) {\n\t\tthis.item = item;\n\t\tthis.start = subTreeOnly ? item : null;\n\t}\n\n\tpublic current(): Item | null {\n\t\treturn this.item || null;\n\t}\n\n\tpublic next(): Item | null {\n\t\tif (this.item) {\n\t\t\tdo {\n\t\t\t\tif ((this.item instanceof RootItem || (this.item.isVisible() && this.item.isExpanded())) && this.item.firstChild) {\n\t\t\t\t\tthis.item = this.item.firstChild;\n\t\t\t\t} else if (this.item === this.start) {\n\t\t\t\t\tthis.item = null;\n\t\t\t\t} else {\n\t\t\t\t\t// select next brother, next uncle, next great-uncle, etc...\n\t\t\t\t\twhile (this.item && this.item !== this.start && !this.item.next) {\n\t\t\t\t\t\tthis.item = this.item.parent;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.item === this.start) {\n\t\t\t\t\t\tthis.item = null;\n\t\t\t\t\t}\n\t\t\t\t\tthis.item = !this.item ? null : this.item.next;\n\t\t\t\t}\n\t\t\t} while (this.item && !this.item.isVisible());\n\t\t}\n\t\treturn this.item || null;\n\t}\n\n\tpublic previous(): Item | null {\n\t\tif (this.item) {\n\t\t\tdo {\n\t\t\t\tlet previous = TreeNavigator.lastDescendantOf(this.item.previous);\n\t\t\t\tif (previous) {\n\t\t\t\t\tthis.item = previous;\n\t\t\t\t} else if (this.item.parent && this.item.parent !== this.start && this.item.parent.isVisible()) {\n\t\t\t\t\tthis.item = this.item.parent;\n\t\t\t\t} else {\n\t\t\t\t\tthis.item = null;\n\t\t\t\t}\n\t\t\t} while (this.item && !this.item.isVisible());\n\t\t}\n\t\treturn this.item || null;\n\t}\n\n\tpublic parent(): Item | null {\n\t\tif (this.item) {\n\t\t\tlet parent = this.item.parent;\n\t\t\tif (parent && parent !== this.start && parent.isVisible()) {\n\t\t\t\tthis.item = parent;\n\t\t\t} else {\n\t\t\t\tthis.item = null;\n\t\t\t}\n\t\t}\n\t\treturn this.item || null;\n\t}\n\n\tpublic first(): Item | null {\n\t\tthis.item = this.start;\n\t\tthis.next();\n\t\treturn this.item || null;\n\t}\n\n\tpublic last(): Item | null {\n\t\treturn TreeNavigator.lastDescendantOf(this.start);\n\t}\n}\n\nexport interface IBaseEvent {\n\titem: Item | null;\n}\n\nexport interface IInputEvent extends IBaseEvent { }\n\nexport interface IRefreshEvent extends IBaseEvent {\n\trecursive: boolean;\n}\n\nexport class TreeModel {\n\n\tprivate context: _.ITreeContext;\n\tprivate lock: Lock;\n\tprivate input: Item | null;\n\tprivate registry: ItemRegistry;\n\tprivate registryDisposable: IDisposable;\n\tprivate traitsToItems: ITraitMap;\n\n\tprivate _onSetInput = new Emitter<IInputEvent>();\n\treadonly onSetInput: Event<IInputEvent> = this._onSetInput.event;\n\tprivate _onDidSetInput = new Emitter<IInputEvent>();\n\treadonly onDidSetInput: Event<IInputEvent> = this._onDidSetInput.event;\n\tprivate _onRefresh = new Emitter<IRefreshEvent>();\n\treadonly onRefresh: Event<IRefreshEvent> = this._onRefresh.event;\n\tprivate _onDidRefresh = new Emitter<IRefreshEvent>();\n\treadonly onDidRefresh: Event<IRefreshEvent> = this._onDidRefresh.event;\n\tprivate _onDidHighlight = new Emitter<_.IHighlightEvent>();\n\treadonly onDidHighlight: Event<_.IHighlightEvent> = this._onDidHighlight.event;\n\tprivate _onDidSelect = new Emitter<_.ISelectionEvent>();\n\treadonly onDidSelect: Event<_.ISelectionEvent> = this._onDidSelect.event;\n\tprivate _onDidFocus = new Emitter<_.IFocusEvent>();\n\treadonly onDidFocus: Event<_.IFocusEvent> = this._onDidFocus.event;\n\n\tprivate _onDidRevealItem = new Relay<IItemRevealEvent>();\n\treadonly onDidRevealItem: Event<IItemRevealEvent> = this._onDidRevealItem.event;\n\tprivate _onExpandItem = new Relay<IItemExpandEvent>();\n\treadonly onExpandItem: Event<IItemExpandEvent> = this._onExpandItem.event;\n\tprivate _onDidExpandItem = new Relay<IItemExpandEvent>();\n\treadonly onDidExpandItem: Event<IItemExpandEvent> = this._onDidExpandItem.event;\n\tprivate _onCollapseItem = new Relay<IItemCollapseEvent>();\n\treadonly onCollapseItem: Event<IItemCollapseEvent> = this._onCollapseItem.event;\n\tprivate _onDidCollapseItem = new Relay<IItemCollapseEvent>();\n\treadonly onDidCollapseItem: Event<IItemCollapseEvent> = this._onDidCollapseItem.event;\n\tprivate _onDidAddTraitItem = new Relay<IItemTraitEvent>();\n\treadonly onDidAddTraitItem: Event<IItemTraitEvent> = this._onDidAddTraitItem.event;\n\tprivate _onDidRemoveTraitItem = new Relay<IItemCollapseEvent>();\n\treadonly onDidRemoveTraitItem: Event<IItemCollapseEvent> = this._onDidRemoveTraitItem.event;\n\tprivate _onDidRefreshItem = new Relay<Item>();\n\treadonly onDidRefreshItem: Event<Item> = this._onDidRefreshItem.event;\n\tprivate _onRefreshItemChildren = new Relay<IItemChildrenRefreshEvent>();\n\treadonly onRefreshItemChildren: Event<IItemChildrenRefreshEvent> = this._onRefreshItemChildren.event;\n\tprivate _onDidRefreshItemChildren = new Relay<IItemChildrenRefreshEvent>();\n\treadonly onDidRefreshItemChildren: Event<IItemChildrenRefreshEvent> = this._onDidRefreshItemChildren.event;\n\tprivate _onDidDisposeItem = new Relay<Item>();\n\n\tconstructor(context: _.ITreeContext) {\n\t\tthis.context = context;\n\t\tthis.input = null;\n\t\tthis.traitsToItems = {};\n\t}\n\n\tpublic setInput(element: any): Promise<any> {\n\t\tlet eventData: IInputEvent = { item: this.input };\n\t\tthis._onSetInput.fire(eventData);\n\n\t\tthis.setSelection([]);\n\t\tthis.setFocus();\n\t\tthis.setHighlight();\n\n\t\tthis.lock = new Lock();\n\n\t\tif (this.input) {\n\t\t\tthis.input.dispose();\n\t\t}\n\n\t\tif (this.registry) {\n\t\t\tthis.registry.dispose();\n\t\t\tthis.registryDisposable.dispose();\n\t\t}\n\n\t\tthis.registry = new ItemRegistry();\n\n\t\tthis._onDidRevealItem.input = this.registry.onDidRevealItem;\n\t\tthis._onExpandItem.input = this.registry.onExpandItem;\n\t\tthis._onDidExpandItem.input = this.registry.onDidExpandItem;\n\t\tthis._onCollapseItem.input = this.registry.onCollapseItem;\n\t\tthis._onDidCollapseItem.input = this.registry.onDidCollapseItem;\n\t\tthis._onDidAddTraitItem.input = this.registry.onDidAddTraitItem;\n\t\tthis._onDidRemoveTraitItem.input = this.registry.onDidRemoveTraitItem;\n\t\tthis._onDidRefreshItem.input = this.registry.onDidRefreshItem;\n\t\tthis._onRefreshItemChildren.input = this.registry.onRefreshItemChildren;\n\t\tthis._onDidRefreshItemChildren.input = this.registry.onDidRefreshItemChildren;\n\t\tthis._onDidDisposeItem.input = this.registry.onDidDisposeItem;\n\n\t\tthis.registryDisposable = this.registry\n\t\t\t.onDidDisposeItem(item => item.getAllTraits().forEach(trait => delete this.traitsToItems[trait][item.id]));\n\n\t\tlet id = this.context.dataSource.getId(this.context.tree, element);\n\t\tthis.input = new RootItem(id, this.registry, this.context, this.lock, element);\n\t\teventData = { item: this.input };\n\t\tthis._onDidSetInput.fire(eventData);\n\t\treturn this.refresh(this.input);\n\t}\n\n\tpublic getInput(): any {\n\t\treturn this.input ? this.input.getElement() : null;\n\t}\n\n\tpublic refresh(element: any = null, recursive: boolean = true): Promise<any> {\n\t\tlet item = this.getItem(element);\n\n\t\tif (!item) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\tlet eventData: IRefreshEvent = { item: item, recursive: recursive };\n\t\tthis._onRefresh.fire(eventData);\n\t\treturn item.refresh(recursive).then(() => {\n\t\t\tthis._onDidRefresh.fire(eventData);\n\t\t});\n\t}\n\n\tpublic expand(element: any): Promise<any> {\n\t\tlet item = this.getItem(element);\n\n\t\tif (!item) {\n\t\t\treturn Promise.resolve(false);\n\t\t}\n\n\t\treturn item.expand();\n\t}\n\n\tpublic collapse(element: any, recursive: boolean = false): Promise<any> {\n\t\tconst item = this.getItem(element);\n\n\t\tif (!item) {\n\t\t\treturn Promise.resolve(false);\n\t\t}\n\n\t\treturn item.collapse(recursive);\n\t}\n\n\tpublic toggleExpansion(element: any, recursive: boolean = false): Promise<any> {\n\t\treturn this.isExpanded(element) ? this.collapse(element, recursive) : this.expand(element);\n\t}\n\n\tpublic isExpanded(element: any): boolean {\n\t\tlet item = this.getItem(element);\n\n\t\tif (!item) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn item.isExpanded();\n\t}\n\n\tpublic reveal(element: any, relativeTop: number | null = null): Promise<any> {\n\t\treturn this.resolveUnknownParentChain(element).then((chain: any[]) => {\n\t\t\tlet result = Promise.resolve(null);\n\n\t\t\tchain.forEach((e) => {\n\t\t\t\tresult = result.then(() => this.expand(e));\n\t\t\t});\n\n\t\t\treturn result;\n\t\t}).then(() => {\n\t\t\tlet item = this.getItem(element);\n\n\t\t\tif (item) {\n\t\t\t\treturn item.reveal(relativeTop);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate resolveUnknownParentChain(element: any): Promise<any> {\n\t\treturn this.context.dataSource.getParent(this.context.tree, element).then((parent) => {\n\t\t\tif (!parent) {\n\t\t\t\treturn Promise.resolve([]);\n\t\t\t}\n\n\t\t\treturn this.resolveUnknownParentChain(parent).then((result) => {\n\t\t\t\tresult.push(parent);\n\t\t\t\treturn result;\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic setHighlight(element?: any, eventPayload?: any): void {\n\t\tthis.setTraits('highlighted', element ? [element] : []);\n\t\tlet eventData: _.IHighlightEvent = { highlight: this.getHighlight(), payload: eventPayload };\n\t\tthis._onDidHighlight.fire(eventData);\n\t}\n\n\tpublic getHighlight(includeHidden: boolean = false): any {\n\t\tlet result = this.getElementsWithTrait('highlighted', includeHidden);\n\t\treturn result.length === 0 ? null : result[0];\n\t}\n\n\tpublic setSelection(elements: any[], eventPayload?: any): void {\n\t\tthis.setTraits('selected', elements);\n\t\tlet eventData: _.ISelectionEvent = { selection: this.getSelection(), payload: eventPayload };\n\t\tthis._onDidSelect.fire(eventData);\n\t}\n\n\tpublic getSelection(includeHidden: boolean = false): any[] {\n\t\treturn this.getElementsWithTrait('selected', includeHidden);\n\t}\n\n\tpublic setFocus(element?: any, eventPayload?: any): void {\n\t\tthis.setTraits('focused', element ? [element] : []);\n\t\tlet eventData: _.IFocusEvent = { focus: this.getFocus(), payload: eventPayload };\n\t\tthis._onDidFocus.fire(eventData);\n\t}\n\n\tpublic getFocus(includeHidden: boolean = false): any {\n\t\tlet result = this.getElementsWithTrait('focused', includeHidden);\n\t\treturn result.length === 0 ? null : result[0];\n\t}\n\n\tpublic focusNext(count: number = 1, eventPayload?: any): void {\n\t\tlet item: Item = this.getFocus() || this.input;\n\t\tlet nextItem: Item | null;\n\t\tlet nav = this.getNavigator(item, false);\n\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tnextItem = nav.next();\n\t\t\tif (!nextItem) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titem = nextItem;\n\t\t}\n\n\t\tthis.setFocus(item, eventPayload);\n\t}\n\n\tpublic focusPrevious(count: number = 1, eventPayload?: any): void {\n\t\tlet item: Item = this.getFocus() || this.input;\n\t\tlet previousItem: Item | null;\n\t\tlet nav = this.getNavigator(item, false);\n\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tpreviousItem = nav.previous();\n\t\t\tif (!previousItem) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titem = previousItem;\n\t\t}\n\n\t\tthis.setFocus(item, eventPayload);\n\t}\n\n\tpublic focusParent(eventPayload?: any): void {\n\t\tlet item: Item = this.getFocus() || this.input;\n\t\tlet nav = this.getNavigator(item, false);\n\t\tlet parent = nav.parent();\n\n\t\tif (parent) {\n\t\t\tthis.setFocus(parent, eventPayload);\n\t\t}\n\t}\n\n\tpublic focusFirstChild(eventPayload?: any): void {\n\t\tconst item = this.getItem(this.getFocus() || this.input);\n\t\tconst nav = this.getNavigator(item, false);\n\t\tconst next = nav.next();\n\t\tconst parent = nav.parent();\n\n\t\tif (parent === item) {\n\t\t\tthis.setFocus(next, eventPayload);\n\t\t}\n\t}\n\n\tpublic focusFirst(eventPayload?: any, from?: any): void {\n\t\tthis.focusNth(0, eventPayload, from);\n\t}\n\n\tpublic focusNth(index: number, eventPayload?: any, from?: any): void {\n\t\tlet navItem = this.getParent(from);\n\t\tlet nav = this.getNavigator(navItem);\n\t\tlet item = nav.first();\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\titem = nav.next();\n\t\t}\n\n\t\tif (item) {\n\t\t\tthis.setFocus(item, eventPayload);\n\t\t}\n\t}\n\n\tpublic focusLast(eventPayload?: any, from?: any): void {\n\t\tconst navItem = this.getParent(from);\n\t\tlet item: Item | null;\n\t\tif (from && navItem) {\n\t\t\titem = navItem.lastChild;\n\t\t} else {\n\t\t\tconst nav = this.getNavigator(navItem);\n\t\t\titem = nav.last();\n\t\t}\n\n\t\tif (item) {\n\t\t\tthis.setFocus(item, eventPayload);\n\t\t}\n\t}\n\n\tprivate getParent(from?: any): Item | null {\n\t\tif (from) {\n\t\t\tconst fromItem = this.getItem(from);\n\t\t\tif (fromItem && fromItem.parent) {\n\t\t\t\treturn fromItem.parent;\n\t\t\t}\n\t\t}\n\n\t\treturn this.getItem(this.input);\n\t}\n\n\tpublic getNavigator(element: any = null, subTreeOnly: boolean = true): INavigator<Item> {\n\t\treturn new TreeNavigator(this.getItem(element), subTreeOnly);\n\t}\n\n\tpublic getItem(element: any = null): Item | null {\n\t\tif (element === null) {\n\t\t\treturn this.input;\n\t\t} else if (element instanceof Item) {\n\t\t\treturn element;\n\t\t} else if (typeof element === 'string') {\n\t\t\treturn this.registry.getItem(element);\n\t\t} else {\n\t\t\treturn this.registry.getItem(this.context.dataSource.getId(this.context.tree, element));\n\t\t}\n\t}\n\n\tpublic removeTraits(trait: string, elements: any[]): void {\n\t\tlet items: IItemMap = this.traitsToItems[trait] || <IItemMap>{};\n\t\tlet item: Item | null;\n\t\tlet id: string;\n\n\t\tif (elements.length === 0) {\n\t\t\tfor (id in items) {\n\t\t\t\tif (items.hasOwnProperty(id)) {\n\t\t\t\t\titem = items[id];\n\t\t\t\t\titem.removeTrait(trait);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdelete this.traitsToItems[trait];\n\n\t\t} else {\n\t\t\tfor (let i = 0, len = elements.length; i < len; i++) {\n\t\t\t\titem = this.getItem(elements[i]);\n\n\t\t\t\tif (item) {\n\t\t\t\t\titem.removeTrait(trait);\n\t\t\t\t\tdelete items[item.id];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setTraits(trait: string, elements: any[]): void {\n\t\tif (elements.length === 0) {\n\t\t\tthis.removeTraits(trait, elements);\n\t\t} else {\n\t\t\tlet items: { [id: string]: Item; } = {};\n\t\t\tlet item: Item | null;\n\n\t\t\tfor (let i = 0, len = elements.length; i < len; i++) {\n\t\t\t\titem = this.getItem(elements[i]);\n\n\t\t\t\tif (item) {\n\t\t\t\t\titems[item.id] = item;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet traitItems: IItemMap = this.traitsToItems[trait] || <IItemMap>{};\n\t\t\tlet itemsToRemoveTrait: Item[] = [];\n\t\t\tlet id: string;\n\n\t\t\tfor (id in traitItems) {\n\t\t\t\tif (traitItems.hasOwnProperty(id)) {\n\t\t\t\t\tif (items.hasOwnProperty(id)) {\n\t\t\t\t\t\tdelete items[id];\n\t\t\t\t\t} else {\n\t\t\t\t\t\titemsToRemoveTrait.push(traitItems[id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0, len = itemsToRemoveTrait.length; i < len; i++) {\n\t\t\t\titem = itemsToRemoveTrait[i];\n\t\t\t\titem.removeTrait(trait);\n\t\t\t\tdelete traitItems[item.id];\n\t\t\t}\n\n\t\t\tfor (id in items) {\n\t\t\t\tif (items.hasOwnProperty(id)) {\n\t\t\t\t\titem = items[id];\n\t\t\t\t\titem.addTrait(trait);\n\t\t\t\t\ttraitItems[id] = item;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.traitsToItems[trait] = traitItems;\n\t\t}\n\t}\n\n\tprivate getElementsWithTrait(trait: string, includeHidden: boolean): any[] {\n\t\tlet elements: any[] = [];\n\t\tlet items = this.traitsToItems[trait] || {};\n\t\tlet id: string;\n\t\tfor (id in items) {\n\t\t\tif (items.hasOwnProperty(id) && (items[id].isVisible() || includeHidden)) {\n\t\t\t\telements.push(items[id].getElement());\n\t\t\t}\n\t\t}\n\t\treturn elements;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.registry) {\n\t\t\tthis.registry.dispose();\n\t\t\tthis.registry = null!; // StrictNullOverride: nulling out ok in dispose\n\t\t}\n\n\t\tthis._onSetInput.dispose();\n\t\tthis._onDidSetInput.dispose();\n\t\tthis._onRefresh.dispose();\n\t\tthis._onDidRefresh.dispose();\n\t\tthis._onDidHighlight.dispose();\n\t\tthis._onDidSelect.dispose();\n\t\tthis._onDidFocus.dispose();\n\t\tthis._onDidRevealItem.dispose();\n\t\tthis._onExpandItem.dispose();\n\t\tthis._onDidExpandItem.dispose();\n\t\tthis._onCollapseItem.dispose();\n\t\tthis._onDidCollapseItem.dispose();\n\t\tthis._onDidAddTraitItem.dispose();\n\t\tthis._onDidRemoveTraitItem.dispose();\n\t\tthis._onDidRefreshItem.dispose();\n\t\tthis._onRefreshItemChildren.dispose();\n\t\tthis._onDidRefreshItemChildren.dispose();\n\t\tthis._onDidDisposeItem.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 { INextIterator, ArrayIterator } from 'vs/base/common/iterator';\nimport { Item } from './treeModel';\n\nexport interface IViewItem {\n\tmodel: Item;\n\ttop: number;\n\theight: number;\n}\n\nexport class HeightMap {\n\n\tprivate heightMap: IViewItem[] = [];\n\tprivate indexes: { [item: string]: number; } = {};\n\n\tgetContentHeight(): number {\n\t\tlet last = this.heightMap[this.heightMap.length - 1];\n\t\treturn !last ? 0 : last.top + last.height;\n\t}\n\n\tonInsertItems(iterator: INextIterator<Item>, afterItemId: string | null = null): number | undefined {\n\t\tlet item: Item | null = null;\n\t\tlet viewItem: IViewItem;\n\t\tlet i: number, j: number;\n\t\tlet totalSize: number;\n\t\tlet sizeDiff = 0;\n\n\t\tif (afterItemId === null) {\n\t\t\ti = 0;\n\t\t\ttotalSize = 0;\n\t\t} else {\n\t\t\ti = this.indexes[afterItemId] + 1;\n\t\t\tviewItem = this.heightMap[i - 1];\n\n\t\t\tif (!viewItem) {\n\t\t\t\tconsole.error('view item doesnt exist');\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\ttotalSize = viewItem.top + viewItem.height;\n\t\t}\n\n\t\tlet boundSplice = this.heightMap.splice.bind(this.heightMap, i, 0);\n\n\t\tlet itemsToInsert: IViewItem[] = [];\n\n\t\twhile (item = iterator.next()) {\n\t\t\tviewItem = this.createViewItem(item);\n\t\t\tviewItem.top = totalSize + sizeDiff;\n\n\t\t\tthis.indexes[item.id] = i++;\n\t\t\titemsToInsert.push(viewItem);\n\t\t\tsizeDiff += viewItem.height;\n\t\t}\n\n\t\tboundSplice.apply(this.heightMap, itemsToInsert);\n\n\t\tfor (j = i; j < this.heightMap.length; j++) {\n\t\t\tviewItem = this.heightMap[j];\n\t\t\tviewItem.top += sizeDiff;\n\t\t\tthis.indexes[viewItem.model.id] = j;\n\t\t}\n\n\t\tfor (j = itemsToInsert.length - 1; j >= 0; j--) {\n\t\t\tthis.onInsertItem(itemsToInsert[j]);\n\t\t}\n\n\t\tfor (j = this.heightMap.length - 1; j >= i; j--) {\n\t\t\tthis.onRefreshItem(this.heightMap[j]);\n\t\t}\n\n\t\treturn sizeDiff;\n\t}\n\n\tonInsertItem(item: IViewItem): void {\n\t\t// noop\n\t}\n\n\t// Contiguous items\n\tonRemoveItems(iterator: INextIterator<string>): void {\n\t\tlet itemId: string | null = null;\n\t\tlet viewItem: IViewItem;\n\t\tlet startIndex: number | null = null;\n\t\tlet i = 0;\n\t\tlet sizeDiff = 0;\n\n\t\twhile (itemId = iterator.next()) {\n\t\t\ti = this.indexes[itemId];\n\t\t\tviewItem = this.heightMap[i];\n\n\t\t\tif (!viewItem) {\n\t\t\t\tconsole.error('view item doesnt exist');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsizeDiff -= viewItem.height;\n\t\t\tdelete this.indexes[itemId];\n\t\t\tthis.onRemoveItem(viewItem);\n\n\t\t\tif (startIndex === null) {\n\t\t\t\tstartIndex = i;\n\t\t\t}\n\t\t}\n\n\t\tif (sizeDiff === 0 || startIndex === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.heightMap.splice(startIndex, i - startIndex + 1);\n\n\t\tfor (i = startIndex; i < this.heightMap.length; i++) {\n\t\t\tviewItem = this.heightMap[i];\n\t\t\tviewItem.top += sizeDiff;\n\t\t\tthis.indexes[viewItem.model.id] = i;\n\t\t\tthis.onRefreshItem(viewItem);\n\t\t}\n\t}\n\n\tonRemoveItem(item: IViewItem): void {\n\t\t// noop\n\t}\n\n\tonRefreshItemSet(items: Item[]): void {\n\t\tlet sortedItems = items.sort((a, b) => this.indexes[a.id] - this.indexes[b.id]);\n\t\tthis.onRefreshItems(new ArrayIterator(sortedItems));\n\t}\n\n\t// Ordered, but not necessarily contiguous items\n\tonRefreshItems(iterator: INextIterator<Item>): void {\n\t\tlet item: Item | null = null;\n\t\tlet viewItem: IViewItem;\n\t\tlet newHeight: number;\n\t\tlet i: number, j: number | null = null;\n\t\tlet cummDiff = 0;\n\n\t\twhile (item = iterator.next()) {\n\t\t\ti = this.indexes[item.id];\n\n\t\t\tfor (; cummDiff !== 0 && j !== null && j < i; j++) {\n\t\t\t\tviewItem = this.heightMap[j];\n\t\t\t\tviewItem.top += cummDiff;\n\t\t\t\tthis.onRefreshItem(viewItem);\n\t\t\t}\n\n\t\t\tviewItem = this.heightMap[i];\n\t\t\tnewHeight = item.getHeight();\n\t\t\tviewItem.top += cummDiff;\n\t\t\tcummDiff += newHeight - viewItem.height;\n\t\t\tviewItem.height = newHeight;\n\t\t\tthis.onRefreshItem(viewItem, true);\n\n\t\t\tj = i + 1;\n\t\t}\n\n\t\tif (cummDiff !== 0 && j !== null) {\n\t\t\tfor (; j < this.heightMap.length; j++) {\n\t\t\t\tviewItem = this.heightMap[j];\n\t\t\t\tviewItem.top += cummDiff;\n\t\t\t\tthis.onRefreshItem(viewItem);\n\t\t\t}\n\t\t}\n\t}\n\n\tonRefreshItem(item: IViewItem, needsRender: boolean = false): void {\n\t\t// noop\n\t}\n\n\tindexAt(position: number): number {\n\t\tlet left = 0;\n\t\tlet right = this.heightMap.length;\n\t\tlet center: number;\n\t\tlet item: IViewItem;\n\n\t\t// Binary search\n\t\twhile (left < right) {\n\t\t\tcenter = Math.floor((left + right) / 2);\n\t\t\titem = this.heightMap[center];\n\n\t\t\tif (position < item.top) {\n\t\t\t\tright = center;\n\t\t\t} else if (position >= item.top + item.height) {\n\t\t\t\tif (left === center) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tleft = center;\n\t\t\t} else {\n\t\t\t\treturn center;\n\t\t\t}\n\t\t}\n\n\t\treturn this.heightMap.length;\n\t}\n\n\tindexAfter(position: number): number {\n\t\treturn Math.min(this.indexAt(position) + 1, this.heightMap.length);\n\t}\n\n\titemAtIndex(index: number): IViewItem {\n\t\treturn this.heightMap[index];\n\t}\n\n\titemAfter(item: IViewItem): IViewItem {\n\t\treturn this.heightMap[this.indexes[item.model.id] + 1] || null;\n\t}\n\n\tprotected createViewItem(item: Item): IViewItem {\n\t\tthrow new Error('not implemented');\n\t}\n\n\tdispose(): void {\n\t\tthis.heightMap = [];\n\t\tthis.indexes = {};\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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\nfunction getWorker(workerId: string, 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(workerId, label);\n\t\t}\n\t\tif (typeof globals.MonacoEnvironment.getWorkerUrl === 'function') {\n\t\t\treturn new Worker(globals.MonacoEnvironment.getWorkerUrl(workerId, 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\n\t\tconst workerMain = require.toUrl('./' + workerId);\n\t\tif (/^(http:)|(https:)|(file:)/.test(workerMain)) {\n\t\t\tconst currentUrl = String(window.location);\n\t\t\tconst currentOrigin = currentUrl.substr(0, currentUrl.length - window.location.hash.length - window.location.search.length - window.location.pathname.length);\n\t\t\tif (workerMain.substring(0, currentOrigin.length) !== currentOrigin) {\n\t\t\t\t// this is the cross-origin case\n\t\t\t\t// i.e. the webpage is running at a different origin than where the scripts are loaded from\n\t\t\t\tconst workerBaseUrl = workerMain.substr(0, workerMain.length - 'vs/base/worker/workerMain.js'.length);\n\t\t\t\tconst js = `/*${label}*/self.MonacoEnvironment={baseUrl: '${workerBaseUrl}'};importScripts('${workerMain}');/*${label}*/`;\n\t\t\t\tconst url = `data:text/javascript;charset=utf-8,${encodeURIComponent(js)}`;\n\t\t\t\treturn new Worker(url);\n\t\t\t}\n\t\t}\n\t\treturn new Worker(workerMain + '#' + label);\n\t}\n\t// ESM-comment-end\n\tthrow new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`);\n}\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('workerMain.js', 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: any) {\n\t\t\t\tonMessageCallback(ev.data);\n\t\t\t};\n\t\t\t(<any>w).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(msg: string): void {\n\t\tif (this.worker) {\n\t\t\tthis.worker.then(w => w.postMessage(msg));\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 'vs/css!./checkbox';\nimport * as DOM from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\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 * as objects from 'vs/base/common/objects';\n\nexport interface ICheckboxOpts extends ICheckboxStyles {\n\treadonly actionClassName?: string;\n\treadonly title: string;\n\treadonly isChecked: boolean;\n}\n\nexport interface ICheckboxStyles {\n\tinputActiveOptionBorder?: Color;\n}\n\nconst defaultOpts = {\n\tinputActiveOptionBorder: Color.fromHex('#007ACC')\n};\n\nexport class Checkbox extends Widget {\n\n\tprivate readonly _onChange = this._register(new Emitter<boolean>());\n\tget onChange(): Event<boolean /* via keyboard */> { return this._onChange.event; }\n\n\tprivate readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());\n\tget onKeyDown(): Event<IKeyboardEvent> { return 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 = objects.deepClone(opts);\n\t\tobjects.mixin(this._opts, defaultOpts, false);\n\t\tthis._checked = this._opts.isChecked;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.title = this._opts.title;\n\t\tthis.domNode.className = 'monaco-custom-checkbox ' + (this._opts.actionClassName || '') + ' ' + (this._checked ? 'checked' : 'unchecked');\n\t\tthis.domNode.tabIndex = 0;\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\tthis.checked = !this._checked;\n\t\t\tthis._onChange.fire(false);\n\t\t\tev.preventDefault();\n\t\t});\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\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\t\tthis.domNode.setAttribute('aria-checked', String(this._checked));\n\t\tif (this._checked) {\n\t\t\tthis.domNode.classList.add('checked');\n\t\t} else {\n\t\t\tthis.domNode.classList.remove('checked');\n\t\t}\n\n\t\tthis.applyStyles();\n\t}\n\n\twidth(): number {\n\t\treturn 2 /*marginleft*/ + 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\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() : 'transparent';\n\t\t}\n\t}\n\n\tenable(): void {\n\t\tthis.domNode.tabIndex = 0;\n\t\tthis.domNode.setAttribute('aria-disabled', String(false));\n\t}\n\n\tdisable(): void {\n\t\tDOM.removeTabIndexAndUpdateFocus(this.domNode);\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 'vs/css!./contextview';\nimport * as DOM from 'vs/base/browser/dom';\nimport { IDisposable, dispose, toDisposable, combinedDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport { Range } from 'vs/base/common/range';\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 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\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: any): void;\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate): 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 interface ILayoutAnchor {\n\toffset: number;\n\tsize: number;\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 anchorEnd = anchor.offset + anchor.size;\n\n\tif (anchor.position === LayoutAnchorPosition.Before) {\n\t\tif (viewSize <= viewportSize - anchorEnd) {\n\t\t\treturn anchorEnd; // happy case, lay it out after the anchor\n\t\t}\n\n\t\tif (viewSize <= anchor.offset) {\n\t\t\treturn anchor.offset - 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 <= anchor.offset) {\n\t\t\treturn anchor.offset - viewSize; // happy case, lay it out before the anchor\n\t\t}\n\n\t\tif (viewSize <= viewportSize - anchorEnd) {\n\t\t\treturn anchorEnd; // 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;\n\tprivate view: HTMLElement;\n\tprivate delegate: IDelegate | null;\n\tprivate toDisposeOnClean: IDisposable | null;\n\tprivate toDisposeOnSetContainer: IDisposable;\n\n\tconstructor(container: HTMLElement) {\n\t\tsuper();\n\n\t\tthis.view = DOM.$('.context-view');\n\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container);\n\n\t\tthis._register(toDisposable(() => this.setContainer(null)));\n\t}\n\n\tsetContainer(container: HTMLElement | null): void {\n\t\tif (this.container) {\n\t\t\tdispose(this.toDisposeOnSetContainer);\n\t\t\tthis.container.removeChild(this.view);\n\t\t\tthis.container = null;\n\t\t}\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tthis.container.appendChild(this.view);\n\n\t\t\tconst toDisposeOnSetContainer: IDisposable[] = [];\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.push(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {\n\t\t\t\t\tthis.onDOMEvent(e, <HTMLElement>document.activeElement, 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.push(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {\n\t\t\t\t\tthis.onDOMEvent(e, <HTMLElement>document.activeElement, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = combinedDisposable(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\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view);\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\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false) {\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\tlet realAnchor = <IAnchor>anchor;\n\n\t\t\taround = {\n\t\t\t\ttop: realAnchor.y,\n\t\t\t\tleft: realAnchor.x,\n\t\t\t\twidth: realAnchor.width || 1,\n\t\t\t\theight: realAnchor.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\n\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top - window.pageYOffset, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\n\t\tlet horizontalAnchor: ILayoutAnchor;\n\n\t\tif (anchorAlignment === AnchorAlignment.LEFT) {\n\t\t\thorizontalAnchor = { offset: around.left, size: 0, position: LayoutAnchorPosition.Before };\n\t\t} else {\n\t\t\thorizontalAnchor = { offset: around.left + around.width, size: 0, position: LayoutAnchorPosition.After };\n\t\t}\n\n\t\tconst top = layout(window.innerHeight, viewSizeHeight, verticalAnchor) + window.pageYOffset;\n\n\t\t// if view intersects vertically with anchor, shift it horizontally\n\t\tif (Range.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) {\n\t\t\thorizontalAnchor.size = around.width;\n\t\t}\n\n\t\tconst left = layout(window.innerWidth, viewSizeWidth, horizontalAnchor);\n\n\t\tDOM.removeClasses(this.view, 'top', 'bottom', 'left', 'right');\n\t\tDOM.addClass(this.view, anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tDOM.addClass(this.view, anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\n\t\tconst containerPosition = DOM.getDomNodePagePosition(this.container!);\n\t\tthis.view.style.top = `${top - containerPosition.top}px`;\n\t\tthis.view.style.left = `${left - containerPosition.left}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: any): void {\n\t\tif (this.delegate && this.delegate.onHide) {\n\t\t\tthis.delegate.onHide(data);\n\t\t}\n\n\t\tthis.delegate = null;\n\n\t\tif (this.toDisposeOnClean) {\n\t\t\tthis.toDisposeOnClean.dispose();\n\t\t\tthis.toDisposeOnClean = null;\n\t\t}\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, element: HTMLElement, 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\tdispose(): void {\n\t\tthis.hide();\n\n\t\tsuper.dispose();\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 'vs/css!./countBadge';\nimport { $, append } from 'vs/base/browser/dom';\nimport { format } from 'vs/base/common/strings';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\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 {\n\n\tprivate element: HTMLElement;\n\tprivate count: number;\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() : null;\n\t\t\tconst foreground = this.badgeForeground ? this.badgeForeground.toString() : null;\n\t\t\tconst border = this.badgeBorder ? this.badgeBorder.toString() : null;\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' : null;\n\t\t\tthis.element.style.borderStyle = border ? 'solid' : null;\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!./iconlabel';\nimport * as dom from 'vs/base/browser/dom';\nimport { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';\nimport { IMatch } from 'vs/base/common/filters';\nimport { Disposable } from 'vs/base/common/lifecycle';\n\nexport interface IIconLabelCreationOptions {\n\tsupportHighlights?: boolean;\n\tsupportDescriptionHighlights?: boolean;\n\tdonotSupportOcticons?: boolean;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string;\n\tdescriptionTitle?: string;\n\textraClasses?: string[];\n\titalic?: boolean;\n\tmatches?: IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: IMatch[];\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean;\n\tprivate _textContent: string;\n\tprivate _className: string;\n\tprivate _title: string;\n\tprivate _empty: boolean;\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 title(title: string) {\n\t\tif (this.disposed || title === this._title) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._title = title;\n\t\tif (this._title) {\n\t\t\tthis._element.title = title;\n\t\t} else {\n\t\t\tthis._element.removeAttribute('title');\n\t\t}\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' : null;\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\tprivate domNode: FastLabelNode;\n\tprivate labelDescriptionContainer: FastLabelNode;\n\tprivate labelNode: FastLabelNode | HighlightedLabel;\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel;\n\tprivate descriptionNodeFactory: () => FastLabelNode | HighlightedLabel;\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.labelDescriptionContainer = this._register(new FastLabelNode(dom.append(this.domNode.element, dom.$('.monaco-icon-label-description-container'))));\n\n\t\tif (options && options.supportHighlights) {\n\t\t\tthis.labelNode = new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name')), !options.donotSupportOcticons);\n\t\t} else {\n\t\t\tthis.labelNode = this._register(new FastLabelNode(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name'))));\n\t\t}\n\n\t\tif (options && options.supportDescriptionHighlights) {\n\t\t\tthis.descriptionNodeFactory = () => new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description')), !options.donotSupportOcticons);\n\t\t} else {\n\t\t\tthis.descriptionNodeFactory = () => this._register(new FastLabelNode(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description'))));\n\t\t}\n\t}\n\n\tsetLabel(label?: 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\t\t}\n\n\t\tthis.domNode.className = classes.join(' ');\n\t\tthis.domNode.title = options && options.title ? options.title : '';\n\n\t\tif (this.labelNode instanceof HighlightedLabel) {\n\t\t\tthis.labelNode.set(label || '', options ? options.matches : undefined, options && options.title ? options.title : undefined, options && options.labelEscapeNewLines);\n\t\t} else {\n\t\t\tthis.labelNode.textContent = label || '';\n\t\t}\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\tif (options && options.descriptionTitle) {\n\t\t\t\t\tthis.descriptionNode.element.title = options.descriptionTitle;\n\t\t\t\t} else {\n\t\t\t\t\tthis.descriptionNode.element.removeAttribute('title');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode.textContent = description || '';\n\t\t\t\tthis.descriptionNode.title = options && options.descriptionTitle ? options.descriptionTitle : '';\n\t\t\t\tthis.descriptionNode.empty = !description;\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!./progressbar';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\nimport { removeClasses, addClass, hasClass, hide, show } from 'vs/base/browser/dom';\nimport { RunOnceScheduler } from 'vs/base/common/async';\n\nconst css_done = 'done';\nconst css_active = 'active';\nconst css_infinite = 'infinite';\nconst css_discrete = 'discrete';\nconst css_progress_container = 'monaco-progress-container';\nconst css_progress_bit = 'progress-bit';\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\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\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._register(this.showDelayedScheduler = new RunOnceScheduler(() => show(this.element), 0));\n\n\t\tthis.create(container);\n\t}\n\n\tprivate create(container: HTMLElement): void {\n\t\tthis.element = document.createElement('div');\n\t\taddClass(this.element, css_progress_container);\n\t\tcontainer.appendChild(this.element);\n\n\t\tthis.bit = document.createElement('div');\n\t\taddClass(this.bit, css_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\tremoveClasses(this.element, css_active, css_infinite, css_discrete);\n\n\t\tthis.workedVal = 0;\n\t\tthis.totalWork = undefined;\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\taddClass(this.element, css_done);\n\n\t\t// let it grow to 100% width and hide afterwards\n\t\tif (!hasClass(this.element, 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// 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\thide(): void {\n\t\thide(this.element);\n\t\tthis.showDelayedScheduler.cancel();\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() : null;\n\n\t\t\tthis.bit.style.backgroundColor = background;\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 'vs/css!./sash';\nimport { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';\nimport { isIPad } from 'vs/base/browser/browser';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport * as types from 'vs/base/common/types';\nimport { EventType, GestureEvent, Gesture } from 'vs/base/browser/touch';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { getElementsByTagName, EventHelper, createStyleSheet, addDisposableListener, append, $, addClass, removeClass, toggleClass } from 'vs/base/browser/dom';\nimport { domEvent } from 'vs/base/browser/event';\n\nconst DEBUG = false;\n\nexport interface ISashLayoutProvider { }\n\nexport interface IVerticalSashLayoutProvider extends ISashLayoutProvider {\n\tgetVerticalSashLeft(sash: Sash): number;\n\tgetVerticalSashTop?(sash: Sash): number;\n\tgetVerticalSashHeight?(sash: Sash): number;\n}\n\nexport interface IHorizontalSashLayoutProvider extends ISashLayoutProvider {\n\tgetHorizontalSashTop(sash: Sash): number;\n\tgetHorizontalSashLeft?(sash: Sash): number;\n\tgetHorizontalSashWidth?(sash: Sash): number;\n}\n\nexport interface ISashEvent {\n\tstartX: number;\n\tcurrentX: number;\n\tstartY: number;\n\tcurrentY: number;\n\taltKey: boolean;\n}\n\nexport interface ISashOptions {\n\torientation?: Orientation;\n\torthogonalStartSash?: Sash;\n\torthogonalEndSash?: Sash;\n}\n\nexport const enum Orientation {\n\tVERTICAL,\n\tHORIZONTAL\n}\n\nexport const enum SashState {\n\tDisabled,\n\tMinimum,\n\tMaximum,\n\tEnabled\n}\n\nexport class Sash extends Disposable {\n\n\tprivate el: HTMLElement;\n\tprivate layoutProvider: ISashLayoutProvider;\n\tprivate hidden: boolean;\n\tprivate orientation: Orientation;\n\n\tprivate _state: SashState = SashState.Enabled;\n\tget state(): SashState { return this._state; }\n\tset state(state: SashState) {\n\t\tif (this._state === state) {\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleClass(this.el, 'disabled', state === SashState.Disabled);\n\t\ttoggleClass(this.el, 'minimum', state === SashState.Minimum);\n\t\ttoggleClass(this.el, 'maximum', state === SashState.Maximum);\n\n\t\tthis._state = state;\n\t\tthis._onDidEnablementChange.fire(state);\n\t}\n\n\tprivate readonly _onDidEnablementChange = this._register(new Emitter<SashState>());\n\treadonly onDidEnablementChange: Event<SashState> = this._onDidEnablementChange.event;\n\n\tprivate readonly _onDidStart = this._register(new Emitter<ISashEvent>());\n\treadonly onDidStart: Event<ISashEvent> = this._onDidStart.event;\n\n\tprivate readonly _onDidChange = this._register(new Emitter<ISashEvent>());\n\treadonly onDidChange: Event<ISashEvent> = this._onDidChange.event;\n\n\tprivate readonly _onDidReset = this._register(new Emitter<void>());\n\treadonly onDidReset: Event<void> = this._onDidReset.event;\n\n\tprivate readonly _onDidEnd = this._register(new Emitter<void>());\n\treadonly onDidEnd: Event<void> = this._onDidEnd.event;\n\n\tlinkedSash: Sash | undefined = undefined;\n\n\tprivate orthogonalStartSashDisposables: IDisposable[] = [];\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tthis.orthogonalStartSashDisposables = dispose(this.orthogonalStartSashDisposables);\n\n\t\tif (sash) {\n\t\t\tsash.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange, this, this.orthogonalStartSashDisposables);\n\t\t\tthis.onOrthogonalStartSashEnablementChange(sash.state);\n\t\t} else {\n\t\t\tthis.onOrthogonalStartSashEnablementChange(SashState.Disabled);\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\tprivate orthogonalEndSashDisposables: IDisposable[] = [];\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tthis.orthogonalEndSashDisposables = dispose(this.orthogonalEndSashDisposables);\n\n\t\tif (sash) {\n\t\t\tsash.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange, this, this.orthogonalEndSashDisposables);\n\t\t\tthis.onOrthogonalEndSashEnablementChange(sash.state);\n\t\t} else {\n\t\t\tthis.onOrthogonalEndSashEnablementChange(SashState.Disabled);\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\tconstructor(container: HTMLElement, layoutProvider: ISashLayoutProvider, options: ISashOptions = {}) {\n\t\tsuper();\n\n\t\tthis.el = append(container, $('.monaco-sash'));\n\n\t\tif (isMacintosh) {\n\t\t\taddClass(this.el, 'mac');\n\t\t}\n\n\t\tthis._register(domEvent(this.el, 'mousedown')(this.onMouseDown, this));\n\t\tthis._register(domEvent(this.el, 'dblclick')(this.onMouseDoubleClick, this));\n\n\t\tGesture.addTarget(this.el);\n\t\tthis._register(domEvent(this.el, EventType.Start)(this.onTouchStart, this));\n\n\t\tif (isIPad) {\n\t\t\t// see also http://ux.stackexchange.com/questions/39023/what-is-the-optimum-button-size-of-touch-screen-applications\n\t\t\taddClass(this.el, 'touch');\n\t\t}\n\n\t\tthis.setOrientation(options.orientation || Orientation.VERTICAL);\n\n\t\tthis.hidden = false;\n\t\tthis.layoutProvider = layoutProvider;\n\n\t\tthis.orthogonalStartSash = options.orthogonalStartSash;\n\t\tthis.orthogonalEndSash = options.orthogonalEndSash;\n\n\t\ttoggleClass(this.el, 'debug', DEBUG);\n\t}\n\n\tsetOrientation(orientation: Orientation): void {\n\t\tthis.orientation = orientation;\n\n\t\tif (this.orientation === Orientation.HORIZONTAL) {\n\t\t\taddClass(this.el, 'horizontal');\n\t\t\tremoveClass(this.el, 'vertical');\n\t\t} else {\n\t\t\tremoveClass(this.el, 'horizontal');\n\t\t\taddClass(this.el, 'vertical');\n\t\t}\n\n\t\tif (this.layoutProvider) {\n\t\t\tthis.layout();\n\t\t}\n\t}\n\n\tprivate onMouseDown(e: MouseEvent): void {\n\t\tEventHelper.stop(e, false);\n\n\t\tlet isMultisashResize = false;\n\n\t\tif (this.linkedSash && !(e as any).__linkedSashEvent) {\n\t\t\t(e as any).__linkedSashEvent = true;\n\t\t\tthis.linkedSash.onMouseDown(e);\n\t\t}\n\n\t\tif (!(e as any).__orthogonalSashEvent) {\n\t\t\tlet orthogonalSash: Sash | undefined;\n\n\t\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\t\tif (e.offsetY <= 4) {\n\t\t\t\t\torthogonalSash = this.orthogonalStartSash;\n\t\t\t\t} else if (e.offsetY >= this.el.clientHeight - 4) {\n\t\t\t\t\torthogonalSash = this.orthogonalEndSash;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (e.offsetX <= 4) {\n\t\t\t\t\torthogonalSash = this.orthogonalStartSash;\n\t\t\t\t} else if (e.offsetX >= this.el.clientWidth - 4) {\n\t\t\t\t\torthogonalSash = this.orthogonalEndSash;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (orthogonalSash) {\n\t\t\t\tisMultisashResize = true;\n\t\t\t\t(e as any).__orthogonalSashEvent = true;\n\t\t\t\torthogonalSash.onMouseDown(e);\n\t\t\t}\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.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash\n\t\t}\n\n\t\tconst mouseDownEvent = new StandardMouseEvent(e);\n\t\tconst startX = mouseDownEvent.posx;\n\t\tconst startY = mouseDownEvent.posy;\n\t\tconst altKey = mouseDownEvent.altKey;\n\t\tconst startEvent: ISashEvent = { startX, currentX: startX, startY, currentY: startY, altKey };\n\n\t\taddClass(this.el, '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.Minimum) {\n\t\t\t\t\tcursor = 's-resize';\n\t\t\t\t} else if (this.state === SashState.Maximum) {\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.Minimum) {\n\t\t\t\t\tcursor = 'e-resize';\n\t\t\t\t} else if (this.state === SashState.Maximum) {\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.innerHTML = `* { cursor: ${cursor} !important; }`;\n\t\t};\n\n\t\tconst disposables: IDisposable[] = [];\n\n\t\tupdateStyle();\n\n\t\tif (!isMultisashResize) {\n\t\t\tthis.onDidEnablementChange(updateStyle, null, disposables);\n\t\t}\n\n\t\tconst onMouseMove = (e: MouseEvent) => {\n\t\t\tEventHelper.stop(e, false);\n\t\t\tconst mouseMoveEvent = new StandardMouseEvent(e);\n\t\t\tconst event: ISashEvent = { startX, currentX: mouseMoveEvent.posx, startY, currentY: mouseMoveEvent.posy, altKey };\n\n\t\t\tthis._onDidChange.fire(event);\n\t\t};\n\n\t\tconst onMouseUp = (e: MouseEvent) => {\n\t\t\tEventHelper.stop(e, false);\n\n\t\t\tthis.el.removeChild(style);\n\n\t\t\tremoveClass(this.el, 'active');\n\t\t\tthis._onDidEnd.fire();\n\n\t\t\tdispose(disposables);\n\n\t\t\tconst iframes = getElementsByTagName('iframe');\n\t\t\tfor (const iframe of iframes) {\n\t\t\t\tiframe.style.pointerEvents = 'auto';\n\t\t\t}\n\t\t};\n\n\t\tdomEvent(window, 'mousemove')(onMouseMove, null, disposables);\n\t\tdomEvent(window, 'mouseup')(onMouseUp, null, disposables);\n\t}\n\n\tprivate onMouseDoubleClick(event: MouseEvent): void {\n\t\tthis._onDidReset.fire();\n\t}\n\n\tprivate onTouchStart(event: GestureEvent): void {\n\t\tEventHelper.stop(event);\n\n\t\tconst listeners: IDisposable[] = [];\n\n\t\tconst startX = event.pageX;\n\t\tconst startY = event.pageY;\n\t\tconst altKey = event.altKey;\n\n\t\tthis._onDidStart.fire({\n\t\t\tstartX: startX,\n\t\t\tcurrentX: startX,\n\t\t\tstartY: startY,\n\t\t\tcurrentY: startY,\n\t\t\taltKey\n\t\t});\n\n\t\tlisteners.push(addDisposableListener(this.el, EventType.Change, (event: GestureEvent) => {\n\t\t\tif (types.isNumber(event.pageX) && types.isNumber(event.pageY)) {\n\t\t\t\tthis._onDidChange.fire({\n\t\t\t\t\tstartX: startX,\n\t\t\t\t\tcurrentX: event.pageX,\n\t\t\t\t\tstartY: startY,\n\t\t\t\t\tcurrentY: event.pageY,\n\t\t\t\t\taltKey\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tlisteners.push(addDisposableListener(this.el, EventType.End, (event: GestureEvent) => {\n\t\t\tthis._onDidEnd.fire();\n\t\t\tdispose(listeners);\n\t\t}));\n\t}\n\n\tlayout(): void {\n\t\tconst size = isIPad ? 20 : 4;\n\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) - (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) - (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\thide(): void {\n\t\tthis.hidden = true;\n\t\tthis.el.style.display = 'none';\n\t\tthis.el.setAttribute('aria-hidden', 'true');\n\t}\n\n\tprivate onOrthogonalStartSashEnablementChange(state: SashState): void {\n\t\ttoggleClass(this.el, 'orthogonal-start', state !== SashState.Disabled);\n\t}\n\n\tprivate onOrthogonalEndSashEnablementChange(state: SashState): void {\n\t\ttoggleClass(this.el, 'orthogonal-end', state !== SashState.Disabled);\n\t}\n\n\tdispose(): void {\n\t\tsuper.dispose();\n\n\t\tthis.orthogonalStartSashDisposables = dispose(this.orthogonalStartSashDisposables);\n\t\tthis.orthogonalEndSashDisposables = dispose(this.orthogonalEndSashDisposables);\n\n\t\tif (this.el && this.el.parentElement) {\n\t\t\tthis.el.parentElement.removeChild(this.el);\n\t\t}\n\n\t\tthis.el = null!; // StrictNullOverride: nulling out ok in 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 'vs/css!./media/scrollbars';\nimport * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IMouseEvent, StandardWheelEvent, IMouseWheelEvent } 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 { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { INewScrollDimensions, INewScrollPosition, IScrollDimensions, IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable';\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 * before last + 0.125 * before before 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 (Math.abs(item.deltaX - Math.round(item.deltaX)) > 0 || Math.abs(item.deltaY - Math.round(item.deltaY)) > 0) {\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\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>;\n\tprivate readonly _topShadowDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _topLeftShadowDomNode: FastDomNode<HTMLElement>;\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\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._onDidScroll(e);\n\t\t\tthis._onScroll.fire(e);\n\t\t}));\n\n\t\tlet 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 top-left-corner');\n\t\t\tthis._domNode.appendChild(this._topLeftShadowDomNode.domNode);\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 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);\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 * Really this is Editor.IEditorScrollbarOptions, but base shouldn't\n\t * depend on Editor.\n\t */\n\tpublic updateOptions(newOptions: ScrollableElementChangeOptions): void {\n\t\tlet massagedOptions = resolveOptions(newOptions);\n\t\tthis._options.handleMouseWheel = massagedOptions.handleMouseWheel;\n\t\tthis._options.mouseWheelScrollSensitivity = massagedOptions.mouseWheelScrollSensitivity;\n\t\tthis._options.fastScrollSensitivity = massagedOptions.fastScrollSensitivity;\n\t\tthis._setListeningToMouseWheel(this._options.handleMouseWheel);\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\tlet 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\tlet 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, 'mousewheel', onMouseWheel));\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\tclassifier.accept(Date.now(), e.deltaX, e.deltaY);\n\t\t}\n\n\t\t// console.log(`${Date.now()}, ${e.deltaY}, ${e.deltaX}`);\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.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 desiredScrollTop = futureScrollPosition.scrollTop - SCROLL_WHEEL_SENSITIVITY * deltaY;\n\t\t\t\tthis._verticalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollTop);\n\t\t\t}\n\t\t\tif (deltaX) {\n\t\t\t\tconst desiredScrollLeft = futureScrollPosition.scrollLeft - SCROLL_WHEEL_SENSITIVITY * deltaX;\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\t\t\t\tthis._shouldRender = true;\n\t\t\t}\n\t\t}\n\n\t\tif (this._options.alwaysConsumeMouseWheel || this._shouldRender) {\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\tlet enableTop = scrollState.scrollTop > 0;\n\t\t\tlet enableLeft = scrollState.scrollLeft > 0;\n\n\t\t\tthis._leftShadowDomNode.setClassName('shadow' + (enableLeft ? ' left' : ''));\n\t\t\tthis._topShadowDomNode.setClassName('shadow' + (enableTop ? ' top' : ''));\n\t\t\tthis._topLeftShadowDomNode.setClassName('shadow top-left-corner' + (enableTop ? ' top' : '') + (enableLeft ? ' left' : ''));\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(0, (callback) => dom.scheduleAtNextAnimationFrame(callback));\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\tpublic getScrollPosition(): IScrollPosition {\n\t\treturn this._scrollable.getCurrentScrollPosition();\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}\n\nexport class DomScrollableElement extends ScrollableElement {\n\n\tprivate _element: HTMLElement;\n\n\tconstructor(element: HTMLElement, options: ScrollableElementCreationOptions) {\n\t\tsuper(element, options);\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 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\tlet 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\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\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\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 { getOrDefault } from 'vs/base/common/objects';\nimport { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { Gesture, EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch';\nimport * as DOM from 'vs/base/browser/dom';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { domEvent } from 'vs/base/browser/event';\nimport { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { ScrollEvent, ScrollbarVisibility, INewScrollDimensions } from 'vs/base/common/scrollable';\nimport { RangeMap, shift } from './rangeMap';\nimport { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListTouchEvent, IListGestureEvent, IListDragEvent, IListDragAndDrop, ListDragOverEffect } from './list';\nimport { RowCache, IRow } from './rowCache';\nimport { isWindows } from 'vs/base/common/platform';\nimport * as browser from 'vs/base/browser/browser';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { memoize } from 'vs/base/common/decorators';\nimport { Range, IRange } from 'vs/base/common/range';\nimport { equals, distinct } from 'vs/base/common/arrays';\nimport { DataTransfers, StaticDND, IDragAndDropData } from 'vs/base/browser/dnd';\nimport { disposableTimeout, Delayer } from 'vs/base/common/async';\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}\n\nexport interface IListViewDragAndDrop<T> extends IListDragAndDrop<T> {\n\tgetDragElements(element: T): T[];\n}\n\nexport interface IAriaSetProvider<T> {\n\tgetSetSize(element: T, index: number, listLength: number): number;\n\tgetPosInSet(element: T, index: number): number;\n}\n\nexport interface IListViewOptions<T> {\n\treadonly dnd?: IListViewDragAndDrop<T>;\n\treadonly useShadows?: boolean;\n\treadonly verticalScrollMode?: ScrollbarVisibility;\n\treadonly setRowLineHeight?: boolean;\n\treadonly supportDynamicHeights?: boolean;\n\treadonly mouseSupport?: boolean;\n\treadonly horizontalScrolling?: boolean;\n\treadonly ariaSetProvider?: IAriaSetProvider<T>;\n}\n\nconst DefaultOptions = {\n\tuseShadows: true,\n\tverticalScrollMode: ScrollbarVisibility.Auto,\n\tsetRowLineHeight: 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};\n\nexport class ElementsDragAndDropData<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(): any {\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(): any {\n\t\treturn this.elements;\n\t}\n}\n\nexport class DesktopDragAndDropData 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\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 gesture: Gesture;\n\tprivate rowsContainer: HTMLElement;\n\tprivate scrollableElement: ScrollableElement;\n\tprivate _scrollHeight: number;\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;\n\tprivate setRowLineHeight: boolean;\n\tprivate supportDynamicHeights: boolean;\n\tprivate horizontalScrolling: boolean;\n\tprivate ariaSetProvider: IAriaSetProvider<T>;\n\tprivate scrollWidth: number | undefined;\n\tprivate canUseTranslate3d: boolean | undefined = 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 disposables: IDisposable[];\n\n\tprivate _onDidChangeContentHeight = new Emitter<number>();\n\tget contentHeight(): number { return this.rangeMap.size; }\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 = 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\tDOM.addClass(this.domNode, this.domId);\n\t\tthis.domNode.tabIndex = 0;\n\n\t\tDOM.toggleClass(this.domNode, 'mouse-support', typeof options.mouseSupport === 'boolean' ? options.mouseSupport : true);\n\n\t\tthis.horizontalScrolling = getOrDefault(options, o => o.horizontalScrolling, DefaultOptions.horizontalScrolling);\n\t\tDOM.toggleClass(this.domNode, 'horizontal-scrolling', this.horizontalScrolling);\n\n\t\tthis.ariaSetProvider = options.ariaSetProvider || { getSetSize: (e, i, length) => length, getPosInSet: (_, index) => index + 1 };\n\n\t\tthis.rowsContainer = document.createElement('div');\n\t\tthis.rowsContainer.className = 'monaco-list-rows';\n\t\tGesture.addTarget(this.rowsContainer);\n\n\t\tthis.scrollableElement = new ScrollableElement(this.rowsContainer, {\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t\thorizontal: this.horizontalScrolling ? ScrollbarVisibility.Auto : ScrollbarVisibility.Hidden,\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});\n\n\t\tthis.domNode.appendChild(this.scrollableElement.getDomNode());\n\t\tcontainer.appendChild(this.domNode);\n\n\t\tthis.disposables = [this.rangeMap, this.gesture, this.scrollableElement, this.cache];\n\n\t\tthis.scrollableElement.onScroll(this.onScroll, this, this.disposables);\n\t\tdomEvent(this.rowsContainer, TouchEventType.Change)(this.onTouchChange, this, this.disposables);\n\n\t\t// Prevent the monaco-scrollable-element from scrolling\n\t\t// https://github.com/Microsoft/vscode/issues/44181\n\t\tdomEvent(this.scrollableElement.getDomNode(), 'scroll')\n\t\t\t(e => (e.target as HTMLElement).scrollTop = 0, null, this.disposables);\n\n\t\tEvent.map(domEvent(this.domNode, 'dragover'), e => this.toDragEvent(e))(this.onDragOver, this, this.disposables);\n\t\tEvent.map(domEvent(this.domNode, 'drop'), e => this.toDragEvent(e))(this.onDrop, this, this.disposables);\n\t\tdomEvent(this.domNode, 'dragleave')(this.onDragLeave, this, this.disposables);\n\t\tdomEvent(window, 'dragend')(this.onDragEnd, this, this.disposables);\n\n\t\tthis.setRowLineHeight = getOrDefault(options, o => o.setRowLineHeight, DefaultOptions.setRowLineHeight);\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\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\tfor (let i = removeRange.start; i < removeRange.end; i++) {\n\t\t\tthis.removeItemFromDOM(i);\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}));\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\tthis.items = inserted;\n\t\t\tdeleted = [];\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\tthis.insertItemInDOM(i, beforeElement);\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 = DOM.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\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\tif (this.items.length === 0) {\n\t\t\tthis.scrollableElement.setScrollDimensions({ scrollWidth: 0 });\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 + 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 : DOM.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\n\t\t\tif (this.horizontalScrolling) {\n\t\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\t\twidth: typeof width === 'number' ? width : DOM.getContentWidth(this.domNode)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t// Render\n\n\tprivate render(renderTop: number, renderHeight: number, renderLeft: number, scrollWidth: number): void {\n\t\tconst previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);\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\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\tconst canUseTranslate3d = !isWindows && !browser.isFirefox && browser.getZoomLevel() === 0;\n\n\t\tif (canUseTranslate3d) {\n\t\t\tconst transform = `translate3d(-${renderLeft}px, -${renderTop}px, 0px)`;\n\t\t\tthis.rowsContainer.style.transform = transform;\n\t\t\tthis.rowsContainer.style.webkitTransform = transform;\n\n\t\t\tif (canUseTranslate3d !== this.canUseTranslate3d) {\n\t\t\t\tthis.rowsContainer.style.left = '0';\n\t\t\t\tthis.rowsContainer.style.top = '0';\n\t\t\t}\n\t\t} else {\n\t\t\tthis.rowsContainer.style.left = `-${renderLeft}px`;\n\t\t\tthis.rowsContainer.style.top = `-${renderTop}px`;\n\n\t\t\tif (canUseTranslate3d !== this.canUseTranslate3d) {\n\t\t\t\tthis.rowsContainer.style.transform = '';\n\t\t\t\tthis.rowsContainer.style.webkitTransform = '';\n\t\t\t}\n\t\t}\n\n\t\tif (this.horizontalScrolling) {\n\t\t\tthis.rowsContainer.style.width = `${Math.max(scrollWidth, this.renderWidth)}px`;\n\t\t}\n\n\t\tthis.canUseTranslate3d = canUseTranslate3d;\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): void {\n\t\tconst item = this.items[index];\n\n\t\tif (!item.row) {\n\t\t\titem.row = this.cache.alloc(item.templateId);\n\t\t\titem.row!.domNode!.setAttribute('role', 'treeitem');\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);\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\tconst onDragStart = domEvent(item.row.domNode!, 'dragstart');\n\t\t\titem.dragStartDisposable = onDragStart(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 = 'fit-content';\n\t\titem.width = DOM.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\t\titem.row!.domNode!.style.height = `${item.size}px`;\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('aria-setsize', String(this.ariaSetProvider.getSetSize(item.element, index, this.length)));\n\t\titem.row!.domNode!.setAttribute('aria-posinset', String(this.ariaSetProvider.getPosInSet(item.element, index)));\n\t\titem.row!.domNode!.setAttribute('id', this.getElementDomId(index));\n\n\t\tDOM.toggleClass(item.row!.domNode!, '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\n\t\tconst renderer = this.renderers.get(item.templateId);\n\t\tif (renderer && renderer.disposeElement) {\n\t\t\trenderer.disposeElement(item.element, index, item.row!.templateData);\n\t\t}\n\n\t\tthis.cache.release(item.row!);\n\t\titem.row = null;\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): 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 });\n\t}\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);\n\t}\n\n\t// Events\n\n\t@memoize get onMouseClick(): Event<IListMouseEvent<T>> { return Event.map(domEvent(this.domNode, 'click'), e => this.toMouseEvent(e)); }\n\t@memoize get onMouseDblClick(): Event<IListMouseEvent<T>> { return Event.map(domEvent(this.domNode, 'dblclick'), e => this.toMouseEvent(e)); }\n\t@memoize get onMouseMiddleClick(): Event<IListMouseEvent<T>> { return Event.filter(Event.map(domEvent(this.domNode, 'auxclick'), e => this.toMouseEvent(e as MouseEvent)), e => e.browserEvent.button === 1); }\n\t@memoize get onMouseDown(): Event<IListMouseEvent<T>> { return Event.map(domEvent(this.domNode, 'mousedown'), e => this.toMouseEvent(e)); }\n\t@memoize get onContextMenu(): Event<IListMouseEvent<T>> { return Event.map(domEvent(this.domNode, 'contextmenu'), e => this.toMouseEvent(e)); }\n\t@memoize get onTouchStart(): Event<IListTouchEvent<T>> { return Event.map(domEvent(this.domNode, 'touchstart'), e => this.toTouchEvent(e)); }\n\t@memoize get onTap(): Event<IListGestureEvent<T>> { return Event.map(domEvent(this.rowsContainer, TouchEventType.Tap), e => this.toGestureEvent(e)); }\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\tthis.render(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);\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.RESOURCES, JSON.stringify([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);\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 = DOM.$('.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 DesktopDragAndDropData();\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();\n\t\tfeedback = feedback[0] === -1 ? [-1] : feedback;\n\n\t\tif (feedback.length === 0) {\n\t\t\tthrow new Error('Invalid empty feedback list');\n\t\t}\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\tDOM.addClass(this.domNode, 'drop-target');\n\t\t\tthis.currentDragFeedbackDisposable = toDisposable(() => DOM.removeClass(this.domNode, 'drop-target'));\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 && item.row.domNode) {\n\t\t\t\t\tDOM.addClass(item.row.domNode, '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 && item.row.domNode) {\n\t\t\t\t\t\tDOM.removeClass(item.row.domNode, '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(): void {\n\t\tthis.onDragLeaveTimeout.dispose();\n\t\tthis.onDragLeaveTimeout = disposableTimeout(() => this.clearDragOverFeedback(), 100);\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(): 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\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 = DOM.getTopLeftOffset(this.domNode).top;\n\t\t\tthis.dragOverAnimationDisposable = DOM.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\tlet element: HTMLElement | null = target as (HTMLElement | null);\n\n\t\twhile (element instanceof HTMLElement && element !== this.rowsContainer) {\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): 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\tthis.scrollTop = this.elementTop(anchorElementIndex) - anchorElementTopDelta!;\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 (!item.hasDynamicHeight || item.lastDynamicHeightWidth === this.renderWidth) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst size = item.size;\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, true);\n\n\t\t\tif (renderer.disposeElement) {\n\t\t\t\trenderer.disposeElement(item.element, index, row.templateData, true);\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\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\tthis.disposables = dispose(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 * as Platform from 'vs/base/common/platform';\nimport * as Browser from 'vs/base/browser/browser';\nimport * as Lifecycle from 'vs/base/common/lifecycle';\nimport * as DOM from 'vs/base/browser/dom';\nimport * as Diff from 'vs/base/common/diff/diff';\nimport * as Touch from 'vs/base/browser/touch';\nimport * as strings from 'vs/base/common/strings';\nimport * as Mouse from 'vs/base/browser/mouseEvent';\nimport * as Keyboard from 'vs/base/browser/keyboardEvent';\nimport * as Model from 'vs/base/parts/tree/browser/treeModel';\nimport * as dnd from './treeDnd';\nimport { ArrayIterator, MappedIterator } from 'vs/base/common/iterator';\nimport { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { HeightMap, IViewItem } from 'vs/base/parts/tree/browser/treeViewModel';\nimport * as _ from 'vs/base/parts/tree/browser/tree';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { DataTransfers, StaticDND, IDragAndDropData } from 'vs/base/browser/dnd';\nimport { DefaultTreestyler } from './treeDefaults';\nimport { Delayer, timeout } from 'vs/base/common/async';\n\nexport interface IRow {\n\telement: HTMLElement | null;\n\ttemplateId: string;\n\ttemplateData: any;\n}\n\nfunction removeFromParent(element: HTMLElement): void {\n\ttry {\n\t\telement.parentElement!.removeChild(element);\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 implements Lifecycle.IDisposable {\n\n\tprivate _cache: { [templateId: string]: IRow[]; } | null;\n\n\tconstructor(private context: _.ITreeContext) {\n\t\tthis._cache = { '': [] };\n\t}\n\n\tpublic alloc(templateId: string): IRow {\n\t\tlet result = this.cache(templateId).pop();\n\n\t\tif (!result) {\n\t\t\tlet content = document.createElement('div');\n\t\t\tcontent.className = 'content';\n\n\t\t\tlet row = document.createElement('div');\n\t\t\trow.appendChild(content);\n\n\t\t\tlet templateData: any = null;\n\n\t\t\ttry {\n\t\t\t\ttemplateData = this.context.renderer!.renderTemplate(this.context.tree, templateId, content);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Tree usage error: exception while rendering template');\n\t\t\t\tconsole.error(err);\n\t\t\t}\n\n\t\t\tresult = {\n\t\t\t\telement: row,\n\t\t\t\ttemplateId: templateId,\n\t\t\t\ttemplateData\n\t\t\t};\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic release(templateId: string, row: IRow): void {\n\t\tremoveFromParent(row.element!);\n\t\tthis.cache(templateId).push(row);\n\t}\n\n\tprivate cache(templateId: string): IRow[] {\n\t\treturn this._cache![templateId] || (this._cache![templateId] = []);\n\t}\n\n\tpublic garbageCollect(): void {\n\t\tif (this._cache) {\n\t\t\tObject.keys(this._cache).forEach(templateId => {\n\t\t\t\tthis._cache![templateId].forEach(cachedRow => {\n\t\t\t\t\tthis.context.renderer!.disposeTemplate(this.context.tree, templateId, cachedRow.templateData);\n\t\t\t\t\tcachedRow.element = null;\n\t\t\t\t\tcachedRow.templateData = null;\n\t\t\t\t});\n\n\t\t\t\tdelete this._cache![templateId];\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.garbageCollect();\n\t\tthis._cache = null;\n\t}\n}\n\nexport interface IViewContext extends _.ITreeContext {\n\tcache: RowCache;\n\thorizontalScrolling: boolean;\n}\n\nexport class ViewItem implements IViewItem {\n\n\tprivate context: IViewContext;\n\n\tpublic model: Model.Item;\n\tpublic id: string;\n\tprotected row: IRow | null;\n\n\tpublic top: number;\n\tpublic height: number;\n\tpublic width: number = 0;\n\tpublic onDragStart: (e: DragEvent) => void;\n\n\tpublic needsRender: boolean;\n\tpublic uri: string | null;\n\tpublic unbindDragStart: Lifecycle.IDisposable = Lifecycle.Disposable.None;\n\tpublic loadingTimer: any;\n\n\tpublic _styles: any;\n\tprivate _draggable: boolean;\n\n\tconstructor(context: IViewContext, model: Model.Item) {\n\t\tthis.context = context;\n\t\tthis.model = model;\n\n\t\tthis.id = this.model.id;\n\t\tthis.row = null;\n\n\t\tthis.top = 0;\n\t\tthis.height = model.getHeight();\n\n\t\tthis._styles = {};\n\t\tmodel.getAllTraits().forEach(t => this._styles[t] = true);\n\n\t\tif (model.isExpanded()) {\n\t\t\tthis.addClass('expanded');\n\t\t}\n\t}\n\n\tset expanded(value: boolean) {\n\t\tvalue ? this.addClass('expanded') : this.removeClass('expanded');\n\t}\n\n\tset loading(value: boolean) {\n\t\tvalue ? this.addClass('loading') : this.removeClass('loading');\n\t}\n\n\tset draggable(value: boolean) {\n\t\tthis._draggable = value;\n\t\tthis.render(true);\n\t}\n\n\tget draggable() {\n\t\treturn this._draggable;\n\t}\n\n\tset dropTarget(value: boolean) {\n\t\tvalue ? this.addClass('drop-target') : this.removeClass('drop-target');\n\t}\n\n\tpublic get element(): HTMLElement {\n\t\treturn (this.row && this.row.element)!;\n\t}\n\n\tprivate _templateId: string;\n\tprivate get templateId(): string {\n\t\treturn this._templateId || (this._templateId = (this.context.renderer!.getTemplateId && this.context.renderer!.getTemplateId(this.context.tree, this.model.getElement())));\n\t}\n\n\tpublic addClass(name: string): void {\n\t\tthis._styles[name] = true;\n\t\tthis.render(true);\n\t}\n\n\tpublic removeClass(name: string): void {\n\t\tdelete this._styles[name]; // is this slow?\n\t\tthis.render(true);\n\t}\n\n\tpublic render(skipUserRender = false): void {\n\t\tif (!this.model || !this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet classes = ['monaco-tree-row'];\n\t\tclasses.push.apply(classes, Object.keys(this._styles));\n\n\t\tif (this.model.hasChildren()) {\n\t\t\tclasses.push('has-children');\n\t\t}\n\n\t\tthis.element.className = classes.join(' ');\n\t\tthis.element.draggable = this.draggable;\n\t\tthis.element.style.height = this.height + 'px';\n\n\t\t// ARIA\n\t\tthis.element.setAttribute('role', 'treeitem');\n\t\tconst accessibility = this.context.accessibilityProvider!;\n\t\tconst ariaLabel = accessibility.getAriaLabel(this.context.tree, this.model.getElement());\n\t\tif (ariaLabel) {\n\t\t\tthis.element.setAttribute('aria-label', ariaLabel);\n\t\t}\n\t\tif (accessibility.getPosInSet && accessibility.getSetSize) {\n\t\t\tthis.element.setAttribute('aria-setsize', accessibility.getSetSize());\n\t\t\tthis.element.setAttribute('aria-posinset', accessibility.getPosInSet(this.context.tree, this.model.getElement()));\n\t\t}\n\t\tif (this.model.hasTrait('focused')) {\n\t\t\tconst base64Id = strings.safeBtoa(this.model.id);\n\n\t\t\tthis.element.setAttribute('aria-selected', 'true');\n\t\t\tthis.element.setAttribute('id', base64Id);\n\t\t} else {\n\t\t\tthis.element.setAttribute('aria-selected', 'false');\n\t\t\tthis.element.removeAttribute('id');\n\t\t}\n\t\tif (this.model.hasChildren()) {\n\t\t\tthis.element.setAttribute('aria-expanded', String(!!this._styles['expanded']));\n\t\t} else {\n\t\t\tthis.element.removeAttribute('aria-expanded');\n\t\t}\n\t\tthis.element.setAttribute('aria-level', String(this.model.getDepth()));\n\n\t\tif (this.context.options.paddingOnRow) {\n\t\t\tthis.element.style.paddingLeft = this.context.options.twistiePixels! + ((this.model.getDepth() - 1) * this.context.options.indentPixels!) + 'px';\n\t\t} else {\n\t\t\tthis.element.style.paddingLeft = ((this.model.getDepth() - 1) * this.context.options.indentPixels!) + 'px';\n\t\t\t(<HTMLElement>this.row!.element!.firstElementChild).style.paddingLeft = this.context.options.twistiePixels + 'px';\n\t\t}\n\n\t\tlet uri = this.context.dnd!.getDragURI(this.context.tree, this.model.getElement());\n\n\t\tif (uri !== this.uri) {\n\t\t\tif (this.unbindDragStart) {\n\t\t\t\tthis.unbindDragStart.dispose();\n\t\t\t}\n\n\t\t\tif (uri) {\n\t\t\t\tthis.uri = uri;\n\t\t\t\tthis.draggable = true;\n\t\t\t\tthis.unbindDragStart = DOM.addDisposableListener(this.element, 'dragstart', (e) => {\n\t\t\t\t\tthis.onDragStart(e);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.uri = null;\n\t\t\t}\n\t\t}\n\n\t\tif (!skipUserRender && this.element) {\n\t\t\tlet paddingLeft: number = 0;\n\t\t\tif (this.context.horizontalScrolling) {\n\t\t\t\tconst style = window.getComputedStyle(this.element);\n\t\t\t\tpaddingLeft = parseFloat(style.paddingLeft!);\n\t\t\t}\n\n\t\t\tif (this.context.horizontalScrolling) {\n\t\t\t\tthis.element.style.width = 'fit-content';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tthis.context.renderer!.renderElement(this.context.tree, this.model.getElement(), this.templateId, this.row!.templateData);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Tree usage error: exception while rendering element');\n\t\t\t\tconsole.error(err);\n\t\t\t}\n\n\t\t\tif (this.context.horizontalScrolling) {\n\t\t\t\tthis.width = DOM.getContentWidth(this.element) + paddingLeft;\n\t\t\t\tthis.element.style.width = '';\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic insertInDOM(container: HTMLElement, afterElement: HTMLElement | null): void {\n\t\tif (!this.row) {\n\t\t\tthis.row = this.context.cache.alloc(this.templateId);\n\n\t\t\t// used in reverse lookup from HTMLElement to Item\n\t\t\t(<any>this.element)[TreeView.BINDING] = this;\n\t\t}\n\n\t\tif (this.element.parentElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (afterElement === null) {\n\t\t\tcontainer.appendChild(this.element);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tcontainer.insertBefore(this.element, afterElement);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn('Failed to locate previous tree element');\n\t\t\t\tcontainer.appendChild(this.element);\n\t\t\t}\n\t\t}\n\n\t\tthis.render();\n\t}\n\n\tpublic removeFromDOM(): void {\n\t\tif (!this.row) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.unbindDragStart.dispose();\n\n\t\tthis.uri = null;\n\n\t\t(<any>this.element)[TreeView.BINDING] = null;\n\t\tthis.context.cache.release(this.templateId, this.row);\n\t\tthis.row = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.row = null;\n\t}\n}\n\nclass RootViewItem extends ViewItem {\n\n\tconstructor(context: IViewContext, model: Model.Item, wrapper: HTMLElement) {\n\t\tsuper(context, model);\n\n\t\tthis.row = {\n\t\t\telement: wrapper,\n\t\t\ttemplateData: null,\n\t\t\ttemplateId: null!\n\t\t};\n\t}\n\n\tpublic render(): void {\n\t\tif (!this.model || !this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet classes = ['monaco-tree-wrapper'];\n\t\tclasses.push.apply(classes, Object.keys(this._styles));\n\n\t\tif (this.model.hasChildren()) {\n\t\t\tclasses.push('has-children');\n\t\t}\n\n\t\tthis.element.className = classes.join(' ');\n\t}\n\n\tpublic insertInDOM(container: HTMLElement, afterElement: HTMLElement): void {\n\t\t// noop\n\t}\n\n\tpublic removeFromDOM(): void {\n\t\t// noop\n\t}\n}\n\ninterface IThrottledGestureEvent {\n\ttranslationX: number;\n\ttranslationY: number;\n}\n\nfunction reactionEquals(one: _.IDragOverReaction, other: _.IDragOverReaction | null): boolean {\n\tif (!one && !other) {\n\t\treturn true;\n\t} else if (!one || !other) {\n\t\treturn false;\n\t} else if (one.accept !== other.accept) {\n\t\treturn false;\n\t} else if (one.bubble !== other.bubble) {\n\t\treturn false;\n\t} else if (one.effect !== other.effect) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}\n\nexport class TreeView extends HeightMap {\n\n\tstatic BINDING = 'monaco-tree-row';\n\tstatic LOADING_DECORATION_DELAY = 800;\n\n\tprivate static counter: number = 0;\n\tprivate instance: number;\n\n\tprivate context: IViewContext;\n\tprivate modelListeners: Lifecycle.IDisposable[];\n\tprivate model: Model.TreeModel | null = null;\n\n\tprivate viewListeners: Lifecycle.IDisposable[];\n\tprivate domNode: HTMLElement;\n\tprivate wrapper: HTMLElement;\n\tprivate styleElement: HTMLStyleElement;\n\tprivate treeStyler: _.ITreeStyler;\n\tprivate rowsContainer: HTMLElement;\n\tprivate scrollableElement: ScrollableElement;\n\tprivate msGesture: MSGesture;\n\tprivate lastPointerType: string;\n\tprivate lastClickTimeStamp: number = 0;\n\n\tprivate horizontalScrolling: boolean;\n\tprivate contentWidthUpdateDelayer = new Delayer<void>(50);\n\n\tprivate lastRenderTop: number;\n\tprivate lastRenderHeight: number;\n\n\tprivate inputItem: ViewItem;\n\tprivate items: { [id: string]: ViewItem; };\n\n\tprivate isRefreshing = false;\n\tprivate refreshingPreviousChildrenIds: { [id: string]: string[] } = {};\n\tprivate currentDragAndDropData: IDragAndDropData | null = null;\n\tprivate currentDropElement: any;\n\tprivate currentDropElementReaction: _.IDragOverReaction;\n\tprivate currentDropTarget: ViewItem | null = null;\n\tprivate shouldInvalidateDropReaction: boolean;\n\tprivate currentDropTargets: ViewItem[] | null = null;\n\tprivate currentDropDisposable: Lifecycle.IDisposable = Lifecycle.Disposable.None;\n\tprivate dragAndDropScrollInterval: number | null = null;\n\tprivate dragAndDropScrollTimeout: number | null = null;\n\tprivate dragAndDropMouseY: number | null = null;\n\n\tprivate didJustPressContextMenuKey: boolean;\n\n\tprivate highlightedItemWasDraggable: boolean;\n\tprivate onHiddenScrollTop: number | null = null;\n\n\tprivate readonly _onDOMFocus = new Emitter<void>();\n\tget onDOMFocus(): Event<void> { return this._onDOMFocus.event; }\n\n\tprivate readonly _onDOMBlur = new Emitter<void>();\n\n\tprivate readonly _onDidScroll = new Emitter<void>();\n\n\tconstructor(context: _.ITreeContext, container: HTMLElement) {\n\t\tsuper();\n\n\t\tTreeView.counter++;\n\t\tthis.instance = TreeView.counter;\n\n\t\tconst horizontalScrollMode = typeof context.options.horizontalScrollMode === 'undefined' ? ScrollbarVisibility.Hidden : context.options.horizontalScrollMode;\n\t\tthis.horizontalScrolling = horizontalScrollMode !== ScrollbarVisibility.Hidden;\n\n\t\tthis.context = {\n\t\t\tdataSource: context.dataSource,\n\t\t\trenderer: context.renderer,\n\t\t\tcontroller: context.controller,\n\t\t\tdnd: context.dnd,\n\t\t\tfilter: context.filter,\n\t\t\tsorter: context.sorter,\n\t\t\ttree: context.tree,\n\t\t\taccessibilityProvider: context.accessibilityProvider,\n\t\t\toptions: context.options,\n\t\t\tcache: new RowCache(context),\n\t\t\thorizontalScrolling: this.horizontalScrolling\n\t\t};\n\n\t\tthis.modelListeners = [];\n\t\tthis.viewListeners = [];\n\n\t\tthis.items = {};\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = `monaco-tree no-focused-item monaco-tree-instance-${this.instance}`;\n\t\t// to allow direct tabbing into the tree instead of first focusing the tree\n\t\tthis.domNode.tabIndex = context.options.preventRootFocus ? -1 : 0;\n\n\t\tthis.styleElement = DOM.createStyleSheet(this.domNode);\n\n\t\tthis.treeStyler = context.styler || new DefaultTreestyler(this.styleElement, `monaco-tree-instance-${this.instance}`);\n\n\t\t// ARIA\n\t\tthis.domNode.setAttribute('role', 'tree');\n\t\tif (this.context.options.ariaLabel) {\n\t\t\tthis.domNode.setAttribute('aria-label', this.context.options.ariaLabel);\n\t\t}\n\n\t\tif (this.context.options.alwaysFocused) {\n\t\t\tDOM.addClass(this.domNode, 'focused');\n\t\t}\n\n\t\tif (!this.context.options.paddingOnRow) {\n\t\t\tDOM.addClass(this.domNode, 'no-row-padding');\n\t\t}\n\n\t\tthis.wrapper = document.createElement('div');\n\t\tthis.wrapper.className = 'monaco-tree-wrapper';\n\t\tthis.scrollableElement = new ScrollableElement(this.wrapper, {\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t\thorizontal: horizontalScrollMode,\n\t\t\tvertical: (typeof context.options.verticalScrollMode !== 'undefined' ? context.options.verticalScrollMode : ScrollbarVisibility.Auto),\n\t\t\tuseShadows: context.options.useShadows\n\t\t});\n\t\tthis.scrollableElement.onScroll((e) => {\n\t\t\tthis.render(e.scrollTop, e.height, e.scrollLeft, e.width, e.scrollWidth);\n\t\t\tthis._onDidScroll.fire();\n\t\t});\n\n\t\tif (Browser.isIE) {\n\t\t\tthis.wrapper.style.msTouchAction = 'none';\n\t\t\tthis.wrapper.style.msContentZooming = 'none';\n\t\t} else {\n\t\t\tTouch.Gesture.addTarget(this.wrapper);\n\t\t}\n\n\t\tthis.rowsContainer = document.createElement('div');\n\t\tthis.rowsContainer.className = 'monaco-tree-rows';\n\t\tif (context.options.showTwistie) {\n\t\t\tthis.rowsContainer.className += ' show-twisties';\n\t\t}\n\n\t\tlet focusTracker = DOM.trackFocus(this.domNode);\n\t\tthis.viewListeners.push(focusTracker.onDidFocus(() => this.onFocus()));\n\t\tthis.viewListeners.push(focusTracker.onDidBlur(() => this.onBlur()));\n\t\tthis.viewListeners.push(focusTracker);\n\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.domNode, 'keydown', (e) => this.onKeyDown(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.domNode, 'keyup', (e) => this.onKeyUp(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.domNode, 'mousedown', (e) => this.onMouseDown(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.domNode, 'mouseup', (e) => this.onMouseUp(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'auxclick', (e: MouseEvent) => {\n\t\t\tif (e && e.button === 1) {\n\t\t\t\tthis.onMouseMiddleClick(e);\n\t\t\t}\n\t\t}));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'click', (e) => this.onClick(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.domNode, 'contextmenu', (e) => this.onContextMenu(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, Touch.EventType.Tap, (e) => this.onTap(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, Touch.EventType.Change, (e) => this.onTouchChange(e)));\n\n\t\tif (Browser.isIE) {\n\t\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'MSPointerDown', (e) => this.onMsPointerDown(e)));\n\t\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'MSGestureTap', (e) => this.onMsGestureTap(e)));\n\n\t\t\t// these events come too fast, we throttle them\n\t\t\tthis.viewListeners.push(DOM.addDisposableThrottledListener<IThrottledGestureEvent>(this.wrapper, 'MSGestureChange', (e) => this.onThrottledMsGestureChange(e), (lastEvent: IThrottledGestureEvent, event: MSGestureEvent): IThrottledGestureEvent => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tlet result = { translationY: event.translationY, translationX: event.translationX };\n\n\t\t\t\tif (lastEvent) {\n\t\t\t\t\tresult.translationY += lastEvent.translationY;\n\t\t\t\t\tresult.translationX += lastEvent.translationX;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}));\n\t\t}\n\n\t\tthis.viewListeners.push(DOM.addDisposableListener(window, 'dragover', (e) => this.onDragOver(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'drop', (e) => this.onDrop(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(window, 'dragend', (e) => this.onDragEnd(e)));\n\t\tthis.viewListeners.push(DOM.addDisposableListener(window, 'dragleave', (e) => this.onDragOver(e)));\n\n\t\tthis.wrapper.appendChild(this.rowsContainer);\n\t\tthis.domNode.appendChild(this.scrollableElement.getDomNode());\n\t\tcontainer.appendChild(this.domNode);\n\n\t\tthis.lastRenderTop = 0;\n\t\tthis.lastRenderHeight = 0;\n\n\t\tthis.didJustPressContextMenuKey = false;\n\n\t\tthis.currentDropTarget = null;\n\t\tthis.currentDropTargets = [];\n\t\tthis.shouldInvalidateDropReaction = false;\n\n\t\tthis.dragAndDropScrollInterval = null;\n\t\tthis.dragAndDropScrollTimeout = null;\n\n\t\tthis.onRowsChanged();\n\t\tthis.layout();\n\n\t\tthis.setupMSGesture();\n\n\t\tthis.applyStyles(context.options);\n\t}\n\n\tpublic applyStyles(styles: _.ITreeStyles): void {\n\t\tthis.treeStyler.style(styles);\n\t}\n\n\tprotected createViewItem(item: Model.Item): IViewItem {\n\t\treturn new ViewItem(this.context, item);\n\t}\n\n\tpublic getHTMLElement(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tpublic focus(): void {\n\t\tthis.domNode.focus();\n\t}\n\n\tpublic isFocused(): boolean {\n\t\treturn document.activeElement === this.domNode;\n\t}\n\n\tpublic blur(): void {\n\t\tthis.domNode.blur();\n\t}\n\n\tprivate setupMSGesture(): void {\n\t\tif ((<any>window).MSGesture) {\n\t\t\tthis.msGesture = new MSGesture();\n\t\t\tsetTimeout(() => this.msGesture.target = this.wrapper, 100); // TODO@joh, TODO@IETeam\n\t\t}\n\t}\n\n\tprivate isTreeVisible(): boolean {\n\t\treturn this.onHiddenScrollTop === null;\n\t}\n\n\tpublic layout(height?: number, width?: number): void {\n\t\tif (!this.isTreeVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewHeight = height || DOM.getContentHeight(this.wrapper); // render\n\t\tthis.scrollHeight = this.getContentHeight();\n\n\t\tif (this.horizontalScrolling) {\n\t\t\tthis.viewWidth = width || DOM.getContentWidth(this.wrapper);\n\t\t}\n\t}\n\n\tprivate render(scrollTop: number, viewHeight: number, scrollLeft: number, viewWidth: number, scrollWidth: number): void {\n\t\tlet i: number;\n\t\tlet stop: number;\n\n\t\tlet renderTop = scrollTop;\n\t\tlet renderBottom = scrollTop + viewHeight;\n\t\tlet thisRenderBottom = this.lastRenderTop + this.lastRenderHeight;\n\n\t\t// when view scrolls down, start rendering from the renderBottom\n\t\tfor (i = this.indexAfter(renderBottom) - 1, stop = this.indexAt(Math.max(thisRenderBottom, renderTop)); i >= stop; i--) {\n\t\t\tthis.insertItemInDOM(<ViewItem>this.itemAtIndex(i));\n\t\t}\n\n\t\t// when view scrolls up, start rendering from either this.renderTop or renderBottom\n\t\tfor (i = Math.min(this.indexAt(this.lastRenderTop), this.indexAfter(renderBottom)) - 1, stop = this.indexAt(renderTop); i >= stop; i--) {\n\t\t\tthis.insertItemInDOM(<ViewItem>this.itemAtIndex(i));\n\t\t}\n\n\t\t// when view scrolls down, start unrendering from renderTop\n\t\tfor (i = this.indexAt(this.lastRenderTop), stop = Math.min(this.indexAt(renderTop), this.indexAfter(thisRenderBottom)); i < stop; i++) {\n\t\t\tthis.removeItemFromDOM(<ViewItem>this.itemAtIndex(i));\n\t\t}\n\n\t\t// when view scrolls up, start unrendering from either renderBottom this.renderTop\n\t\tfor (i = Math.max(this.indexAfter(renderBottom), this.indexAt(this.lastRenderTop)), stop = this.indexAfter(thisRenderBottom); i < stop; i++) {\n\t\t\tthis.removeItemFromDOM(<ViewItem>this.itemAtIndex(i));\n\t\t}\n\n\t\tlet topItem = this.itemAtIndex(this.indexAt(renderTop));\n\n\t\tif (topItem) {\n\t\t\tthis.rowsContainer.style.top = (topItem.top - renderTop) + 'px';\n\t\t}\n\n\t\tif (this.horizontalScrolling) {\n\t\t\tthis.rowsContainer.style.left = -scrollLeft + 'px';\n\t\t\tthis.rowsContainer.style.width = `${Math.max(scrollWidth, viewWidth)}px`;\n\t\t}\n\n\t\tthis.lastRenderTop = renderTop;\n\t\tthis.lastRenderHeight = renderBottom - renderTop;\n\t}\n\n\tpublic setModel(newModel: Model.TreeModel): void {\n\t\tthis.releaseModel();\n\t\tthis.model = newModel;\n\n\t\tthis.model.onRefresh(this.onRefreshing, this, this.modelListeners);\n\t\tthis.model.onDidRefresh(this.onRefreshed, this, this.modelListeners);\n\t\tthis.model.onSetInput(this.onClearingInput, this, this.modelListeners);\n\t\tthis.model.onDidSetInput(this.onSetInput, this, this.modelListeners);\n\t\tthis.model.onDidFocus(this.onModelFocusChange, this, this.modelListeners);\n\n\t\tthis.model.onRefreshItemChildren(this.onItemChildrenRefreshing, this, this.modelListeners);\n\t\tthis.model.onDidRefreshItemChildren(this.onItemChildrenRefreshed, this, this.modelListeners);\n\t\tthis.model.onDidRefreshItem(this.onItemRefresh, this, this.modelListeners);\n\t\tthis.model.onExpandItem(this.onItemExpanding, this, this.modelListeners);\n\t\tthis.model.onDidExpandItem(this.onItemExpanded, this, this.modelListeners);\n\t\tthis.model.onCollapseItem(this.onItemCollapsing, this, this.modelListeners);\n\t\tthis.model.onDidRevealItem(this.onItemReveal, this, this.modelListeners);\n\t\tthis.model.onDidAddTraitItem(this.onItemAddTrait, this, this.modelListeners);\n\t\tthis.model.onDidRemoveTraitItem(this.onItemRemoveTrait, this, this.modelListeners);\n\t}\n\n\tprivate onRefreshing(): void {\n\t\tthis.isRefreshing = true;\n\t}\n\n\tprivate onRefreshed(): void {\n\t\tthis.isRefreshing = false;\n\t\tthis.onRowsChanged();\n\t}\n\n\tprivate onRowsChanged(scrollTop: number = this.scrollTop): void {\n\t\tif (this.isRefreshing) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTop = scrollTop;\n\t\tthis.updateScrollWidth();\n\t}\n\n\tprivate updateScrollWidth(): void {\n\t\tif (!this.horizontalScrolling) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.contentWidthUpdateDelayer.trigger(() => {\n\t\t\tconst keys = Object.keys(this.items);\n\t\t\tlet scrollWidth = 0;\n\n\t\t\tfor (const key of keys) {\n\t\t\t\tscrollWidth = Math.max(scrollWidth, this.items[key].width);\n\t\t\t}\n\n\t\t\tthis.scrollWidth = scrollWidth + 10 /* scrollbar */;\n\t\t});\n\t}\n\n\tpublic focusNextPage(eventPayload?: any): void {\n\t\tlet lastPageIndex = this.indexAt(this.scrollTop + this.viewHeight);\n\t\tlastPageIndex = lastPageIndex === 0 ? 0 : lastPageIndex - 1;\n\t\tlet lastPageElement = this.itemAtIndex(lastPageIndex).model.getElement();\n\t\tlet currentlyFocusedElement = this.model!.getFocus();\n\n\t\tif (currentlyFocusedElement !== lastPageElement) {\n\t\t\tthis.model!.setFocus(lastPageElement, eventPayload);\n\t\t} else {\n\t\t\tlet previousScrollTop = this.scrollTop;\n\t\t\tthis.scrollTop += this.viewHeight;\n\n\t\t\tif (this.scrollTop !== previousScrollTop) {\n\n\t\t\t\t// Let the scroll event listener run\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.focusNextPage(eventPayload);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic focusPreviousPage(eventPayload?: any): void {\n\t\tlet firstPageIndex: number;\n\n\t\tif (this.scrollTop === 0) {\n\t\t\tfirstPageIndex = this.indexAt(this.scrollTop);\n\t\t} else {\n\t\t\tfirstPageIndex = this.indexAfter(this.scrollTop - 1);\n\t\t}\n\n\t\tlet firstPageElement = this.itemAtIndex(firstPageIndex).model.getElement();\n\t\tlet currentlyFocusedElement = this.model!.getFocus();\n\n\t\tif (currentlyFocusedElement !== firstPageElement) {\n\t\t\tthis.model!.setFocus(firstPageElement, eventPayload);\n\t\t} else {\n\t\t\tlet previousScrollTop = this.scrollTop;\n\t\t\tthis.scrollTop -= this.viewHeight;\n\n\t\t\tif (this.scrollTop !== previousScrollTop) {\n\n\t\t\t\t// Let the scroll event listener run\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.focusPreviousPage(eventPayload);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get viewHeight() {\n\t\tconst scrollDimensions = this.scrollableElement.getScrollDimensions();\n\t\treturn scrollDimensions.height;\n\t}\n\n\tpublic set viewHeight(height: number) {\n\t\tthis.scrollableElement.setScrollDimensions({ height });\n\t}\n\n\tprivate set scrollHeight(scrollHeight: number) {\n\t\tscrollHeight = scrollHeight + (this.horizontalScrolling ? 10 : 0);\n\t\tthis.scrollableElement.setScrollDimensions({ scrollHeight });\n\t}\n\n\tpublic get viewWidth(): number {\n\t\tconst scrollDimensions = this.scrollableElement.getScrollDimensions();\n\t\treturn scrollDimensions.width;\n\t}\n\n\tpublic set viewWidth(viewWidth: number) {\n\t\tthis.scrollableElement.setScrollDimensions({ width: viewWidth });\n\t}\n\n\tprivate set scrollWidth(scrollWidth: number) {\n\t\tthis.scrollableElement.setScrollDimensions({ scrollWidth });\n\t}\n\n\tpublic get scrollTop(): number {\n\t\tconst scrollPosition = this.scrollableElement.getScrollPosition();\n\t\treturn scrollPosition.scrollTop;\n\t}\n\n\tpublic set scrollTop(scrollTop: number) {\n\t\tconst scrollHeight = this.getContentHeight() + (this.horizontalScrolling ? 10 : 0);\n\t\tthis.scrollableElement.setScrollDimensions({ scrollHeight });\n\t\tthis.scrollableElement.setScrollPosition({ scrollTop });\n\t}\n\n\t// Events\n\n\tprivate onClearingInput(e: Model.IInputEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tif (item) {\n\t\t\tthis.onRemoveItems(new MappedIterator(item.getNavigator(), item => item && item.id));\n\t\t\tthis.onRowsChanged();\n\t\t}\n\t}\n\n\tprivate onSetInput(e: Model.IInputEvent): void {\n\t\tthis.context.cache.garbageCollect();\n\t\tthis.inputItem = new RootViewItem(this.context, <Model.Item>e.item, this.wrapper);\n\t}\n\n\tprivate onItemChildrenRefreshing(e: Model.IItemChildrenRefreshEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet viewItem = this.items[item.id];\n\n\t\tif (viewItem && this.context.options.showLoading) {\n\t\t\tviewItem.loadingTimer = setTimeout(() => {\n\t\t\t\tviewItem.loadingTimer = 0;\n\t\t\t\tviewItem.loading = true;\n\t\t\t}, TreeView.LOADING_DECORATION_DELAY);\n\t\t}\n\n\t\tif (!e.isNested) {\n\t\t\tlet childrenIds: string[] = [];\n\t\t\tlet navigator = item.getNavigator();\n\t\t\tlet childItem: Model.Item | null;\n\n\t\t\twhile (childItem = navigator.next()) {\n\t\t\t\tchildrenIds.push(childItem.id);\n\t\t\t}\n\n\t\t\tthis.refreshingPreviousChildrenIds[item.id] = childrenIds;\n\t\t}\n\t}\n\n\tprivate onItemChildrenRefreshed(e: Model.IItemChildrenRefreshEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet viewItem = this.items[item.id];\n\n\t\tif (viewItem) {\n\t\t\tif (viewItem.loadingTimer) {\n\t\t\t\tclearTimeout(viewItem.loadingTimer);\n\t\t\t\tviewItem.loadingTimer = 0;\n\t\t\t}\n\n\t\t\tviewItem.loading = false;\n\t\t}\n\n\t\tif (!e.isNested) {\n\t\t\tlet previousChildrenIds = this.refreshingPreviousChildrenIds[item.id];\n\t\t\tlet afterModelItems: Model.Item[] = [];\n\t\t\tlet navigator = item.getNavigator();\n\t\t\tlet childItem: Model.Item | null;\n\n\t\t\twhile (childItem = navigator.next()) {\n\t\t\t\tafterModelItems.push(childItem);\n\t\t\t}\n\n\t\t\tlet skipDiff = Math.abs(previousChildrenIds.length - afterModelItems.length) > 1000;\n\t\t\tlet diff: Diff.IDiffChange[] = [];\n\t\t\tlet doToInsertItemsAlreadyExist: boolean = false;\n\n\t\t\tif (!skipDiff) {\n\t\t\t\tconst lcs = new Diff.LcsDiff(\n\t\t\t\t\t{\n\t\t\t\t\t\tgetLength: () => previousChildrenIds.length,\n\t\t\t\t\t\tgetElementAtIndex: (i: number) => previousChildrenIds[i]\n\t\t\t\t\t}, {\n\t\t\t\t\t\tgetLength: () => afterModelItems.length,\n\t\t\t\t\t\tgetElementAtIndex: (i: number) => afterModelItems[i].id\n\t\t\t\t\t},\n\t\t\t\t\tnull\n\t\t\t\t);\n\n\t\t\t\tdiff = lcs.ComputeDiff(false);\n\n\t\t\t\t// this means that the result of the diff algorithm would result\n\t\t\t\t// in inserting items that were already registered. this can only\n\t\t\t\t// happen if the data provider returns bad ids OR if the sorting\n\t\t\t\t// of the elements has changed\n\t\t\t\tdoToInsertItemsAlreadyExist = diff.some(d => {\n\t\t\t\t\tif (d.modifiedLength > 0) {\n\t\t\t\t\t\tfor (let i = d.modifiedStart, len = d.modifiedStart + d.modifiedLength; i < len; i++) {\n\t\t\t\t\t\t\tif (this.items.hasOwnProperty(afterModelItems[i].id)) {\n\t\t\t\t\t\t\t\treturn 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\treturn false;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// 50 is an optimization number, at some point we're better off\n\t\t\t// just replacing everything\n\t\t\tif (!skipDiff && !doToInsertItemsAlreadyExist && diff.length < 50) {\n\t\t\t\tfor (const diffChange of diff) {\n\n\t\t\t\t\tif (diffChange.originalLength > 0) {\n\t\t\t\t\t\tthis.onRemoveItems(new ArrayIterator(previousChildrenIds, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (diffChange.modifiedLength > 0) {\n\t\t\t\t\t\tlet beforeItem: Model.Item | null = afterModelItems[diffChange.modifiedStart - 1] || item;\n\t\t\t\t\t\tbeforeItem = beforeItem.getDepth() > 0 ? beforeItem : null;\n\n\t\t\t\t\t\tthis.onInsertItems(new ArrayIterator(afterModelItems, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength), beforeItem ? beforeItem.id : null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (skipDiff || diff.length) {\n\t\t\t\tthis.onRemoveItems(new ArrayIterator(previousChildrenIds));\n\t\t\t\tthis.onInsertItems(new ArrayIterator(afterModelItems), item.getDepth() > 0 ? item.id : null);\n\t\t\t}\n\n\t\t\tif (skipDiff || diff.length) {\n\t\t\t\tthis.onRowsChanged();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onItemRefresh(item: Model.Item): void {\n\t\tthis.onItemsRefresh([item]);\n\t}\n\n\tprivate onItemsRefresh(items: Model.Item[]): void {\n\t\tthis.onRefreshItemSet(items.filter(item => this.items.hasOwnProperty(item.id)));\n\t\tthis.onRowsChanged();\n\t}\n\n\tprivate onItemExpanding(e: Model.IItemExpandEvent): void {\n\t\tlet viewItem = this.items[e.item.id];\n\t\tif (viewItem) {\n\t\t\tviewItem.expanded = true;\n\t\t}\n\t}\n\n\tprivate onItemExpanded(e: Model.IItemExpandEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet viewItem = this.items[item.id];\n\t\tif (viewItem) {\n\t\t\tviewItem.expanded = true;\n\n\t\t\tlet height = this.onInsertItems(item.getNavigator(), item.id) || 0;\n\t\t\tlet scrollTop = this.scrollTop;\n\n\t\t\tif (viewItem.top + viewItem.height <= this.scrollTop) {\n\t\t\t\tscrollTop += height;\n\t\t\t}\n\n\t\t\tthis.onRowsChanged(scrollTop);\n\t\t}\n\t}\n\n\tprivate onItemCollapsing(e: Model.IItemCollapseEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet viewItem = this.items[item.id];\n\t\tif (viewItem) {\n\t\t\tviewItem.expanded = false;\n\t\t\tthis.onRemoveItems(new MappedIterator(item.getNavigator(), item => item && item.id));\n\t\t\tthis.onRowsChanged();\n\t\t}\n\t}\n\n\tprivate onItemReveal(e: Model.IItemRevealEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet relativeTop = <number>e.relativeTop;\n\t\tlet viewItem = this.items[item.id];\n\t\tif (viewItem) {\n\t\t\tif (relativeTop !== null) {\n\t\t\t\trelativeTop = relativeTop < 0 ? 0 : relativeTop;\n\t\t\t\trelativeTop = relativeTop > 1 ? 1 : relativeTop;\n\n\t\t\t\t// y = mx + b\n\t\t\t\tlet m = viewItem.height - this.viewHeight;\n\t\t\t\tthis.scrollTop = m * relativeTop + viewItem.top;\n\t\t\t} else {\n\t\t\t\tlet viewItemBottom = viewItem.top + viewItem.height;\n\t\t\t\tlet wrapperBottom = this.scrollTop + this.viewHeight;\n\n\t\t\t\tif (viewItem.top < this.scrollTop) {\n\t\t\t\t\tthis.scrollTop = viewItem.top;\n\t\t\t\t} else if (viewItemBottom >= wrapperBottom) {\n\t\t\t\t\tthis.scrollTop = viewItemBottom - this.viewHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onItemAddTrait(e: Model.IItemTraitEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet trait = <string>e.trait;\n\t\tlet viewItem = this.items[item.id];\n\t\tif (viewItem) {\n\t\t\tviewItem.addClass(trait);\n\t\t}\n\t\tif (trait === 'highlighted') {\n\t\t\tDOM.addClass(this.domNode, trait);\n\n\t\t\t// Ugly Firefox fix: input fields can't be selected if parent nodes are draggable\n\t\t\tif (viewItem) {\n\t\t\t\tthis.highlightedItemWasDraggable = !!viewItem.draggable;\n\t\t\t\tif (viewItem.draggable) {\n\t\t\t\t\tviewItem.draggable = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onItemRemoveTrait(e: Model.IItemTraitEvent): void {\n\t\tlet item = <Model.Item>e.item;\n\t\tlet trait = <string>e.trait;\n\t\tlet viewItem = this.items[item.id];\n\t\tif (viewItem) {\n\t\t\tviewItem.removeClass(trait);\n\t\t}\n\t\tif (trait === 'highlighted') {\n\t\t\tDOM.removeClass(this.domNode, trait);\n\n\t\t\t// Ugly Firefox fix: input fields can't be selected if parent nodes are draggable\n\t\t\tif (this.highlightedItemWasDraggable) {\n\t\t\t\tviewItem.draggable = true;\n\t\t\t}\n\t\t\tthis.highlightedItemWasDraggable = false;\n\t\t}\n\t}\n\n\tprivate onModelFocusChange(): void {\n\t\tconst focus = this.model && this.model.getFocus();\n\n\t\tDOM.toggleClass(this.domNode, 'no-focused-item', !focus);\n\n\t\t// ARIA\n\t\tif (focus) {\n\t\t\tthis.domNode.setAttribute('aria-activedescendant', strings.safeBtoa(this.context.dataSource.getId(this.context.tree, focus)));\n\t\t} else {\n\t\t\tthis.domNode.removeAttribute('aria-activedescendant');\n\t\t}\n\t}\n\n\t// HeightMap \"events\"\n\n\tpublic onInsertItem(item: ViewItem): void {\n\t\titem.onDragStart = (e) => { this.onDragStart(item, e); };\n\t\titem.needsRender = true;\n\t\tthis.refreshViewItem(item);\n\t\tthis.items[item.id] = item;\n\t}\n\n\tpublic onRefreshItem(item: ViewItem, needsRender = false): void {\n\t\titem.needsRender = item.needsRender || needsRender;\n\t\tthis.refreshViewItem(item);\n\t}\n\n\tpublic onRemoveItem(item: ViewItem): void {\n\t\tthis.removeItemFromDOM(item);\n\t\titem.dispose();\n\t\tdelete this.items[item.id];\n\t}\n\n\t// ViewItem refresh\n\n\tprivate refreshViewItem(item: ViewItem): void {\n\t\titem.render();\n\n\t\tif (this.shouldBeRendered(item)) {\n\t\t\tthis.insertItemInDOM(item);\n\t\t} else {\n\t\t\tthis.removeItemFromDOM(item);\n\t\t}\n\t}\n\n\t// DOM Events\n\n\tprivate onClick(e: MouseEvent): void {\n\t\tif (this.lastPointerType && this.lastPointerType !== 'mouse') {\n\t\t\treturn;\n\t\t}\n\n\t\tlet event = new Mouse.StandardMouseEvent(e);\n\t\tlet item = this.getItemAround(event.target);\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (Browser.isIE && Date.now() - this.lastClickTimeStamp < 300) {\n\t\t\t// IE10+ doesn't set the detail property correctly. While IE10 simply\n\t\t\t// counts the number of clicks, IE11 reports always 1. To align with\n\t\t\t// other browser, we set the value to 2 if clicks events come in a 300ms\n\t\t\t// sequence.\n\t\t\tevent.detail = 2;\n\t\t}\n\t\tthis.lastClickTimeStamp = Date.now();\n\n\t\tthis.context.controller!.onClick(this.context.tree, item.model.getElement(), event);\n\t}\n\n\tprivate onMouseMiddleClick(e: MouseEvent): void {\n\t\tif (!this.context.controller!.onMouseMiddleClick!) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet event = new Mouse.StandardMouseEvent(e);\n\t\tlet item = this.getItemAround(event.target);\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\t\tthis.context.controller!.onMouseMiddleClick!(this.context.tree, item.model.getElement(), event);\n\t}\n\n\tprivate onMouseDown(e: MouseEvent): void {\n\t\tthis.didJustPressContextMenuKey = false;\n\n\t\tif (!this.context.controller!.onMouseDown!) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.lastPointerType && this.lastPointerType !== 'mouse') {\n\t\t\treturn;\n\t\t}\n\n\t\tlet event = new Mouse.StandardMouseEvent(e);\n\n\t\tif (event.ctrlKey && Platform.isNative && Platform.isMacintosh) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet item = this.getItemAround(event.target);\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.context.controller!.onMouseDown!(this.context.tree, item.model.getElement(), event);\n\t}\n\n\tprivate onMouseUp(e: MouseEvent): void {\n\t\tif (!this.context.controller!.onMouseUp!) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.lastPointerType && this.lastPointerType !== 'mouse') {\n\t\t\treturn;\n\t\t}\n\n\t\tlet event = new Mouse.StandardMouseEvent(e);\n\n\t\tif (event.ctrlKey && Platform.isNative && Platform.isMacintosh) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet item = this.getItemAround(event.target);\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.context.controller!.onMouseUp!(this.context.tree, item.model.getElement(), event);\n\t}\n\n\tprivate onTap(e: Touch.GestureEvent): void {\n\t\tlet item = this.getItemAround(<HTMLElement>e.initialTarget);\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.context.controller!.onTap(this.context.tree, item.model.getElement(), e);\n\t}\n\n\tprivate onTouchChange(event: Touch.GestureEvent): void {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tthis.scrollTop -= event.translationY;\n\t}\n\n\tprivate onContextMenu(keyboardEvent: KeyboardEvent): void;\n\tprivate onContextMenu(mouseEvent: MouseEvent): void;\n\tprivate onContextMenu(event: KeyboardEvent | MouseEvent): void {\n\t\tlet resultEvent: _.ContextMenuEvent;\n\t\tlet element: any;\n\n\t\tif (event instanceof KeyboardEvent || this.didJustPressContextMenuKey) {\n\t\t\tthis.didJustPressContextMenuKey = false;\n\n\t\t\tlet keyboardEvent = new Keyboard.StandardKeyboardEvent(<KeyboardEvent>event);\n\t\t\telement = this.model!.getFocus();\n\n\t\t\tlet position: DOM.IDomNodePagePosition;\n\n\t\t\tif (!element) {\n\t\t\t\telement = this.model!.getInput();\n\t\t\t\tposition = DOM.getDomNodePagePosition(this.inputItem.element);\n\t\t\t} else {\n\t\t\t\tconst id = this.context.dataSource.getId(this.context.tree, element);\n\t\t\t\tconst viewItem = this.items[id!];\n\t\t\t\tposition = DOM.getDomNodePagePosition(viewItem.element);\n\t\t\t}\n\n\t\t\tresultEvent = new _.KeyboardContextMenuEvent(position.left + position.width, position.top, keyboardEvent);\n\n\t\t} else {\n\t\t\tlet mouseEvent = new Mouse.StandardMouseEvent(<MouseEvent>event);\n\t\t\tlet item = this.getItemAround(mouseEvent.target);\n\n\t\t\tif (!item) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\telement = item.model.getElement();\n\t\t\tresultEvent = new _.MouseContextMenuEvent(mouseEvent);\n\t\t}\n\n\t\tthis.context.controller!.onContextMenu(this.context.tree, element, resultEvent);\n\t}\n\n\tprivate onKeyDown(e: KeyboardEvent): void {\n\t\tlet event = new Keyboard.StandardKeyboardEvent(e);\n\n\t\tthis.didJustPressContextMenuKey = event.keyCode === KeyCode.ContextMenu || (event.shiftKey && event.keyCode === KeyCode.F10);\n\n\t\tif (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') {\n\t\t\treturn; // Ignore event if target is a form input field (avoids browser specific issues)\n\t\t}\n\n\t\tif (this.didJustPressContextMenuKey) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\n\t\tthis.context.controller!.onKeyDown(this.context.tree, event);\n\t}\n\n\tprivate onKeyUp(e: KeyboardEvent): void {\n\t\tif (this.didJustPressContextMenuKey) {\n\t\t\tthis.onContextMenu(e);\n\t\t}\n\n\t\tthis.didJustPressContextMenuKey = false;\n\t\tthis.context.controller!.onKeyUp(this.context.tree, new Keyboard.StandardKeyboardEvent(e));\n\t}\n\n\tprivate onDragStart(item: ViewItem, e: any): void {\n\t\tif (this.model!.getHighlight()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet element = item.model.getElement();\n\t\tlet selection = this.model!.getSelection();\n\t\tlet elements: any[];\n\n\t\tif (selection.indexOf(element) > -1) {\n\t\t\telements = selection;\n\t\t} else {\n\t\t\telements = [element];\n\t\t}\n\n\t\te.dataTransfer.effectAllowed = 'copyMove';\n\t\te.dataTransfer.setData(DataTransfers.RESOURCES, JSON.stringify([item.uri]));\n\t\tif (e.dataTransfer.setDragImage) {\n\t\t\tlet label: string;\n\n\t\t\tif (this.context.dnd!.getDragLabel) {\n\t\t\t\tlabel = this.context.dnd!.getDragLabel!(this.context.tree, elements);\n\t\t\t} else {\n\t\t\t\tlabel = String(elements.length);\n\t\t\t}\n\n\t\t\tconst dragImage = document.createElement('div');\n\t\t\tdragImage.className = 'monaco-tree-drag-image';\n\t\t\tdragImage.textContent = label;\n\t\t\tdocument.body.appendChild(dragImage);\n\t\t\te.dataTransfer.setDragImage(dragImage, -10, -10);\n\t\t\tsetTimeout(() => document.body.removeChild(dragImage), 0);\n\t\t}\n\n\t\tthis.currentDragAndDropData = new dnd.ElementsDragAndDropData(elements);\n\t\tStaticDND.CurrentDragAndDropData = new dnd.ExternalElementsDragAndDropData(elements);\n\n\t\tthis.context.dnd!.onDragStart(this.context.tree, this.currentDragAndDropData, new Mouse.DragMouseEvent(e));\n\t}\n\n\tprivate setupDragAndDropScrollInterval(): void {\n\t\tlet viewTop = DOM.getTopLeftOffset(this.wrapper).top;\n\n\t\tif (!this.dragAndDropScrollInterval) {\n\t\t\tthis.dragAndDropScrollInterval = window.setInterval(() => {\n\t\t\t\tif (this.dragAndDropMouseY === null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet diff = this.dragAndDropMouseY - viewTop;\n\t\t\t\tlet scrollDiff = 0;\n\t\t\t\tlet upperLimit = this.viewHeight - 35;\n\n\t\t\t\tif (diff < 35) {\n\t\t\t\t\tscrollDiff = Math.max(-14, 0.2 * (diff - 35));\n\t\t\t\t} else if (diff > upperLimit) {\n\t\t\t\t\tscrollDiff = Math.min(14, 0.2 * (diff - upperLimit));\n\t\t\t\t}\n\n\t\t\t\tthis.scrollTop += scrollDiff;\n\t\t\t}, 10);\n\n\t\t\tthis.cancelDragAndDropScrollTimeout();\n\n\t\t\tthis.dragAndDropScrollTimeout = window.setTimeout(() => {\n\t\t\t\tthis.cancelDragAndDropScrollInterval();\n\t\t\t\tthis.dragAndDropScrollTimeout = null;\n\t\t\t}, 1000);\n\t\t}\n\t}\n\n\tprivate cancelDragAndDropScrollInterval(): void {\n\t\tif (this.dragAndDropScrollInterval) {\n\t\t\twindow.clearInterval(this.dragAndDropScrollInterval);\n\t\t\tthis.dragAndDropScrollInterval = null;\n\t\t}\n\n\t\tthis.cancelDragAndDropScrollTimeout();\n\t}\n\n\tprivate cancelDragAndDropScrollTimeout(): void {\n\t\tif (this.dragAndDropScrollTimeout) {\n\t\t\twindow.clearTimeout(this.dragAndDropScrollTimeout);\n\t\t\tthis.dragAndDropScrollTimeout = null;\n\t\t}\n\t}\n\n\tprivate onDragOver(e: DragEvent): boolean {\n\t\te.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)\n\n\t\tlet event = new Mouse.DragMouseEvent(e);\n\n\t\tlet viewItem = this.getItemAround(event.target);\n\n\t\tif (!viewItem || (event.posx === 0 && event.posy === 0 && event.browserEvent.type === DOM.EventType.DRAG_LEAVE)) {\n\t\t\t// dragging outside of tree\n\n\t\t\tif (this.currentDropTarget) {\n\t\t\t\t// clear previously hovered element feedback\n\n\t\t\t\tthis.currentDropTargets!.forEach(i => i.dropTarget = false);\n\t\t\t\tthis.currentDropTargets = [];\n\t\t\t\tthis.currentDropDisposable.dispose();\n\t\t\t}\n\n\t\t\tthis.cancelDragAndDropScrollInterval();\n\t\t\tthis.currentDropTarget = null;\n\t\t\tthis.currentDropElement = null;\n\t\t\tthis.dragAndDropMouseY = null;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// dragging inside the tree\n\t\tthis.setupDragAndDropScrollInterval();\n\t\tthis.dragAndDropMouseY = event.posy;\n\n\t\tif (!this.currentDragAndDropData) {\n\t\t\t// just started dragging\n\n\t\t\tif (StaticDND.CurrentDragAndDropData) {\n\t\t\t\tthis.currentDragAndDropData = StaticDND.CurrentDragAndDropData;\n\t\t\t} else {\n\t\t\t\tif (!event.dataTransfer.types) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.currentDragAndDropData = new dnd.DesktopDragAndDropData();\n\t\t\t}\n\t\t}\n\n\t\tthis.currentDragAndDropData.update((event.browserEvent as DragEvent).dataTransfer!);\n\n\t\tlet element: any;\n\t\tlet item: Model.Item | null = viewItem.model;\n\t\tlet reaction: _.IDragOverReaction | null;\n\n\t\t// check the bubble up behavior\n\t\tdo {\n\t\t\telement = item ? item.getElement() : this.model!.getInput();\n\t\t\treaction = this.context.dnd!.onDragOver(this.context.tree, this.currentDragAndDropData, element, event);\n\n\t\t\tif (!reaction || reaction.bubble !== _.DragOverBubble.BUBBLE_UP) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\titem = item && item.parent;\n\t\t} while (item);\n\n\t\tif (!item) {\n\t\t\tthis.currentDropElement = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tlet canDrop = reaction && reaction.accept;\n\n\t\tif (canDrop) {\n\t\t\tthis.currentDropElement = item.getElement();\n\t\t\tevent.preventDefault();\n\t\t\tevent.dataTransfer.dropEffect = reaction!.effect === _.DragOverEffect.COPY ? 'copy' : 'move';\n\t\t} else {\n\t\t\tthis.currentDropElement = null;\n\t\t}\n\n\t\t// item is the model item where drop() should be called\n\n\t\t// can be null\n\t\tlet currentDropTarget = item.id === this.inputItem.id ? this.inputItem : this.items[item.id];\n\n\t\tif (this.shouldInvalidateDropReaction || this.currentDropTarget !== currentDropTarget || !reactionEquals(this.currentDropElementReaction, reaction)) {\n\t\t\tthis.shouldInvalidateDropReaction = false;\n\n\t\t\tif (this.currentDropTarget) {\n\t\t\t\tthis.currentDropTargets!.forEach(i => i.dropTarget = false);\n\t\t\t\tthis.currentDropTargets = [];\n\t\t\t\tthis.currentDropDisposable.dispose();\n\t\t\t}\n\n\t\t\tthis.currentDropTarget = currentDropTarget;\n\t\t\tthis.currentDropElementReaction = reaction!;\n\n\t\t\tif (canDrop) {\n\t\t\t\t// setup hover feedback for drop target\n\n\t\t\t\tif (this.currentDropTarget) {\n\t\t\t\t\tthis.currentDropTarget.dropTarget = true;\n\t\t\t\t\tthis.currentDropTargets!.push(this.currentDropTarget);\n\t\t\t\t}\n\n\t\t\t\tif (reaction!.bubble === _.DragOverBubble.BUBBLE_DOWN) {\n\t\t\t\t\tlet nav = item.getNavigator();\n\t\t\t\t\tlet child: Model.Item | null;\n\t\t\t\t\twhile (child = nav.next()) {\n\t\t\t\t\t\tviewItem = this.items[child.id];\n\t\t\t\t\t\tif (viewItem) {\n\t\t\t\t\t\t\tviewItem.dropTarget = true;\n\t\t\t\t\t\t\tthis.currentDropTargets!.push(viewItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (reaction!.autoExpand) {\n\t\t\t\t\tconst timeoutPromise = timeout(500);\n\t\t\t\t\tthis.currentDropDisposable = Lifecycle.toDisposable(() => timeoutPromise.cancel());\n\n\t\t\t\t\ttimeoutPromise\n\t\t\t\t\t\t.then(() => this.context.tree.expand(this.currentDropElement))\n\t\t\t\t\t\t.then(() => this.shouldInvalidateDropReaction = true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate onDrop(e: DragEvent): void {\n\t\tif (this.currentDropElement) {\n\t\t\tlet event = new Mouse.DragMouseEvent(e);\n\t\t\tevent.preventDefault();\n\t\t\tthis.currentDragAndDropData!.update((event.browserEvent as DragEvent).dataTransfer!);\n\t\t\tthis.context.dnd!.drop(this.context.tree, this.currentDragAndDropData!, this.currentDropElement, event);\n\t\t\tthis.onDragEnd(e);\n\t\t}\n\t\tthis.cancelDragAndDropScrollInterval();\n\t}\n\n\tprivate onDragEnd(e: DragEvent): void {\n\t\tif (this.currentDropTarget) {\n\t\t\tthis.currentDropTargets!.forEach(i => i.dropTarget = false);\n\t\t\tthis.currentDropTargets = [];\n\t\t}\n\n\t\tthis.currentDropDisposable.dispose();\n\n\t\tthis.cancelDragAndDropScrollInterval();\n\t\tthis.currentDragAndDropData = null;\n\t\tStaticDND.CurrentDragAndDropData = undefined;\n\t\tthis.currentDropElement = null;\n\t\tthis.currentDropTarget = null;\n\t\tthis.dragAndDropMouseY = null;\n\t}\n\n\tprivate onFocus(): void {\n\t\tif (!this.context.options.alwaysFocused) {\n\t\t\tDOM.addClass(this.domNode, 'focused');\n\t\t}\n\n\t\tthis._onDOMFocus.fire();\n\t}\n\n\tprivate onBlur(): void {\n\t\tif (!this.context.options.alwaysFocused) {\n\t\t\tDOM.removeClass(this.domNode, 'focused');\n\t\t}\n\n\t\tthis.domNode.removeAttribute('aria-activedescendant'); // ARIA\n\n\t\tthis._onDOMBlur.fire();\n\t}\n\n\t// MS specific DOM Events\n\n\tprivate onMsPointerDown(event: MSPointerEvent): void {\n\t\tif (!this.msGesture) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Circumvent IE11 breaking change in e.pointerType & TypeScript's stale definitions\n\t\tlet pointerType = event.pointerType;\n\t\tif (pointerType === ((<any>event).MSPOINTER_TYPE_MOUSE || 'mouse')) {\n\t\t\tthis.lastPointerType = 'mouse';\n\t\t\treturn;\n\t\t} else if (pointerType === ((<any>event).MSPOINTER_TYPE_TOUCH || 'touch')) {\n\t\t\tthis.lastPointerType = 'touch';\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\n\t\tthis.msGesture.addPointer(event.pointerId);\n\t}\n\n\tprivate onThrottledMsGestureChange(event: IThrottledGestureEvent): void {\n\t\tthis.scrollTop -= event.translationY;\n\t}\n\n\tprivate onMsGestureTap(event: MSGestureEvent): void {\n\t\t(<any>event).initialTarget = document.elementFromPoint(event.clientX, event.clientY);\n\t\tthis.onTap(<any>event);\n\t}\n\n\t// DOM changes\n\n\tprivate insertItemInDOM(item: ViewItem): void {\n\t\tlet elementAfter: HTMLElement | null = null;\n\t\tlet itemAfter = <ViewItem>this.itemAfter(item);\n\n\t\tif (itemAfter && itemAfter.element) {\n\t\t\telementAfter = itemAfter.element;\n\t\t}\n\n\t\titem.insertInDOM(this.rowsContainer, elementAfter);\n\t}\n\n\tprivate removeItemFromDOM(item: ViewItem): void {\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\titem.removeFromDOM();\n\t}\n\n\t// Helpers\n\n\tprivate shouldBeRendered(item: ViewItem): boolean {\n\t\treturn item.top < this.lastRenderTop + this.lastRenderHeight && item.top + item.height > this.lastRenderTop;\n\t}\n\n\tprivate getItemAround(element: HTMLElement): ViewItem | undefined {\n\t\tlet candidate: ViewItem = this.inputItem;\n\t\tlet el: HTMLElement | null = element;\n\n\t\tdo {\n\t\t\tif ((<any>el)[TreeView.BINDING]) {\n\t\t\t\tcandidate = (<any>el)[TreeView.BINDING];\n\t\t\t}\n\n\t\t\tif (el === this.wrapper || el === this.domNode) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\n\t\t\tif (el === this.scrollableElement.getDomNode() || el === document.body) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t} while (el = el.parentElement);\n\n\t\treturn undefined;\n\t}\n\n\t// Cleanup\n\n\tprivate releaseModel(): void {\n\t\tif (this.model) {\n\t\t\tthis.modelListeners = Lifecycle.dispose(this.modelListeners);\n\t\t\tthis.model = null;\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\t// TODO@joao: improve\n\t\tthis.scrollableElement.dispose();\n\n\t\tthis.releaseModel();\n\n\t\tthis.viewListeners = Lifecycle.dispose(this.viewListeners);\n\n\t\tthis._onDOMFocus.dispose();\n\t\tthis._onDOMBlur.dispose();\n\n\t\tif (this.domNode.parentNode) {\n\t\t\tthis.domNode.parentNode.removeChild(this.domNode);\n\t\t}\n\n\t\tif (this.items) {\n\t\t\tObject.keys(this.items).forEach(key => this.items[key].removeFromDOM());\n\t\t}\n\n\t\tif (this.context.cache) {\n\t\t\tthis.context.cache.dispose();\n\t\t}\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 'vs/css!./splitview';\nimport { IDisposable, combinedDisposable, toDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport * as types from 'vs/base/common/types';\nimport * as dom from 'vs/base/browser/dom';\nimport { clamp } from 'vs/base/common/numbers';\nimport { range, firstIndex, pushToStart, pushToEnd } from 'vs/base/common/arrays';\nimport { Sash, Orientation, ISashEvent as IBaseSashEvent, SashState } from 'vs/base/browser/ui/sash/sash';\nimport { Color } from 'vs/base/common/color';\nimport { domEvent } from 'vs/base/browser/event';\nexport { Orientation } from 'vs/base/browser/ui/sash/sash';\n\nexport interface ISplitViewStyles {\n\tseparatorBorder: Color;\n}\n\nconst defaultStyles: ISplitViewStyles = {\n\tseparatorBorder: Color.transparent\n};\n\nexport interface ISplitViewOptions {\n\torientation?: Orientation; // default Orientation.VERTICAL\n\tstyles?: ISplitViewStyles;\n\tinverseAltBehavior?: boolean;\n\tproportionalLayout?: boolean; // default true\n}\n\n/**\n * Only used when `proportionalLayout` is false.\n */\nexport const enum LayoutPriority {\n\tNormal,\n\tLow,\n\tHigh\n}\n\nexport interface IView {\n\treadonly element: HTMLElement;\n\treadonly minimumSize: number;\n\treadonly maximumSize: number;\n\treadonly onDidChange: Event<number | undefined>;\n\treadonly priority?: LayoutPriority;\n\tlayout(size: number, orientation: Orientation): void;\n}\n\ninterface ISashEvent {\n\tsash: Sash;\n\tstart: number;\n\tcurrent: number;\n\talt: boolean;\n}\n\ninterface IViewItem {\n\tview: IView;\n\tsize: number;\n\tcontainer: HTMLElement;\n\tdisposable: IDisposable;\n\tlayout(): void;\n}\n\ninterface ISashItem {\n\tsash: Sash;\n\tdisposable: IDisposable;\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\tdisposable: IDisposable;\n}\n\nenum State {\n\tIdle,\n\tBusy\n}\n\nexport type DistributeSizing = { type: 'distribute' };\nexport type SplitSizing = { type: 'split', index: number };\nexport type Sizing = DistributeSizing | SplitSizing;\n\nexport namespace Sizing {\n\texport const Distribute: DistributeSizing = { type: 'distribute' };\n\texport function Split(index: number): SplitSizing { return { type: 'split', index }; }\n}\n\nexport class SplitView extends Disposable {\n\n\treadonly orientation: Orientation;\n\treadonly el: HTMLElement;\n\tprivate sashContainer: HTMLElement;\n\tprivate viewContainer: HTMLElement;\n\tprivate size = 0;\n\tprivate contentSize = 0;\n\tprivate proportions: undefined | number[] = undefined;\n\tprivate viewItems: IViewItem[] = [];\n\tprivate sashItems: ISashItem[] = [];\n\tprivate sashDragState: ISashDragState;\n\tprivate state: State = State.Idle;\n\tprivate inverseAltBehavior: boolean;\n\tprivate proportionalLayout: boolean;\n\n\tprivate _onDidSashChange = this._register(new Emitter<number>());\n\treadonly onDidSashChange = this._onDidSashChange.event;\n\n\tprivate _onDidSashReset = this._register(new Emitter<number>());\n\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\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\tprivate _orthogonalEndSash: Sash | undefined;\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\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\tconstructor(container: HTMLElement, options: ISplitViewOptions = {}) {\n\t\tsuper();\n\n\t\tthis.orientation = types.isUndefined(options.orientation) ? Orientation.VERTICAL : options.orientation;\n\t\tthis.inverseAltBehavior = !!options.inverseAltBehavior;\n\t\tthis.proportionalLayout = types.isUndefined(options.proportionalLayout) ? true : !!options.proportionalLayout;\n\n\t\tthis.el = document.createElement('div');\n\t\tdom.addClass(this.el, 'monaco-split-view2');\n\t\tdom.addClass(this.el, this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');\n\t\tcontainer.appendChild(this.el);\n\n\t\tthis.sashContainer = dom.append(this.el, dom.$('.sash-container'));\n\t\tthis.viewContainer = dom.append(this.el, dom.$('.split-view-container'));\n\n\t\tthis.style(options.styles || defaultStyles);\n\t}\n\n\tstyle(styles: ISplitViewStyles): void {\n\t\tif (styles.separatorBorder.isTransparent()) {\n\t\t\tdom.removeClass(this.el, 'separator-border');\n\t\t\tthis.el.style.removeProperty('--separator-border');\n\t\t} else {\n\t\t\tdom.addClass(this.el, 'separator-border');\n\t\t\tthis.el.style.setProperty('--separator-border', styles.separatorBorder.toString());\n\t\t}\n\t}\n\n\taddView(view: IView, size: number | Sizing, index = this.viewItems.length): 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 = dom.$('.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\tconst layoutContainer = this.orientation === Orientation.VERTICAL\n\t\t\t? () => item.container.style.height = `${item.size}px`\n\t\t\t: () => item.container.style.width = `${item.size}px`;\n\n\t\tconst layout = () => {\n\t\t\tlayoutContainer();\n\t\t\titem.view.layout(item.size, this.orientation);\n\t\t};\n\n\t\tlet viewSize: number;\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 {\n\t\t\tviewSize = view.minimumSize;\n\t\t}\n\n\t\tconst item: IViewItem = { view, container, size: viewSize, layout, disposable };\n\t\tthis.viewItems.splice(index, 0, item);\n\n\t\t// Add sash\n\t\tif (this.viewItems.length > 1) {\n\t\t\tconst orientation = this.orientation === Orientation.VERTICAL ? Orientation.HORIZONTAL : Orientation.VERTICAL;\n\t\t\tconst layoutProvider = this.orientation === Orientation.VERTICAL ? { getHorizontalSashTop: (sash: Sash) => this.getSashPosition(sash) } : { getVerticalSashLeft: (sash: Sash) => this.getSashPosition(sash) };\n\t\t\tconst sash = new Sash(this.sashContainer, layoutProvider, {\n\t\t\t\torientation,\n\t\t\t\torthogonalStartSash: this.orthogonalStartSash,\n\t\t\t\torthogonalEndSash: this.orthogonalEndSash\n\t\t\t});\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 } as ISashEvent)\n\t\t\t\t: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey } as ISashEvent);\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, () => firstIndex(this.sashItems, item => item.sash === sash));\n\t\t\tconst onEndDisposable = onEnd(this.onSashEnd, this);\n\t\t\tconst onDidResetDisposable = sash.onDidReset(() => this._onDidSashReset.fire(firstIndex(this.sashItems, item => item.sash === sash)));\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 highPriorityIndex: number | undefined;\n\n\t\tif (typeof size !== 'number' && size.type === 'split') {\n\t\t\thighPriorityIndex = size.index;\n\t\t}\n\n\t\tthis.relayout(index, highPriorityIndex);\n\t\tthis.state = State.Idle;\n\n\t\tif (typeof size !== 'number' && size.type === 'distribute') {\n\t\t\tthis.distributeViewSizes();\n\t\t}\n\t}\n\n\tprivate relayout(lowPriorityIndex?: number, highPriorityIndex?: number): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tconst lowPriorityIndexes = typeof lowPriorityIndex === 'number' ? [lowPriorityIndex] : undefined;\n\t\tconst highPriorityIndexes = typeof highPriorityIndex === 'number' ? [highPriorityIndex] : undefined;\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\tlayout(size: number): void {\n\t\tconst previousSize = Math.max(this.size, this.contentSize);\n\t\tthis.size = size;\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].view.priority === LayoutPriority.Low);\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].view.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.view.minimumSize, item.view.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\tconst index = firstIndex(this.sashItems, 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\tdomEvent(document.body, 'keydown')(e => resetSashDragState(this.sashDragState.current, e.altKey)),\n\t\t\tdomEvent(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.view.minimumSize - viewItem.size) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.view.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.view.maximumSize) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.size - viewItem.view.minimumSize) / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, 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 } = 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);\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.view.maximumSize;\n\t\t\tconst newMaxDelta = viewItem.size - viewItem.view.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\t}\n\n\tprivate onViewChange(item: IViewItem, 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.view.minimumSize, item.view.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\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 item = this.viewItems[index];\n\t\tsize = Math.round(size);\n\t\tsize = clamp(size, item.view.minimumSize, item.view.maximumSize);\n\t\tlet delta = size - item.size;\n\n\t\tif (delta !== 0 && index < this.viewItems.length - 1) {\n\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\tconst collapseDown = downIndexes.reduce((r, i) => r + (this.viewItems[i].size - this.viewItems[i].view.minimumSize), 0);\n\t\t\tconst expandDown = downIndexes.reduce((r, i) => r + (this.viewItems[i].view.maximumSize - this.viewItems[i].size), 0);\n\t\t\tconst deltaDown = clamp(delta, -expandDown, collapseDown);\n\n\t\t\tthis.resize(index, deltaDown);\n\t\t\tdelta -= deltaDown;\n\t\t}\n\n\t\tif (delta !== 0 && index > 0) {\n\t\t\tconst upIndexes = range(index - 1, -1);\n\t\t\tconst collapseUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].size - this.viewItems[i].view.minimumSize), 0);\n\t\t\tconst expandUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].view.maximumSize - this.viewItems[i].size), 0);\n\t\t\tconst deltaUp = clamp(-delta, -collapseUp, expandUp);\n\n\t\t\tthis.resize(index - 1, deltaUp);\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t\tthis.saveProportions();\n\t\tthis.state = State.Idle;\n\t}\n\n\tdistributeViewSizes(): void {\n\t\tconst size = Math.floor(this.size / this.viewItems.length);\n\n\t\tfor (let i = 0; i < this.viewItems.length - 1; i++) {\n\t\t\tthis.resizeView(i, size);\n\t\t}\n\t}\n\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 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): 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].view.minimumSize - sizes[i]), 0);\n\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].view.maximumSize - sizes[i]), 0);\n\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].view.minimumSize), 0);\n\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].view.maximumSize), 0);\n\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta);\n\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta);\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.view.minimumSize, item.view.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.view.minimumSize, item.view.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(): void {\n\t\tlet contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tlet emptyDelta = this.size - contentSize;\n\n\t\tfor (let i = this.viewItems.length - 1; emptyDelta !== 0 && i >= 0; i--) {\n\t\t\tconst item = this.viewItems[i];\n\t\t\tconst size = clamp(item.size + emptyDelta, item.view.minimumSize, item.view.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\tthis.viewItems.forEach(item => item.layout());\n\n\t\t// Layout sashes\n\t\tthis.sashItems.forEach(item => item.sash.layout());\n\n\t\t// Update sashes enablement\n\t\tlet previous = false;\n\t\tconst collapsesDown = this.viewItems.map(i => previous = (i.size - i.view.minimumSize > 0) || previous);\n\n\t\tprevious = false;\n\t\tconst expandsDown = this.viewItems.map(i => previous = (i.view.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.view.minimumSize > 0) || previous).reverse();\n\n\t\tprevious = false;\n\t\tconst expandsUp = reverseViews.map(i => previous = (i.view.maximumSize - i.size > 0) || previous).reverse();\n\n\t\tthis.sashItems.forEach((s, i) => {\n\t\t\tconst min = !(collapsesDown[i] && expandsUp[i + 1]);\n\t\t\tconst max = !(expandsDown[i] && collapsesUp[i + 1]);\n\n\t\t\tif (min && max) {\n\t\t\t\ts.sash.state = SashState.Disabled;\n\t\t\t} else if (min && !max) {\n\t\t\t\ts.sash.state = SashState.Minimum;\n\t\t\t} else if (!min && max) {\n\t\t\t\ts.sash.state = SashState.Maximum;\n\t\t\t} else {\n\t\t\t\ts.sash.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\tdispose(): void {\n\t\tsuper.dispose();\n\n\t\tthis.viewItems.forEach(i => i.disposable.dispose());\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 'vs/css!./tree';\nimport * as TreeDefaults from 'vs/base/parts/tree/browser/treeDefaults';\nimport * as Model from 'vs/base/parts/tree/browser/treeModel';\nimport * as View from './treeView';\nimport * as _ from 'vs/base/parts/tree/browser/tree';\nimport { Event, Emitter, Relay } from 'vs/base/common/event';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\n\nexport class TreeContext implements _.ITreeContext {\n\n\tpublic tree: _.ITree;\n\tpublic configuration: _.ITreeConfiguration;\n\tpublic options: _.ITreeOptions;\n\n\tpublic dataSource: _.IDataSource;\n\tpublic renderer?: _.IRenderer;\n\tpublic controller: _.IController;\n\tpublic dnd: _.IDragAndDrop;\n\tpublic filter: _.IFilter;\n\tpublic sorter?: _.ISorter;\n\tpublic accessibilityProvider: _.IAccessibilityProvider;\n\tpublic styler?: _.ITreeStyler;\n\n\tconstructor(tree: _.ITree, configuration: _.ITreeConfiguration, options: _.ITreeOptions = {}) {\n\t\tthis.tree = tree;\n\t\tthis.configuration = configuration;\n\t\tthis.options = options;\n\n\t\tif (!configuration.dataSource) {\n\t\t\tthrow new Error('You must provide a Data Source to the tree.');\n\t\t}\n\n\t\tthis.dataSource = configuration.dataSource;\n\t\tthis.renderer = configuration.renderer;\n\t\tthis.controller = configuration.controller || new TreeDefaults.DefaultController({ clickBehavior: TreeDefaults.ClickBehavior.ON_MOUSE_UP, keyboardSupport: typeof options.keyboardSupport !== 'boolean' || options.keyboardSupport });\n\t\tthis.dnd = configuration.dnd || new TreeDefaults.DefaultDragAndDrop();\n\t\tthis.filter = configuration.filter || new TreeDefaults.DefaultFilter();\n\t\tthis.sorter = configuration.sorter;\n\t\tthis.accessibilityProvider = configuration.accessibilityProvider || new TreeDefaults.DefaultAccessibilityProvider();\n\t\tthis.styler = configuration.styler;\n\t}\n}\n\nconst defaultStyles: _.ITreeStyles = {\n\tlistFocusBackground: Color.fromHex('#073655'),\n\tlistActiveSelectionBackground: Color.fromHex('#0E639C'),\n\tlistActiveSelectionForeground: Color.fromHex('#FFFFFF'),\n\tlistFocusAndSelectionBackground: Color.fromHex('#094771'),\n\tlistFocusAndSelectionForeground: Color.fromHex('#FFFFFF'),\n\tlistInactiveSelectionBackground: Color.fromHex('#3F3F46'),\n\tlistHoverBackground: Color.fromHex('#2A2D2E'),\n\tlistDropBackground: Color.fromHex('#383B3D')\n};\n\nexport class Tree implements _.ITree {\n\n\tprivate container: HTMLElement;\n\n\tprivate context: _.ITreeContext;\n\tprivate model: Model.TreeModel;\n\tprivate view: View.TreeView;\n\n\tprivate _onDidChangeFocus = new Relay<_.IFocusEvent>();\n\treadonly onDidChangeFocus: Event<_.IFocusEvent> = this._onDidChangeFocus.event;\n\tprivate _onDidChangeSelection = new Relay<_.ISelectionEvent>();\n\treadonly onDidChangeSelection: Event<_.ISelectionEvent> = this._onDidChangeSelection.event;\n\tprivate _onHighlightChange = new Relay<_.IHighlightEvent>();\n\tprivate _onDidExpandItem = new Relay<Model.IItemExpandEvent>();\n\tprivate _onDidCollapseItem = new Relay<Model.IItemCollapseEvent>();\n\tprivate _onDispose = new Emitter<void>();\n\treadonly onDidDispose: Event<void> = this._onDispose.event;\n\n\tconstructor(container: HTMLElement, configuration: _.ITreeConfiguration, options: _.ITreeOptions = {}) {\n\t\tthis.container = container;\n\t\tmixin(options, defaultStyles, false);\n\n\t\toptions.twistiePixels = typeof options.twistiePixels === 'number' ? options.twistiePixels : 32;\n\t\toptions.showTwistie = options.showTwistie === false ? false : true;\n\t\toptions.indentPixels = typeof options.indentPixels === 'number' ? options.indentPixels : 12;\n\t\toptions.alwaysFocused = options.alwaysFocused === true ? true : false;\n\t\toptions.useShadows = options.useShadows === false ? false : true;\n\t\toptions.paddingOnRow = options.paddingOnRow === false ? false : true;\n\t\toptions.showLoading = options.showLoading === false ? false : true;\n\n\t\tthis.context = new TreeContext(this, configuration, options);\n\t\tthis.model = new Model.TreeModel(this.context);\n\t\tthis.view = new View.TreeView(this.context, this.container);\n\n\t\tthis.view.setModel(this.model);\n\n\t\tthis._onDidChangeFocus.input = this.model.onDidFocus;\n\t\tthis._onDidChangeSelection.input = this.model.onDidSelect;\n\t\tthis._onHighlightChange.input = this.model.onDidHighlight;\n\t\tthis._onDidExpandItem.input = this.model.onDidExpandItem;\n\t\tthis._onDidCollapseItem.input = this.model.onDidCollapseItem;\n\t}\n\n\tpublic style(styles: _.ITreeStyles): void {\n\t\tthis.view.applyStyles(styles);\n\t}\n\n\tget onDidFocus(): Event<void> {\n\t\treturn this.view && this.view.onDOMFocus;\n\t}\n\n\tpublic getHTMLElement(): HTMLElement {\n\t\treturn this.view.getHTMLElement();\n\t}\n\n\tpublic layout(height?: number, width?: number): void {\n\t\tthis.view.layout(height, width);\n\t}\n\n\tpublic domFocus(): void {\n\t\tthis.view.focus();\n\t}\n\n\tpublic isDOMFocused(): boolean {\n\t\treturn this.view.isFocused();\n\t}\n\n\tpublic domBlur(): void {\n\t\tthis.view.blur();\n\t}\n\n\tpublic setInput(element: any): Promise<any> {\n\t\treturn this.model.setInput(element);\n\t}\n\n\tpublic getInput(): any {\n\t\treturn this.model.getInput();\n\t}\n\n\tpublic expand(element: any): Promise<any> {\n\t\treturn this.model.expand(element);\n\t}\n\n\tpublic collapse(element: any, recursive: boolean = false): Promise<any> {\n\t\treturn this.model.collapse(element, recursive);\n\t}\n\n\tpublic toggleExpansion(element: any, recursive: boolean = false): Promise<any> {\n\t\treturn this.model.toggleExpansion(element, recursive);\n\t}\n\n\tpublic isExpanded(element: any): boolean {\n\t\treturn this.model.isExpanded(element);\n\t}\n\n\tpublic reveal(element: any, relativeTop: number | null = null): Promise<any> {\n\t\treturn this.model.reveal(element, relativeTop);\n\t}\n\n\tpublic getHighlight(): any {\n\t\treturn this.model.getHighlight();\n\t}\n\n\tpublic clearHighlight(eventPayload?: any): void {\n\t\tthis.model.setHighlight(null, eventPayload);\n\t}\n\n\tpublic setSelection(elements: any[], eventPayload?: any): void {\n\t\tthis.model.setSelection(elements, eventPayload);\n\t}\n\n\tpublic getSelection(): any[] {\n\t\treturn this.model.getSelection();\n\t}\n\n\tpublic clearSelection(eventPayload?: any): void {\n\t\tthis.model.setSelection([], eventPayload);\n\t}\n\n\tpublic setFocus(element?: any, eventPayload?: any): void {\n\t\tthis.model.setFocus(element, eventPayload);\n\t}\n\n\tpublic getFocus(): any {\n\t\treturn this.model.getFocus();\n\t}\n\n\tpublic focusNext(count?: number, eventPayload?: any): void {\n\t\tthis.model.focusNext(count, eventPayload);\n\t}\n\n\tpublic focusPrevious(count?: number, eventPayload?: any): void {\n\t\tthis.model.focusPrevious(count, eventPayload);\n\t}\n\n\tpublic focusParent(eventPayload?: any): void {\n\t\tthis.model.focusParent(eventPayload);\n\t}\n\n\tpublic focusFirstChild(eventPayload?: any): void {\n\t\tthis.model.focusFirstChild(eventPayload);\n\t}\n\n\tpublic focusFirst(eventPayload?: any, from?: any): void {\n\t\tthis.model.focusFirst(eventPayload, from);\n\t}\n\n\tpublic focusNth(index: number, eventPayload?: any): void {\n\t\tthis.model.focusNth(index, eventPayload);\n\t}\n\n\tpublic focusLast(eventPayload?: any, from?: any): void {\n\t\tthis.model.focusLast(eventPayload, from);\n\t}\n\n\tpublic focusNextPage(eventPayload?: any): void {\n\t\tthis.view.focusNextPage(eventPayload);\n\t}\n\n\tpublic focusPreviousPage(eventPayload?: any): void {\n\t\tthis.view.focusPreviousPage(eventPayload);\n\t}\n\n\tpublic clearFocus(eventPayload?: any): void {\n\t\tthis.model.setFocus(null, eventPayload);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._onDispose.fire();\n\n\t\tif (this.model !== null) {\n\t\t\tthis.model.dispose();\n\t\t\tthis.model = null!; // StrictNullOverride Nulling out ok in dispose\n\t\t}\n\t\tif (this.view !== null) {\n\t\t\tthis.view.dispose();\n\t\t\tthis.view = null!; // StrictNullOverride Nulling out ok in dispose\n\t\t}\n\n\t\tthis._onDidChangeFocus.dispose();\n\t\tthis._onDidChangeSelection.dispose();\n\t\tthis._onHighlightChange.dispose();\n\t\tthis._onDidExpandItem.dispose();\n\t\tthis._onDidCollapseItem.dispose();\n\t\tthis._onDispose.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 { 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\tregularDomNode.style.fontFamily = this._bareFontInfo.getMassagedFontFamily();\n\t\tregularDomNode.style.fontWeight = this._bareFontInfo.fontWeight;\n\t\tregularDomNode.style.fontSize = this._bareFontInfo.fontSize + 'px';\n\t\tregularDomNode.style.lineHeight = this._bareFontInfo.lineHeight + 'px';\n\t\tregularDomNode.style.letterSpacing = this._bareFontInfo.letterSpacing + 'px';\n\t\tcontainer.appendChild(regularDomNode);\n\n\t\tconst boldDomNode = document.createElement('div');\n\t\tboldDomNode.style.fontFamily = this._bareFontInfo.getMassagedFontFamily();\n\t\tboldDomNode.style.fontWeight = 'bold';\n\t\tboldDomNode.style.fontSize = this._bareFontInfo.fontSize + 'px';\n\t\tboldDomNode.style.lineHeight = this._bareFontInfo.lineHeight + 'px';\n\t\tboldDomNode.style.letterSpacing = this._bareFontInfo.letterSpacing + 'px';\n\t\tcontainer.appendChild(boldDomNode);\n\n\t\tconst italicDomNode = document.createElement('div');\n\t\titalicDomNode.style.fontFamily = this._bareFontInfo.getMassagedFontFamily();\n\t\titalicDomNode.style.fontWeight = this._bareFontInfo.fontWeight;\n\t\titalicDomNode.style.fontSize = this._bareFontInfo.fontSize + 'px';\n\t\titalicDomNode.style.lineHeight = this._bareFontInfo.lineHeight + 'px';\n\t\titalicDomNode.style.letterSpacing = this._bareFontInfo.letterSpacing + 'px';\n\t\titalicDomNode.style.fontStyle = 'italic';\n\t\tcontainer.appendChild(italicDomNode);\n\n\t\tconst testElements: HTMLSpanElement[] = [];\n\t\tfor (let i = 0, len = this._requests.length; i < len; i++) {\n\t\t\tconst request = this._requests[i];\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[i] = 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 = ' ';\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.innerHTML = 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 { Disposable } from 'vs/base/common/lifecycle';\nimport { IDimension } from 'vs/editor/common/editorCommon';\n\nexport class ElementSizeObserver extends Disposable {\n\n\tprivate readonly referenceDomElement: HTMLElement | null;\n\tprivate measureReferenceDomElementToken: any;\n\tprivate readonly changeCallback: () => void;\n\tprivate width: number;\n\tprivate height: number;\n\n\tconstructor(referenceDomElement: HTMLElement | null, changeCallback: () => void) {\n\t\tsuper();\n\t\tthis.referenceDomElement = referenceDomElement;\n\t\tthis.changeCallback = changeCallback;\n\t\tthis.measureReferenceDomElementToken = -1;\n\t\tthis.width = -1;\n\t\tthis.height = -1;\n\t\tthis.measureReferenceDomElement(false);\n\t}\n\n\tpublic 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.measureReferenceDomElementToken === -1) {\n\t\t\tthis.measureReferenceDomElementToken = setInterval(() => this.measureReferenceDomElement(true), 100);\n\t\t}\n\t}\n\n\tpublic stopObserving(): void {\n\t\tif (this.measureReferenceDomElementToken !== -1) {\n\t\t\tclearInterval(this.measureReferenceDomElementToken);\n\t\t\tthis.measureReferenceDomElementToken = -1;\n\t\t}\n\t}\n\n\tpublic observe(dimension?: IDimension): void {\n\t\tthis.measureReferenceDomElement(true, dimension);\n\t}\n\n\tprivate measureReferenceDomElement(callChangeCallback: 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 (callChangeCallback) {\n\t\t\t\tthis.changeCallback();\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 { ICodeEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ITextModel } from 'vs/editor/common/model';\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}\n\t\tif ((this.flags & CodeEditorStateFlag.Position) !== 0) {\n\t\t\tthis.position = editor.getPosition();\n\t\t}\n\t\tif ((this.flags & CodeEditorStateFlag.Selection) !== 0) {\n\t\t\tthis.selection = editor.getSelection();\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}\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 */\nexport class EditorStateCancellationTokenSource extends CancellationTokenSource {\n\n\tprivate readonly _listener: IDisposable[] = [];\n\n\tconstructor(readonly editor: IActiveCodeEditor, flags: CodeEditorStateFlag, parent?: CancellationToken) {\n\t\tsuper(parent);\n\n\t\tif (flags & CodeEditorStateFlag.Position) {\n\t\t\tthis._listener.push(editor.onDidChangeCursorPosition(_ => this.cancel()));\n\t\t}\n\t\tif (flags & CodeEditorStateFlag.Selection) {\n\t\t\tthis._listener.push(editor.onDidChangeCursorSelection(_ => this.cancel()));\n\t\t}\n\t\tif (flags & CodeEditorStateFlag.Scroll) {\n\t\t\tthis._listener.push(editor.onDidScrollChange(_ => this.cancel()));\n\t\t}\n\t\tif (flags & CodeEditorStateFlag.Value) {\n\t\t\tthis._listener.push(editor.onDidChangeModel(_ => this.cancel()));\n\t\t\tthis._listener.push(editor.onDidChangeModelContent(_ => this.cancel()));\n\t\t}\n\t}\n\n\tdispose() {\n\t\tdispose(this._listener);\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 {\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\tdispose() {\n\t\tthis._listener.dispose();\n\t\tsuper.dispose();\n\t}\n}\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);\n\t}\n\n\tconstructor(\n\t\tprivate readonly _visiblePosition: Position | null,\n\t\tprivate readonly _visiblePositionScrollDelta: number\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Disposable, IDisposable } from 'vs/base/common/lifecycle';\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;\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;\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;\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\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 class EditorMouseEvent extends StandardMouseEvent {\n\t_editorMouseEventBrand: void;\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\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}\n}\n\nexport interface EditorMouseEventMerger {\n\t(lastEvent: EditorMouseEvent, 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, 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 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(merger: EditorMouseEventMerger, mouseMoveCallback: (e: EditorMouseEvent) => void, onStopCallback: () => void): 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);\n\t\t}, true);\n\n\t\tconst myMerger: dom.IEventMerger<EditorMouseEvent, MouseEvent> = (lastEvent: EditorMouseEvent, currentEvent: MouseEvent): EditorMouseEvent => {\n\t\t\treturn merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode));\n\t\t};\n\n\t\tthis._globalMouseMoveMonitor.startMonitoring(myMerger, mouseMoveCallback, () => {\n\t\t\tthis._keydownListener!.dispose();\n\t\t\tonStopCallback();\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 { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { IDecorationRenderOptions } from 'vs/editor/common/editorCommon';\nimport { IModelDecorationOptions } from 'vs/editor/common/model';\nimport { IResourceInput } from 'vs/platform/editor/common/editor';\n\nexport abstract class AbstractCodeEditorService extends Disposable implements ICodeEditorService {\n\n\t_serviceBrand: any;\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\n\tprivate readonly _onDiffEditorAdd: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\n\tprivate readonly _onDiffEditorRemove: Emitter<IDiffEditor> = this._register(new Emitter<IDiffEditor>());\n\n\n\tprivate readonly _codeEditors: { [editorId: string]: ICodeEditor; };\n\tprivate readonly _diffEditors: { [editorId: string]: IDiffEditor; };\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._codeEditors = Object.create(null);\n\t\tthis._diffEditors = Object.create(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\tabstract registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void;\n\tabstract removeDecorationType(key: string): void;\n\tabstract resolveDecorationOptions(decorationTypeKey: string | undefined, writable: boolean): IModelDecorationOptions;\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\tabstract openCodeEditor(input: IResourceInput, 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 { 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\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 postion 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\tlet aLineNumber = a.lineNumber | 0;\n\t\tlet bLineNumber = b.lineNumber | 0;\n\n\t\tif (aLineNumber === bLineNumber) {\n\t\t\tlet aColumn = a.column | 0;\n\t\t\tlet 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 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 * 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 new Position(this.endLineNumber, this.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 new Position(this.startLineNumber, this.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\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 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\treplaceCharCnt: 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\t// console.log(Date.now() + ': writeToTextArea ' + reason + ': ' + this.toString());\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 selectedText(text: string): TextAreaState {\n\t\treturn new TextAreaState(text, 0, text.length, null, null);\n\t}\n\n\tpublic static deduceInput(previousState: TextAreaState, currentState: TextAreaState, couldBeEmojiInput: boolean, couldBeTypingAtOffset0: 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\treplaceCharCnt: 0\n\t\t\t};\n\t\t}\n\n\t\t// console.log('------------------------deduceInput');\n\t\t// console.log('PREVIOUS STATE: ' + previousState.toString());\n\t\t// console.log('CURRENT STATE: ' + currentState.toString());\n\n\t\tlet previousValue = previousState.value;\n\t\tlet previousSelectionStart = previousState.selectionStart;\n\t\tlet previousSelectionEnd = previousState.selectionEnd;\n\t\tlet currentValue = currentState.value;\n\t\tlet currentSelectionStart = currentState.selectionStart;\n\t\tlet currentSelectionEnd = currentState.selectionEnd;\n\n\t\tif (couldBeTypingAtOffset0 && previousValue.length > 0 && previousSelectionStart === previousSelectionEnd && currentSelectionStart === currentSelectionEnd) {\n\t\t\t// See https://github.com/Microsoft/vscode/issues/42251\n\t\t\t// where typing always happens at offset 0 in the textarea\n\t\t\t// when using a custom title area in OSX and moving the window\n\t\t\tif (!strings.startsWith(currentValue, previousValue) && strings.endsWith(currentValue, previousValue)) {\n\t\t\t\t// Looks like something was typed at offset 0\n\t\t\t\t// ==> pretend we placed the cursor at offset 0 to begin with...\n\t\t\t\tpreviousSelectionStart = 0;\n\t\t\t\tpreviousSelectionEnd = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Strip the previous suffix from the value (without interfering with the current selection)\n\t\tconst previousSuffix = previousValue.substring(previousSelectionEnd);\n\t\tconst currentSuffix = currentValue.substring(currentSelectionEnd);\n\t\tconst suffixLength = strings.commonSuffixLength(previousSuffix, currentSuffix);\n\t\tcurrentValue = currentValue.substring(0, currentValue.length - suffixLength);\n\t\tpreviousValue = previousValue.substring(0, previousValue.length - suffixLength);\n\n\t\tconst previousPrefix = previousValue.substring(0, previousSelectionStart);\n\t\tconst currentPrefix = currentValue.substring(0, currentSelectionStart);\n\t\tconst prefixLength = strings.commonPrefixLength(previousPrefix, currentPrefix);\n\t\tcurrentValue = currentValue.substring(prefixLength);\n\t\tpreviousValue = previousValue.substring(prefixLength);\n\t\tcurrentSelectionStart -= prefixLength;\n\t\tpreviousSelectionStart -= prefixLength;\n\t\tcurrentSelectionEnd -= prefixLength;\n\t\tpreviousSelectionEnd -= prefixLength;\n\n\t\t// console.log('AFTER DIFFING PREVIOUS STATE: <' + previousValue + '>, selectionStart: ' + previousSelectionStart + ', selectionEnd: ' + previousSelectionEnd);\n\t\t// console.log('AFTER DIFFING CURRENT STATE: <' + currentValue + '>, selectionStart: ' + currentSelectionStart + ', selectionEnd: ' + currentSelectionEnd);\n\n\t\tif (couldBeEmojiInput && currentSelectionStart === currentSelectionEnd && previousValue.length > 0) {\n\t\t\t// on OSX, emojis from the emoji picker are inserted at random locations\n\t\t\t// the only hints we can use is that the selection is immediately after the inserted emoji\n\t\t\t// and that none of the old text has been deleted\n\n\t\t\tlet potentialEmojiInput: string | null = null;\n\n\t\t\tif (currentSelectionStart === currentValue.length) {\n\t\t\t\t// emoji potentially inserted \"somewhere\" after the previous selection => it should appear at the end of `currentValue`\n\t\t\t\tif (strings.startsWith(currentValue, previousValue)) {\n\t\t\t\t\t// only if all of the old text is accounted for\n\t\t\t\t\tpotentialEmojiInput = currentValue.substring(previousValue.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// emoji potentially inserted \"somewhere\" before the previous selection => it should appear at the start of `currentValue`\n\t\t\t\tif (strings.endsWith(currentValue, previousValue)) {\n\t\t\t\t\t// only if all of the old text is accounted for\n\t\t\t\t\tpotentialEmojiInput = currentValue.substring(0, currentValue.length - previousValue.length);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (potentialEmojiInput !== null && potentialEmojiInput.length > 0) {\n\t\t\t\t// now we check that this is indeed an emoji\n\t\t\t\t// emojis can grow quite long, so a length check is of no help\n\t\t\t\t// e.g. 1F3F4 E0067 E0062 E0065 E006E E0067 E007F ; fully-qualified # 🏴 England\n\n\t\t\t\t// Oftentimes, emojis use Variation Selector-16 (U+FE0F), so that is a good hint\n\t\t\t\t// http://emojipedia.org/variation-selector-16/\n\t\t\t\t// > An invisible codepoint which specifies that the preceding character\n\t\t\t\t// > should be displayed with emoji presentation. Only required if the\n\t\t\t\t// > preceding character defaults to text presentation.\n\t\t\t\tif (/\\uFE0F/.test(potentialEmojiInput) || strings.containsEmoji(potentialEmojiInput)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: potentialEmojiInput,\n\t\t\t\t\t\treplaceCharCnt: 0\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (currentSelectionStart === currentSelectionEnd) {\n\t\t\t// composition accept case (noticed in FF + Japanese)\n\t\t\t// [blahblah] => blahblah|\n\t\t\tif (\n\t\t\t\tpreviousValue === currentValue\n\t\t\t\t&& previousSelectionStart === 0\n\t\t\t\t&& previousSelectionEnd === previousValue.length\n\t\t\t\t&& currentSelectionStart === currentValue.length\n\t\t\t\t&& currentValue.indexOf('\\n') === -1\n\t\t\t) {\n\t\t\t\tif (strings.containsFullWidthCharacter(currentValue)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: '',\n\t\t\t\t\t\treplaceCharCnt: 0\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// no current selection\n\t\t\tconst replacePreviousCharacters = (previousPrefix.length - prefixLength);\n\t\t\t// console.log('REMOVE PREVIOUS: ' + (previousPrefix.length - prefixLength) + ' chars');\n\n\t\t\treturn {\n\t\t\t\ttext: currentValue,\n\t\t\t\treplaceCharCnt: replacePreviousCharacters\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\treplaceCharCnt: replacePreviousCharacters\n\t\t};\n\t}\n}\n\nexport class PagedScreenReaderStrategy {\n\tprivate static readonly _LINES_PER_PAGE = 10;\n\n\tprivate static _getPageOfLine(lineNumber: number): number {\n\t\treturn Math.floor((lineNumber - 1) / PagedScreenReaderStrategy._LINES_PER_PAGE);\n\t}\n\n\tprivate static _getRangeForPage(page: number): Range {\n\t\tconst offset = page * PagedScreenReaderStrategy._LINES_PER_PAGE;\n\t\tconst startLineNumber = offset + 1;\n\t\tconst endLineNumber = offset + PagedScreenReaderStrategy._LINES_PER_PAGE;\n\t\treturn new Range(startLineNumber, 1, endLineNumber + 1, 1);\n\t}\n\n\tpublic static fromEditorSelection(previousState: TextAreaState, model: ISimpleModel, selection: Range, trimLongText: boolean): TextAreaState {\n\n\t\tconst selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber);\n\t\tconst selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage);\n\n\t\tconst selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber);\n\t\tconst selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage);\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 { IDisposable, dispose } 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/controller/cursorEvents';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ILineChange, 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\n/**\n * Create a new diff navigator for the provided diff editor.\n */\nexport class DiffNavigator {\n\n\tprivate readonly _editor: IDiffEditor;\n\tprivate readonly _options: Options;\n\tprivate readonly _disposables: IDisposable[];\n\tprivate readonly _onDidUpdate = 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\tthis._editor = editor;\n\t\tthis._options = objects.mixin(options, defaultOptions, false);\n\n\t\tthis.disposed = false;\n\t\tthis._disposables = [];\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._disposables.push(this._editor.onDidDispose(() => this.dispose()));\n\t\tthis._disposables.push(this._editor.onDidUpdateDiff(() => this._onDiffUpdated()));\n\n\t\tif (this._options.followsCaret) {\n\t\t\tthis._disposables.push(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._disposables.push(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\tlet 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\tthis.ranges.push({\n\t\t\t\t\t\trhs: true,\n\t\t\t\t\t\trange: new Range(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedStartLineNumber, 1)\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) => {\n\t\t\tif (left.range.getStartPosition().isBeforeOrEqual(right.range.getStartPosition())) {\n\t\t\t\treturn -1;\n\t\t\t} else if (right.range.getStartPosition().isBeforeOrEqual(left.range.getStartPosition())) {\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\t\tthis._onDidUpdate.fire(this);\n\t}\n\n\tprivate _initIdx(fwd: boolean): void {\n\t\tlet found = false;\n\t\tlet 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\tlet 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\tlet info = this.ranges[this.nextIdx];\n\t\tthis.ignoreSelectionChange = true;\n\t\ttry {\n\t\t\tlet pos = info.range.getStartPosition();\n\t\t\tthis._editor.setPosition(pos);\n\t\t\tthis._editor.revealPositionInCenter(pos, 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\tdispose(): void {\n\t\tdispose(this._disposables);\n\t\tthis._disposables.length = 0;\n\t\tthis._onDidUpdate.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 { Range } from 'vs/editor/common/core/range';\nimport { IIdentifiedSingleEditOperation } from 'vs/editor/common/model';\n\nexport class EditOperation {\n\n\tpublic static insert(position: Position, text: string): IIdentifiedSingleEditOperation {\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): IIdentifiedSingleEditOperation {\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): IIdentifiedSingleEditOperation {\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): IIdentifiedSingleEditOperation {\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 } 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 { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model';\n\nexport class TrimTrailingWhitespaceCommand implements ICommand {\n\n\tprivate readonly selection: Selection;\n\tprivate selectionId: string;\n\tprivate readonly cursors: Position[];\n\n\tconstructor(selection: Selection, cursors: Position[]) {\n\t\tthis.selection = selection;\n\t\tthis.cursors = cursors;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tlet ops = trimTrailingWhitespace(model, this.cursors);\n\t\tfor (let i = 0, len = ops.length; i < len; i++) {\n\t\t\tlet 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[]): IIdentifiedSingleEditOperation[] {\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\tlet r: IIdentifiedSingleEditOperation[] = [];\n\tlet rLen = 0;\n\tlet cursorIndex = 0;\n\tlet cursorLen = cursors.length;\n\n\tfor (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) {\n\t\tlet lineContent = model.getLineContent(lineNumber);\n\t\tlet 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\tlet 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;\n\n\tstatic 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\tprivate 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 * Clone this selection.\n\t */\n\tpublic clone(): Selection {\n\t\treturn new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn);\n\t}\n\n\t/**\n\t * Transform to a human-readable representation.\n\t */\n\tpublic 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 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 * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\n\t */\n\tpublic 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 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 * 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 { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { IKeyboardEvent } 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 * as platform from 'vs/base/common/platform';\nimport * as strings from 'vs/base/common/strings';\nimport { ITextAreaWrapper, ITypeData, TextAreaState } from 'vs/editor/browser/controller/textAreaState';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\n\nexport interface ICompositionData {\n\tdata: string;\n}\n\nexport const CopyOptions = {\n\tforceCopyWithSyntaxHighlighting: false\n};\n\nconst enum ReadFromTextArea {\n\tType,\n\tPaste\n}\n\nexport interface IPasteData {\n\ttext: string;\n}\n\nexport interface ITextAreaInputHost {\n\tgetPlainTextToCopy(): string;\n\tgetHTMLToCopy(): string | null;\n\tgetScreenReaderContent(currentState: TextAreaState): TextAreaState;\n\tdeduceModelPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n}\n\nconst enum TextAreaInputEventType {\n\tnone,\n\tcompositionstart,\n\tcompositionupdate,\n\tcompositionend,\n\tinput,\n\tcut,\n\tcopy,\n\tpaste,\n\tfocus,\n\tblur\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<void>());\n\tpublic readonly onCompositionStart: Event<void> = 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 _host: ITextAreaInputHost;\n\tprivate readonly _textArea: TextAreaWrapper;\n\tprivate _lastTextAreaEvent: TextAreaInputEventType;\n\tprivate readonly _asyncTriggerCut: RunOnceScheduler;\n\n\tprivate _textAreaState: TextAreaState;\n\tprivate _selectionChangeListener: IDisposable | null;\n\n\tprivate _hasFocus: boolean;\n\tprivate _isDoingComposition: boolean;\n\tprivate _nextCommand: ReadFromTextArea;\n\n\tconstructor(host: ITextAreaInputHost, textArea: FastDomNode<HTMLTextAreaElement>) {\n\t\tsuper();\n\t\tthis._host = host;\n\t\tthis._textArea = this._register(new TextAreaWrapper(textArea));\n\t\tthis._lastTextAreaEvent = TextAreaInputEventType.none;\n\t\tthis._asyncTriggerCut = this._register(new RunOnceScheduler(() => this._onCut.fire(), 0));\n\n\t\tthis._textAreaState = TextAreaState.EMPTY;\n\t\tthis.writeScreenReaderContent('ctor');\n\n\t\tthis._hasFocus = false;\n\t\tthis._isDoingComposition = false;\n\t\tthis._nextCommand = ReadFromTextArea.Type;\n\n\t\tthis._register(dom.addStandardDisposableListener(textArea.domNode, 'keydown', (e: IKeyboardEvent) => {\n\t\t\tif (this._isDoingComposition &&\n\t\t\t\t(e.keyCode === KeyCode.KEY_IN_COMPOSITION || 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\t\t\tthis._onKeyDown.fire(e);\n\t\t}));\n\n\t\tthis._register(dom.addStandardDisposableListener(textArea.domNode, 'keyup', (e: IKeyboardEvent) => {\n\t\t\tthis._onKeyUp.fire(e);\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'compositionstart', (e: CompositionEvent) => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.compositionstart;\n\n\t\t\tif (this._isDoingComposition) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isDoingComposition = true;\n\n\t\t\t// In IE we cannot set .value when handling 'compositionstart' because the entire composition will get canceled.\n\t\t\tif (!browser.isEdgeOrIE) {\n\t\t\t\tthis._setAndWriteTextAreaState('compositionstart', TextAreaState.EMPTY);\n\t\t\t}\n\n\t\t\tthis._onCompositionStart.fire();\n\t\t}));\n\n\t\t/**\n\t\t * Deduce the typed input from a text area's value and the last observed state.\n\t\t */\n\t\tconst deduceInputFromTextAreaValue = (couldBeEmojiInput: boolean, couldBeTypingAtOffset0: boolean): [TextAreaState, ITypeData] => {\n\t\t\tconst oldState = this._textAreaState;\n\t\t\tconst newState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\treturn [newState, TextAreaState.deduceInput(oldState, newState, couldBeEmojiInput, couldBeTypingAtOffset0)];\n\t\t};\n\n\t\t/**\n\t\t * Deduce the composition input from a string.\n\t\t */\n\t\tconst deduceComposition = (text: string): [TextAreaState, ITypeData] => {\n\t\t\tconst oldState = this._textAreaState;\n\t\t\tconst newState = TextAreaState.selectedText(text);\n\t\t\tconst typeInput: ITypeData = {\n\t\t\t\ttext: newState.value,\n\t\t\t\treplaceCharCnt: oldState.selectionEnd - oldState.selectionStart\n\t\t\t};\n\t\t\treturn [newState, typeInput];\n\t\t};\n\n\t\tconst compositionDataInValid = (locale: string): boolean => {\n\t\t\t// https://github.com/Microsoft/monaco-editor/issues/339\n\t\t\t// Multi-part Japanese compositions reset cursor in Edge/IE, Chinese and Korean IME don't have this issue.\n\t\t\t// The reason that we can't use this path for all CJK IME is IE and Edge behave differently when handling Korean IME,\n\t\t\t// which breaks this path of code.\n\t\t\tif (browser.isEdgeOrIE && locale === 'ja') {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// https://github.com/Microsoft/monaco-editor/issues/545\n\t\t\t// On IE11, we can't trust composition data when typing Chinese as IE11 doesn't emit correct\n\t\t\t// events when users type numbers in IME.\n\t\t\t// Chinese: zh-Hans-CN, zh-Hans-SG, zh-Hant-TW, zh-Hant-HK\n\t\t\tif (browser.isIE && locale.indexOf('zh-Han') === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'compositionupdate', (e: CompositionEvent) => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.compositionupdate;\n\n\t\t\tif (compositionDataInValid(e.locale)) {\n\t\t\t\tconst [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/false, /*couldBeTypingAtOffset0*/false);\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\n\t\t\tconst [newState, typeInput] = deduceComposition(e.data);\n\t\t\tthis._textAreaState = newState;\n\t\t\tthis._onType.fire(typeInput);\n\t\t\tthis._onCompositionUpdate.fire(e);\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'compositionend', (e: CompositionEvent) => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.compositionend;\n\n\t\t\tif (compositionDataInValid(e.locale)) {\n\t\t\t\t// https://github.com/Microsoft/monaco-editor/issues/339\n\t\t\t\tconst [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/false, /*couldBeTypingAtOffset0*/false);\n\t\t\t\tthis._textAreaState = newState;\n\t\t\t\tthis._onType.fire(typeInput);\n\t\t\t} else {\n\t\t\t\tconst [newState, typeInput] = deduceComposition(e.data);\n\t\t\t\tthis._textAreaState = newState;\n\t\t\t\tthis._onType.fire(typeInput);\n\t\t\t}\n\n\t\t\t// Due to isEdgeOrIE (where the textarea was not cleared initially) and isChrome (the textarea is not updated correctly when composition ends)\n\t\t\t// we cannot assume the text at the end consists only of the composited text\n\t\t\tif (browser.isEdgeOrIE || browser.isChrome) {\n\t\t\t\tthis._textAreaState = TextAreaState.readFromTextArea(this._textArea);\n\t\t\t}\n\n\t\t\tif (!this._isDoingComposition) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isDoingComposition = false;\n\n\t\t\tthis._onCompositionEnd.fire();\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'input', () => {\n\t\t\t// We want to find out if this is the first `input` after a `focus`.\n\t\t\tconst previousEventWasFocus = (this._lastTextAreaEvent === TextAreaInputEventType.focus);\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.input;\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._isDoingComposition) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/platform.isMacintosh, /*couldBeTypingAtOffset0*/previousEventWasFocus && platform.isMacintosh);\n\t\t\tif (typeInput.replaceCharCnt === 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 (this._nextCommand === ReadFromTextArea.Type) {\n\t\t\t\tif (typeInput.text !== '') {\n\t\t\t\t\tthis._onType.fire(typeInput);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeInput.text !== '') {\n\t\t\t\t\tthis._onPaste.fire({\n\t\t\t\t\t\ttext: typeInput.text\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._nextCommand = ReadFromTextArea.Type;\n\t\t\t}\n\t\t}));\n\n\t\t// --- Clipboard operations\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'cut', (e: ClipboardEvent) => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.cut;\n\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(dom.addDisposableListener(textArea.domNode, 'copy', (e: ClipboardEvent) => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.copy;\n\n\t\t\tthis._ensureClipboardGetsEditorSelection(e);\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'paste', (e: ClipboardEvent) => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.paste;\n\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\tif (ClipboardEventUtils.canUseTextData(e)) {\n\t\t\t\tconst pastePlainText = ClipboardEventUtils.getTextData(e);\n\t\t\t\tif (pastePlainText !== '') {\n\t\t\t\t\tthis._onPaste.fire({\n\t\t\t\t\t\ttext: pastePlainText\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._textArea.getSelectionStart() !== this._textArea.getSelectionEnd()) {\n\t\t\t\t\t// Clean up the textarea, to get a clean paste\n\t\t\t\t\tthis._setAndWriteTextAreaState('paste', TextAreaState.EMPTY);\n\t\t\t\t}\n\t\t\t\tthis._nextCommand = ReadFromTextArea.Paste;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'focus', () => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.focus;\n\t\t\tthis._setHasFocus(true);\n\t\t}));\n\t\tthis._register(dom.addDisposableListener(textArea.domNode, 'blur', () => {\n\t\t\tthis._lastTextAreaEvent = TextAreaInputEventType.blur;\n\t\t\tthis._setHasFocus(false);\n\t\t}));\n\t}\n\n\tprivate _installSelectionChangeListener(): IDisposable {\n\t\t// See https://github.com/Microsoft/vscode/issues/27216\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._isDoingComposition) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!browser.isChrome || !platform.isWindows) {\n\t\t\t\t// Support only for Chrome on Windows until testing happens on other browsers + OS configurations\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 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\t}\n\n\tpublic isFocused(): boolean {\n\t\treturn this._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\tif (browser.isEdge) {\n\t\t\t\t// Edge has a bug where setting the selection range while the focus event\n\t\t\t\t// is dispatching doesn't work. To reproduce, \"tab into\" the editor.\n\t\t\t\tthis._setAndWriteTextAreaState('focusgain', TextAreaState.EMPTY);\n\t\t\t} else {\n\t\t\t\tthis.writeScreenReaderContent('focusgain');\n\t\t\t}\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._isDoingComposition) {\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 copyPlainText = this._host.getPlainTextToCopy();\n\t\tif (!ClipboardEventUtils.canUseTextData(e)) {\n\t\t\t// Looks like an old browser. The strategy is to place the text\n\t\t\t// we'd like to be copied to the clipboard in the textarea and select it.\n\t\t\tthis._setAndWriteTextAreaState('copy or cut', TextAreaState.selectedText(copyPlainText));\n\t\t\treturn;\n\t\t}\n\n\t\tlet copyHTML: string | null = null;\n\t\tif (browser.hasClipboardSupport() && (copyPlainText.length < 65536 || CopyOptions.forceCopyWithSyntaxHighlighting)) {\n\t\t\tcopyHTML = this._host.getHTMLToCopy();\n\t\t}\n\t\tClipboardEventUtils.setTextData(e, copyPlainText, copyHTML);\n\t}\n}\n\nclass ClipboardEventUtils {\n\n\tpublic static canUseTextData(e: ClipboardEvent): boolean {\n\t\tif (e.clipboardData) {\n\t\t\treturn true;\n\t\t}\n\t\tif ((<any>window).clipboardData) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic static getTextData(e: ClipboardEvent): string {\n\t\tif (e.clipboardData) {\n\t\t\te.preventDefault();\n\t\t\treturn e.clipboardData.getData('text/plain');\n\t\t}\n\n\t\tif ((<any>window).clipboardData) {\n\t\t\te.preventDefault();\n\t\t\treturn (<any>window).clipboardData.getData('Text');\n\t\t}\n\n\t\tthrow new Error('ClipboardEventUtils.getTextData: Cannot use text data!');\n\t}\n\n\tpublic static setTextData(e: ClipboardEvent, text: string, richText: string | null): void {\n\t\tif (e.clipboardData) {\n\t\t\te.clipboardData.setData('text/plain', text);\n\t\t\tif (richText !== null) {\n\t\t\t\te.clipboardData.setData('text/html', richText);\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif ((<any>window).clipboardData) {\n\t\t\t(<any>window).clipboardData.setData('Text', text);\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthrow new Error('ClipboardEventUtils.setTextData: Cannot use text data!');\n\t}\n}\n\nclass TextAreaWrapper extends Disposable implements ITextAreaWrapper {\n\n\tprivate readonly _actual: FastDomNode<HTMLTextAreaElement>;\n\tprivate _ignoreSelectionChangeTime: number;\n\n\tconstructor(_textArea: FastDomNode<HTMLTextAreaElement>) {\n\t\tsuper();\n\t\tthis._actual = _textArea;\n\t\tthis._ignoreSelectionChangeTime = 0;\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.domNode.value;\n\t}\n\n\tpublic setValue(reason: string, value: string): void {\n\t\tconst textArea = this._actual.domNode;\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.domNode.selectionStart;\n\t}\n\n\tpublic getSelectionEnd(): number {\n\t\treturn this._actual.domNode.selectionEnd;\n\t}\n\n\tpublic setSelectionRange(reason: string, selectionStart: number, selectionEnd: number): void {\n\t\tconst textArea = this._actual.domNode;\n\n\t\tconst currentIsFocused = (document.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 } 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\tlet inverseEditOperations = helper.getInverseEditOperations();\n\t\tlet srcRange = inverseEditOperations[0].range;\n\t\treturn new Selection(\n\t\t\tsrcRange.endLineNumber,\n\t\t\tsrcRange.endColumn,\n\t\t\tsrcRange.endLineNumber,\n\t\t\tsrcRange.endColumn\n\t\t);\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\tlet inverseEditOperations = helper.getInverseEditOperations();\n\t\tlet srcRange = inverseEditOperations[0].range;\n\t\treturn new Selection(\n\t\t\tsrcRange.startLineNumber,\n\t\t\tsrcRange.startColumn,\n\t\t\tsrcRange.startLineNumber,\n\t\t\tsrcRange.startColumn\n\t\t);\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\tlet inverseEditOperations = helper.getInverseEditOperations();\n\t\tlet srcRange = inverseEditOperations[0].range;\n\t\treturn new Selection(\n\t\t\tsrcRange.endLineNumber + this._lineNumberDeltaOffset,\n\t\t\tsrcRange.endColumn + this._columnDeltaOffset,\n\t\t\tsrcRange.endLineNumber + this._lineNumberDeltaOffset,\n\t\t\tsrcRange.endColumn + this._columnDeltaOffset\n\t\t);\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 _selectionId: string;\n\n\tconstructor(editRange: Range, text: string, initialSelection: Selection) {\n\t\tthis._range = editRange;\n\t\tthis._text = text;\n\t\tthis._initialSelection = initialSelection;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {\n\t\tbuilder.addEditOperation(this._range, this._text);\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\tlet inverseEditOperations = helper.getInverseEditOperations();\n\t\tlet firstOperationRange = inverseEditOperations[0].range;\n\t\tlet 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';\n\ndeclare var TextDecoder: any; // TODO@TypeScript\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\nexport let createStringBuilder: (capacity: number) => IStringBuilder;\n\nif (typeof TextDecoder !== 'undefined') {\n\tcreateStringBuilder = (capacity) => new StringBuilder(capacity);\n} else {\n\tcreateStringBuilder = (capacity) => new CompatStringBuilder();\n}\n\nclass StringBuilder implements IStringBuilder {\n\n\tprivate readonly _decoder: TextDecoder;\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._decoder = new TextDecoder('UTF-16LE');\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 this._decoder.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/view/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\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\treturn e.layoutInfo;\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\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, wasNew: boolean[]): void {\n\t\tconst lastChild = <HTMLElement>this.domNode.lastChild;\n\t\tif (domNodeIsEmpty || !lastChild) {\n\t\t\tthis.domNode.innerHTML = newLinesHTML;\n\t\t} else {\n\t\t\tlastChild.insertAdjacentHTML('afterend', newLinesHTML);\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, wasInvalid: boolean[]): void {\n\t\tconst hugeDomNode = document.createElement('div');\n\n\t\thugeDomNode.innerHTML = invalidLinesHTML;\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 { IState } from 'vs/editor/common/modes';\n\nexport class Token {\n\t_tokenBrand: void;\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 | 0;// @perf\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\nexport class TokenizationResult {\n\t_tokenizationResultBrand: void;\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\nexport class TokenizationResult2 {\n\t_tokenizationResult2Brand: void;\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 * Copyright (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 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\tlet 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 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\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\nexport function toUint32Array(arr: number[]): Uint32Array {\n\tlet len = arr.length;\n\tlet r = new Uint32Array(len);\n\tfor (let i = 0; i < len; i++) {\n\t\tr[i] = toUint32(arr[i]);\n\t}\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 { toUint8 } from 'vs/editor/common/core/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\tprivate _asciiMap: Uint8Array;\n\n\t/**\n\t * The entire map (sparse array).\n\t */\n\tprivate _map: Map<number, number>;\n\n\tprivate _defaultValue: number;\n\n\tconstructor(_defaultValue: T) {\n\t\tlet 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\tlet 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\tlet 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 { 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\tlet 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\nimport { IDiffChange, ISequence, LcsDiff } from 'vs/base/common/diff/diff';\nimport * as strings from 'vs/base/common/strings';\nimport { ICharChange, ILineChange } from 'vs/editor/common/editorCommon';\n\nconst MAXIMUM_RUN_TIME = 5000; // 5 seconds\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\n\nfunction computeDiff(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: () => boolean, pretty: boolean): IDiffChange[] {\n\tconst diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\n\treturn diffAlgo.ComputeDiff(pretty);\n}\n\nclass LineMarkerSequence implements ISequence {\n\n\tprivate readonly _lines: string[];\n\tprivate readonly _startColumns: number[];\n\tprivate readonly _endColumns: number[];\n\n\tconstructor(lines: string[]) {\n\t\tlet startColumns: number[] = [];\n\t\tlet endColumns: number[] = [];\n\t\tfor (let i = 0, length = lines.length; i < length; i++) {\n\t\t\tstartColumns[i] = LineMarkerSequence._getFirstNonBlankColumn(lines[i], 1);\n\t\t\tendColumns[i] = LineMarkerSequence._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 getLength(): number {\n\t\treturn this._lines.length;\n\t}\n\n\tpublic getElementAtIndex(i: number): string {\n\t\treturn this._lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);\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 static _getFirstNonBlankColumn(txt: string, defaultValue: number): number {\n\t\tconst r = strings.firstNonWhitespaceIndex(txt);\n\t\tif (r === -1) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn r + 1;\n\t}\n\n\tpublic static _getLastNonBlankColumn(txt: string, defaultValue: number): number {\n\t\tconst r = strings.lastNonWhitespaceIndex(txt);\n\t\tif (r === -1) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn r + 2;\n\t}\n\n\tpublic getCharSequence(shouldIgnoreTrimWhitespace: boolean, startIndex: number, endIndex: number): CharSequence {\n\t\tlet charCodes: number[] = [];\n\t\tlet lineNumbers: number[] = [];\n\t\tlet 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 getLength(): number {\n\t\treturn this._charCodes.length;\n\t}\n\n\tpublic getElementAtIndex(i: number): number {\n\t\treturn this._charCodes[i];\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\tlet 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: LineMarkerSequence, modifiedLineSequence: LineMarkerSequence, continueProcessingPredicate: () => 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.modifiedLength !== 0 && continueProcessingPredicate()) {\n\t\t\tconst originalCharSequence = originalLineSequence.getCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\n\t\t\tconst modifiedCharSequence = modifiedLineSequence.getCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\n\t\t\tlet rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueProcessingPredicate, true);\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}\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 maximumRunTimeMs: number;\n\tprivate readonly originalLines: string[];\n\tprivate readonly modifiedLines: string[];\n\tprivate readonly original: LineMarkerSequence;\n\tprivate readonly modified: LineMarkerSequence;\n\n\tprivate computationStartTime: number;\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.maximumRunTimeMs = MAXIMUM_RUN_TIME;\n\t\tthis.originalLines = originalLines;\n\t\tthis.modifiedLines = modifiedLines;\n\t\tthis.original = new LineMarkerSequence(originalLines);\n\t\tthis.modified = new LineMarkerSequence(modifiedLines);\n\t}\n\n\tpublic computeDiff(): ILineChange[] {\n\n\t\tif (this.original.getLength() === 1 && this.original.getElementAtIndex(0).length === 0) {\n\t\t\t// empty original => fast path\n\t\t\treturn [{\n\t\t\t\toriginalStartLineNumber: 1,\n\t\t\t\toriginalEndLineNumber: 1,\n\t\t\t\tmodifiedStartLineNumber: 1,\n\t\t\t\tmodifiedEndLineNumber: this.modified.getLength(),\n\t\t\t\tcharChanges: [{\n\t\t\t\t\tmodifiedEndColumn: 0,\n\t\t\t\t\tmodifiedEndLineNumber: 0,\n\t\t\t\t\tmodifiedStartColumn: 0,\n\t\t\t\t\tmodifiedStartLineNumber: 0,\n\t\t\t\t\toriginalEndColumn: 0,\n\t\t\t\t\toriginalEndLineNumber: 0,\n\t\t\t\t\toriginalStartColumn: 0,\n\t\t\t\t\toriginalStartLineNumber: 0\n\t\t\t\t}]\n\t\t\t}];\n\t\t}\n\n\t\tif (this.modified.getLength() === 1 && this.modified.getElementAtIndex(0).length === 0) {\n\t\t\t// empty modified => fast path\n\t\t\treturn [{\n\t\t\t\toriginalStartLineNumber: 1,\n\t\t\t\toriginalEndLineNumber: this.original.getLength(),\n\t\t\t\tmodifiedStartLineNumber: 1,\n\t\t\t\tmodifiedEndLineNumber: 1,\n\t\t\t\tcharChanges: [{\n\t\t\t\t\tmodifiedEndColumn: 0,\n\t\t\t\t\tmodifiedEndLineNumber: 0,\n\t\t\t\t\tmodifiedStartColumn: 0,\n\t\t\t\t\tmodifiedStartLineNumber: 0,\n\t\t\t\t\toriginalEndColumn: 0,\n\t\t\t\t\toriginalEndLineNumber: 0,\n\t\t\t\t\toriginalStartColumn: 0,\n\t\t\t\t\toriginalStartLineNumber: 0\n\t\t\t\t}]\n\t\t\t}];\n\t\t}\n\n\t\tthis.computationStartTime = (new Date()).getTime();\n\n\t\tlet rawChanges = computeDiff(this.original, this.modified, this._continueProcessingPredicate.bind(this), this.shouldMakePrettyDiff);\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\tlet 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._continueProcessingPredicate.bind(this), this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n\t\t\t}\n\t\t\treturn lineChanges;\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\tlet 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 = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1);\n\t\t\t\t\t\tlet modifiedStartColumn = LineMarkerSequence._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 = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1);\n\t\t\t\t\t\tlet modifiedEndColumn = LineMarkerSequence._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._continueProcessingPredicate.bind(this), 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 result;\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) {\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\tprivate _continueProcessingPredicate(): boolean {\n\t\tif (this.maximumRunTimeMs === 0) {\n\t\t\treturn true;\n\t\t}\n\t\tconst now = (new Date()).getTime();\n\t\treturn now - this.computationStartTime < this.maximumRunTimeMs;\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 { IEditorAction } from 'vs/editor/common/editorCommon';\nimport { ContextKeyExpr, IContextKeyService } 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: ContextKeyExpr | 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: ContextKeyExpr | 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\tconst r = this._run();\n\t\treturn r ? r : Promise.resolve(undefined);\n\t}\n}\n","\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI, UriComponents } from 'vs/base/common/uri';\nimport * as editorOptions 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 { IIdentifiedSingleEditOperation, IModelDecorationsChangeAccessor, ITextModel, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ThemeColor } from 'vs/platform/theme/common/themeService';\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: Range, text: string | null): 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: Range, text: string | null): 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(): IIdentifiedSingleEditOperation[];\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\nexport interface IDimension {\n\twidth: number;\n\theight: number;\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 * 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 * A line change\n */\nexport interface ILineChange extends IChange {\n\treadonly charChanges: ICharChange[] | undefined;\n}\n\n/**\n * @internal\n */\nexport interface IConfiguration extends IDisposable {\n\tonDidChange(listener: (e: editorOptions.IConfigurationChangedEvent) => void): IDisposable;\n\n\treadonly editor: editorOptions.InternalEditorOptions;\n\n\tsetMaxLineNumber(maxLineNumber: number): void;\n\tupdateOptions(newOptions: editorOptions.IEditorOptions): void;\n\tgetRawOptions(): editorOptions.IEditorOptions;\n\tobserveReferenceElement(dimension?: IDimension): void;\n\tsetIsDominatedByLongLines(isDominatedByLongLines: boolean): void;\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 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: editorOptions.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\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 */\n\tsetPosition(position: IPosition): 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 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 * 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 */\n\tsetSelection(selection: IRange): 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 */\n\tsetSelection(selection: Range): 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 */\n\tsetSelection(selection: ISelection): 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 */\n\tsetSelection(selection: Selection): 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 */\n\tsetSelections(selections: ISelection[]): 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 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 * 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, 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 `ITextModel.changeDecorations`\n\t * @internal\n\t */\n\tchangeDecorations(callback: (changeAccessor: IModelDecorationsChangeAccessor) => any): any;\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 * Get a unique identifier for this contribution.\n\t */\n\tgetId(): string;\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 * @internal\n */\nexport function isThemeColor(o: any): o is ThemeColor {\n\treturn o && typeof o.id === 'string';\n}\n\n/**\n * @internal\n */\nexport interface IThemeDecorationRenderOptions {\n\tletterSpacing?: string;\n\n\tgutterIconPath?: UriComponents;\n\tgutterIconSize?: string;\n\n\toverviewRulerColor?: string | ThemeColor;\n\n\tbefore?: IContentDecorationRenderOptions;\n\tafter?: IContentDecorationRenderOptions;\n}\n\n/**\n * @internal\n */\nexport interface IContentDecorationRenderOptions {\n\tcontentText?: string;\n\tcontentIconPath?: UriComponents;\n\n\tborder?: string;\n\tbackgroundColor?: string | ThemeColor;\n\n\tmargin?: string;\n\twidth?: string;\n\theight?: string;\n}\n\n/**\n * @internal\n */\nexport interface IDecorationRenderOptions extends IThemeDecorationRenderOptions {\n\tisWholeLine?: boolean;\n\trangeBehavior?: TrackedRangeStickiness;\n\toverviewRulerLane?: OverviewRulerLane;\n\n\tlight?: IThemeDecorationRenderOptions;\n\tdark?: IThemeDecorationRenderOptions;\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 Handler = {\n\tExecuteCommand: 'executeCommand',\n\tExecuteCommands: 'executeCommands',\n\n\tType: 'type',\n\tReplacePreviousChar: 'replacePreviousChar',\n\tCompositionStart: 'compositionStart',\n\tCompositionEnd: 'compositionEnd',\n\tPaste: 'paste',\n\n\tCut: 'cut',\n\n\tUndo: 'undo',\n\tRedo: 'redo',\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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, IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport * as editorOptions from 'vs/editor/common/config/editorOptions';\nimport { ICursors } from 'vs/editor/common/controller/cursorCommon';\nimport { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/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 } from 'vs/editor/common/model';\nimport { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/model/textModelEvents';\nimport { OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager';\nimport { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\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 */\n\tafterColumn?: number;\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): number;\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: number): 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: number): 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\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}\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}\n\n/**\n * Target hit with the mouse in the editor.\n */\nexport interface IMouseTarget {\n\t/**\n\t * The target element\n\t */\n\treadonly element: Element | null;\n\t/**\n\t * The target type\n\t */\n\treadonly type: MouseTargetType;\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\t/**\n\t * Some extra detail.\n\t */\n\treadonly detail: any;\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 * An overview ruler\n * @internal\n */\nexport interface IOverviewRuler {\n\tgetDomNode(): HTMLElement;\n\tdispose(): void;\n\tsetZones(zones: OverviewRulerZone[]): void;\n\tsetLayout(position: editorOptions.OverviewRulerPosition): void;\n}\n\n/**\n * A rich code editor.\n */\nexport interface ICodeEditor extends editorCommon.IEditor {\n\t/**\n\t * An event emitted when the content of the current model has changed.\n\t * @event\n\t */\n\tonDidChangeModelContent(listener: (e: IModelContentChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the language of the current model has changed.\n\t * @event\n\t */\n\tonDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the language configuration of the current model has changed.\n\t * @event\n\t */\n\tonDidChangeModelLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the options of the current model has changed.\n\t * @event\n\t */\n\tonDidChangeModelOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable;\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\tonDidChangeConfiguration(listener: (e: editorOptions.IConfigurationChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the cursor position has changed.\n\t * @event\n\t */\n\tonDidChangeCursorPosition(listener: (e: ICursorPositionChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the cursor selection has changed.\n\t * @event\n\t */\n\tonDidChangeCursorSelection(listener: (e: ICursorSelectionChangedEvent) => void): IDisposable;\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\tonDidChangeModel(listener: (e: editorCommon.IModelChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the decorations of the current model have changed.\n\t * @event\n\t */\n\tonDidChangeModelDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable;\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\tonDidFocusEditorText(listener: () => void): IDisposable;\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\tonDidBlurEditorText(listener: () => void): IDisposable;\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\tonDidFocusEditorWidget(listener: () => void): IDisposable;\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\tonDidBlurEditorWidget(listener: () => void): IDisposable;\n\t/**\n\t * An event emitted before interpreting typed characters (on the keyboard).\n\t * @event\n\t * @internal\n\t */\n\tonWillType(listener: (text: string) => void): IDisposable;\n\t/**\n\t * An event emitted before interpreting typed characters (on the keyboard).\n\t * @event\n\t * @internal\n\t */\n\tonDidType(listener: (text: string) => void): IDisposable;\n\t/**\n\t * An event emitted after composition has started.\n\t */\n\tonCompositionStart(listener: () => void): IDisposable;\n\t/**\n\t * An event emitted after composition has ended.\n\t */\n\tonCompositionEnd(listener: () => void): IDisposable;\n\t/**\n\t * An event emitted when editing failed because the editor is read-only.\n\t * @event\n\t * @internal\n\t */\n\tonDidAttemptReadOnlyEdit(listener: () => void): IDisposable;\n\t/**\n\t * An event emitted when users paste text in the editor.\n\t * @event\n\t * @internal\n\t */\n\tonDidPaste(listener: (range: Range) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mouseup\".\n\t * @event\n\t */\n\tonMouseUp(listener: (e: IEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mousedown\".\n\t * @event\n\t */\n\tonMouseDown(listener: (e: IEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mousedrag\".\n\t * @internal\n\t * @event\n\t */\n\tonMouseDrag(listener: (e: IEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mousedrop\".\n\t * @internal\n\t * @event\n\t */\n\tonMouseDrop(listener: (e: IPartialEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"contextmenu\".\n\t * @event\n\t */\n\tonContextMenu(listener: (e: IEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mousemove\".\n\t * @event\n\t */\n\tonMouseMove(listener: (e: IEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mouseleave\".\n\t * @event\n\t */\n\tonMouseLeave(listener: (e: IPartialEditorMouseEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"mousewheel\"\n\t * @event\n\t * @internal\n\t */\n\tonMouseWheel(listener: (e: IMouseWheelEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"keyup\".\n\t * @event\n\t */\n\tonKeyUp(listener: (e: IKeyboardEvent) => void): IDisposable;\n\t/**\n\t * An event emitted on a \"keydown\".\n\t * @event\n\t */\n\tonKeyDown(listener: (e: IKeyboardEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the layout of the editor has changed.\n\t * @event\n\t */\n\tonDidLayoutChange(listener: (e: editorOptions.EditorLayoutInfo) => void): IDisposable;\n\t/**\n\t * An event emitted when the scroll in the editor has changed.\n\t * @event\n\t */\n\tonDidScrollChange(listener: (e: editorCommon.IScrollEvent) => void): IDisposable;\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;\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 * Returns the current editor's configuration\n\t */\n\tgetConfiguration(): editorOptions.InternalEditorOptions;\n\n\t/**\n\t * Returns the 'raw' editor's configuration (without any validation or defaults).\n\t * @internal\n\t */\n\tgetRawConfiguration(): editorOptions.IEditorOptions;\n\n\t/**\n\t * Get value of the current model attached to this editor.\n\t * @see `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 `ITextModel.setValue`\n\t */\n\tsetValue(newValue: string): void;\n\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 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): void;\n\t/**\n\t * Change the scrollTop of the editor's viewport.\n\t */\n\tsetScrollTop(newScrollTop: number): void;\n\t/**\n\t * Change the scroll position of the editor's viewport.\n\t */\n\tsetScrollPosition(position: editorCommon.INewScrollPosition): 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, command: editorCommon.ICommand): void;\n\n\t/**\n\t * Push an \"undo stop\" in the undo-redo stack.\n\t */\n\tpushUndoStop(): 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, edits: IIdentifiedSingleEditOperation[], endCursorState?: 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, commands: (editorCommon.ICommand | null)[]): void;\n\n\t/**\n\t * @internal\n\t */\n\t_getCursors(): ICursors | 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 * All decorations added through this call will get the ownerId of this editor.\n\t * @see `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(): editorOptions.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 * 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 * @internal\n\t */\n\tgetTelemetryData(): { [key: string]: any } | undefined;\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\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_getCursors(): ICursors;\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 * A rich diff editor.\n */\nexport interface IDiffEditor extends editorCommon.IEditor {\n\n\t/**\n\t * @see ICodeEditor.getDomNode\n\t */\n\tgetDomNode(): 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\tonDidUpdateDiff(listener: () => void): IDisposable;\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(): editorCommon.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\n/**\n *@internal\n */\nexport function isCodeEditor(thing: any): 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 * Copyright (c) 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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { LineTokens } from 'vs/editor/common/core/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, ModelRawContentChangedEvent } from 'vs/editor/common/model/textModelEvents';\nimport { SearchData } from 'vs/editor/common/model/textModelSearch';\nimport { LanguageId, LanguageIdentifier, FormattingOptions } from 'vs/editor/common/modes';\nimport { ThemeColor } from 'vs/platform/theme/common/themeService';\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 * Options for rendering a model decoration in the overview ruler.\n */\nexport interface IModelDecorationOverviewRulerOptions {\n\t/**\n\t * CSS color to render in the overview ruler.\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 in the overview ruler.\n\t * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry\n\t */\n\tdarkColor?: string | ThemeColor;\n\t/**\n\t * The position in the overview ruler.\n\t */\n\tposition: OverviewRulerLane;\n}\n\n/**\n * Options for a model decoration.\n */\nexport interface IModelDecorationOptions {\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 a lower stack order.\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, 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 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}\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 * 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 * 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 */\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 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\n/**\n * A single edit operation, that has an identifier.\n */\nexport interface IIdentifiedSingleEditOperation {\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 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\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\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: IIdentifiedSingleEditOperation[]): Selection[] | null;\n}\n\nexport class TextModelResolvedOptions {\n\t_textModelResolvedOptionsBrand: void;\n\n\treadonly tabSize: number;\n\treadonly indentSize: number;\n\treadonly insertSpaces: boolean;\n\treadonly defaultEOL: DefaultEndOfLine;\n\treadonly trimAutoWhitespace: boolean;\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}) {\n\t\tthis.tabSize = 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}\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);\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}\n\nexport interface ITextModelUpdateOptions {\n\ttabSize?: number;\n\tindentSize?: number;\n\tinsertSpaces?: boolean;\n\ttrimAutoWhitespace?: boolean;\n}\n\nexport class FindMatch {\n\t_findMatchBrand: void;\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 * @internal\n */\nexport interface IFoundBracket {\n\trange: Range;\n\topen: string;\n\tclose: string;\n\tisOpen: boolean;\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 * @internal\n */\nexport interface IActiveIndentGuideInfo {\n\tstartLineNumber: number;\n\tendLineNumber: number;\n\tindent: number;\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 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 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 * 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 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 this range.\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, 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 * Flush all tokenization state.\n\t * @internal\n\t */\n\tflushTokens(): 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 * @internal\n\t */\n\tgetLanguageIdentifier(): LanguageIdentifier;\n\n\t/**\n\t * Get the language associated with this model.\n\t */\n\tgetModeId(): string;\n\n\t/**\n\t * Set the current language mode associated with the model.\n\t * @internal\n\t */\n\tsetMode(languageIdentifier: LanguageIdentifier): void;\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): LanguageId;\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 * 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 * @internal\n\t */\n\tfindMatchingBracketUp(bracket: string, position: IPosition): 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 * @internal\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 * @internal\n\t */\n\tfindNextBracket(position: IPosition): IFoundBracket | 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 * @internal\n\t */\n\tmatchBracket(position: IPosition): [Range, Range] | null;\n\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 * 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 * @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 * Push a stack element onto the undo stack. This acts as an undo/redo point.\n\t * The idea is to use `pushEditOperations` to edit the model and then to\n\t * `pushStackElement` to create an undo/redo stop point.\n\t */\n\tpushStackElement(): 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[], 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 The inverse edit operations, that, when applied, will bring the model back to the previous state.\n\t */\n\tapplyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[];\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 * Undo edit operations until the first previous stop point created by `pushStackElement`.\n\t * The inverse edit operations will be pushed on the redo stack.\n\t * @internal\n\t */\n\tundo(): Selection[] | null;\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 stop point created by `pushStackElement`.\n\t * The inverse edit operations will be pushed on the undo stack.\n\t * @internal\n\t */\n\tredo(): Selection[] | null;\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\tonDidChangeRawContentFast(listener: (e: ModelRawContentChangedEvent) => void): IDisposable;\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\tonDidChangeRawContent(listener: (e: ModelRawContentChangedEvent) => void): IDisposable;\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\tonDidChangeDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the model options have changed.\n\t * @event\n\t */\n\tonDidChangeOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the language associated with the model has changed.\n\t * @event\n\t */\n\tonDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted when the language configuration associated with the model has changed.\n\t * @event\n\t */\n\tonDidChangeLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;\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\tonDidChangeTokens(listener: (e: IModelTokensChangedEvent) => void): IDisposable;\n\t/**\n\t * An event emitted right before disposing the model.\n\t * @event\n\t */\n\tonWillDispose(listener: () => void): IDisposable;\n\n\t/**\n\t * Destroy this model. This will unbind the model from the mode\n\t * and make all necessary clean-up to release this object to the GC.\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 the count of editors this model is attached to.\n\t * @internal\n\t */\n\tgetAttachedEditorCount(): number;\n}\n\n/**\n * @internal\n */\nexport interface ITextBufferBuilder {\n}\n\n/**\n * @internal\n */\nexport interface ITextBufferFactory {\n\tcreate(defaultEOL: DefaultEndOfLine): ITextBuffer;\n}\n\n/**\n * @internal\n */\nexport interface ITextBuffer {\n\tmightContainRTL(): boolean;\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\tgetValueLengthInRange(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\n\tsetEOL(newEOL: '\\r\\n' | '\\n'): void;\n\tapplyEdits(rawOperations: IIdentifiedSingleEditOperation[], recordTrimAutoWhitespace: boolean): ApplyEditsResult;\n\tfindMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[];\n}\n\n/**\n * @internal\n */\nexport class ApplyEditsResult {\n\n\tconstructor(\n\t\tpublic readonly reverseEdits: IIdentifiedSingleEditOperation[],\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 * Copyright (c) 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 { Selection } from 'vs/editor/common/core/selection';\nimport { EndOfLineSequence, ICursorStateComputer, IIdentifiedSingleEditOperation } from 'vs/editor/common/model';\nimport { TextModel } from 'vs/editor/common/model/textModel';\n\ninterface IEditOperation {\n\toperations: IIdentifiedSingleEditOperation[];\n}\n\ninterface IStackElement {\n\treadonly beforeVersionId: number;\n\treadonly beforeCursorState: Selection[] | null;\n\treadonly afterCursorState: Selection[] | null;\n\treadonly afterVersionId: number;\n\n\tundo(model: TextModel): void;\n\tredo(model: TextModel): void;\n}\n\nclass EditStackElement implements IStackElement {\n\tpublic readonly beforeVersionId: number;\n\tpublic readonly beforeCursorState: Selection[];\n\tpublic afterCursorState: Selection[] | null;\n\tpublic afterVersionId: number;\n\n\tpublic editOperations: IEditOperation[];\n\n\tconstructor(beforeVersionId: number, beforeCursorState: Selection[]) {\n\t\tthis.beforeVersionId = beforeVersionId;\n\t\tthis.beforeCursorState = beforeCursorState;\n\t\tthis.afterCursorState = null;\n\t\tthis.afterVersionId = -1;\n\t\tthis.editOperations = [];\n\t}\n\n\tpublic undo(model: TextModel): void {\n\t\t// Apply all operations in reverse order\n\t\tfor (let i = this.editOperations.length - 1; i >= 0; i--) {\n\t\t\tthis.editOperations[i] = {\n\t\t\t\toperations: model.applyEdits(this.editOperations[i].operations)\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic redo(model: TextModel): void {\n\t\t// Apply all operations\n\t\tfor (let i = 0; i < this.editOperations.length; i++) {\n\t\t\tthis.editOperations[i] = {\n\t\t\t\toperations: model.applyEdits(this.editOperations[i].operations)\n\t\t\t};\n\t\t}\n\t}\n}\n\nfunction getModelEOL(model: TextModel): 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\nclass EOLStackElement implements IStackElement {\n\tpublic readonly beforeVersionId: number;\n\tpublic readonly beforeCursorState: Selection[] | null;\n\tpublic readonly afterCursorState: Selection[] | null;\n\tpublic afterVersionId: number;\n\n\tpublic eol: EndOfLineSequence;\n\n\tconstructor(beforeVersionId: number, setEOL: EndOfLineSequence) {\n\t\tthis.beforeVersionId = beforeVersionId;\n\t\tthis.beforeCursorState = null;\n\t\tthis.afterCursorState = null;\n\t\tthis.afterVersionId = -1;\n\t\tthis.eol = setEOL;\n\t}\n\n\tpublic undo(model: TextModel): void {\n\t\tlet redoEOL = getModelEOL(model);\n\t\tmodel.setEOL(this.eol);\n\t\tthis.eol = redoEOL;\n\t}\n\n\tpublic redo(model: TextModel): void {\n\t\tlet undoEOL = getModelEOL(model);\n\t\tmodel.setEOL(this.eol);\n\t\tthis.eol = undoEOL;\n\t}\n}\n\nexport interface IUndoRedoResult {\n\tselections: Selection[] | null;\n\trecordedVersionId: number;\n}\n\nexport class EditStack {\n\n\tprivate readonly model: TextModel;\n\tprivate currentOpenStackElement: IStackElement | null;\n\tprivate past: IStackElement[];\n\tprivate future: IStackElement[];\n\n\tconstructor(model: TextModel) {\n\t\tthis.model = model;\n\t\tthis.currentOpenStackElement = null;\n\t\tthis.past = [];\n\t\tthis.future = [];\n\t}\n\n\tpublic pushStackElement(): void {\n\t\tif (this.currentOpenStackElement !== null) {\n\t\t\tthis.past.push(this.currentOpenStackElement);\n\t\t\tthis.currentOpenStackElement = null;\n\t\t}\n\t}\n\n\tpublic clear(): void {\n\t\tthis.currentOpenStackElement = null;\n\t\tthis.past = [];\n\t\tthis.future = [];\n\t}\n\n\tpublic pushEOL(eol: EndOfLineSequence): void {\n\t\t// No support for parallel universes :(\n\t\tthis.future = [];\n\n\t\tif (this.currentOpenStackElement) {\n\t\t\tthis.pushStackElement();\n\t\t}\n\n\t\tconst prevEOL = getModelEOL(this.model);\n\t\tlet stackElement = new EOLStackElement(this.model.getAlternativeVersionId(), prevEOL);\n\n\t\tthis.model.setEOL(eol);\n\n\t\tstackElement.afterVersionId = this.model.getVersionId();\n\t\tthis.currentOpenStackElement = stackElement;\n\t\tthis.pushStackElement();\n\t}\n\n\tpublic pushEditOperation(beforeCursorState: Selection[], editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer | null): Selection[] | null {\n\t\t// No support for parallel universes :(\n\t\tthis.future = [];\n\n\t\tlet stackElement: EditStackElement | null = null;\n\n\t\tif (this.currentOpenStackElement) {\n\t\t\tif (this.currentOpenStackElement instanceof EditStackElement) {\n\t\t\t\tstackElement = this.currentOpenStackElement;\n\t\t\t} else {\n\t\t\t\tthis.pushStackElement();\n\t\t\t}\n\t\t}\n\n\t\tif (!this.currentOpenStackElement) {\n\t\t\tstackElement = new EditStackElement(this.model.getAlternativeVersionId(), beforeCursorState);\n\t\t\tthis.currentOpenStackElement = stackElement;\n\t\t}\n\n\t\tconst inverseEditOperation: IEditOperation = {\n\t\t\toperations: this.model.applyEdits(editOperations)\n\t\t};\n\n\t\tstackElement!.editOperations.push(inverseEditOperation);\n\t\tstackElement!.afterCursorState = EditStack._computeCursorState(cursorStateComputer, inverseEditOperation.operations);\n\t\tstackElement!.afterVersionId = this.model.getVersionId();\n\t\treturn stackElement!.afterCursorState;\n\t}\n\n\tprivate static _computeCursorState(cursorStateComputer: ICursorStateComputer | null, inverseEditOperations: IIdentifiedSingleEditOperation[]): 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\tpublic undo(): IUndoRedoResult | null {\n\n\t\tthis.pushStackElement();\n\n\t\tif (this.past.length > 0) {\n\t\t\tconst pastStackElement = this.past.pop()!;\n\n\t\t\ttry {\n\t\t\t\tpastStackElement.undo(this.model);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t\tthis.clear();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthis.future.push(pastStackElement);\n\n\t\t\treturn {\n\t\t\t\tselections: pastStackElement.beforeCursorState,\n\t\t\t\trecordedVersionId: pastStackElement.beforeVersionId\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic canUndo(): boolean {\n\t\treturn (this.past.length > 0) || this.currentOpenStackElement !== null;\n\t}\n\n\tpublic redo(): IUndoRedoResult | null {\n\n\t\tif (this.future.length > 0) {\n\t\t\tconst futureStackElement = this.future.pop()!;\n\n\t\t\ttry {\n\t\t\t\tfutureStackElement.redo(this.model);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t\tthis.clear();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthis.past.push(futureStackElement);\n\n\t\t\treturn {\n\t\t\t\tselections: futureStackElement.afterCursorState,\n\t\t\t\trecordedVersionId: futureStackElement.afterVersionId\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic canRedo(): boolean {\n\t\treturn (this.future.length > 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 { ITextBuffer } from 'vs/editor/common/model';\n\nclass SpacesDiffResult {\n\tpublic spacesDiff: number;\n\tpublic looksLikeAlignment: boolean;\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\tlet aCharCode = a.charCodeAt(i);\n\t\tlet 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\tlet 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\tlet 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\tlet tabsDiff = Math.abs(aTabsCount - bTabsCount);\n\tlet 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\t// This looks like an alignment desire: e.g.\n\t\t\t\t// const a = b + c,\n\t\t\t\t// d = b - c;\n\n\t\t\t\tresult.looksLikeAlignment = true;\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\tlet spacesDiffCount = [0, 0, 0, 0, 0, 0, 0, 0, 0];\t\t// `tabSize` scores\n\tlet tmp = new SpacesDiffResult();\n\n\tfor (let lineNumber = 1; lineNumber <= linesCount; lineNumber++) {\n\t\tlet currentLineLength = source.getLineLength(lineNumber);\n\t\tlet 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\tlet 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// skip this line entirely\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet 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\tlet tabSizeScore = (insertSpaces ? 0 : 0.1 * linesCount);\n\n\t// console.log(\"score threshold: \" + tabSizeScore);\n\n\tALLOWED_TAB_SIZE_GUESSES.forEach((possibleTabSize) => {\n\t\tlet possibleTabSizeScore = spacesDiffCount[possibleTabSize];\n\t\tif (possibleTabSizeScore > tabSizeScore) {\n\t\t\ttabSizeScore = possibleTabSizeScore;\n\t\t\ttabSize = possibleTabSize;\n\t\t}\n\t});\n\n\t// Let a tabSize of 2 win even if it is not the maximum\n\t// (only in case 4 was guessed)\n\tif (tabSize === 4 && spacesDiffCount[4] > 0 && spacesDiffCount[2] > 0 && spacesDiffCount[2] >= spacesDiffCount[4] / 2) {\n\t\ttabSize = 2;\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 { IModelDecoration, 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}\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\tIsInOverviewRulerMask = 0b00001000,\n\tIsInOverviewRulerMaskInverse = 0b11110111,\n\tIsInOverviewRulerOffset = 3,\n\n\tStickinessMask = 0b00110000,\n\tStickinessMaskInverse = 0b11001111,\n\tStickinessOffset = 4,\n\n\tCollapseOnReplaceEditMask = 0b01000000,\n\tCollapseOnReplaceEditMaskInverse = 0b10111111,\n\tCollapseOnReplaceEditOffset = 6,\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}\nexport function getNodeIsInOverviewRuler(node: IntervalNode): boolean {\n\treturn ((node.metadata & Constants.IsInOverviewRulerMask) >>> Constants.IsInOverviewRulerOffset) === 1;\n}\nfunction setNodeIsInOverviewRuler(node: IntervalNode, value: boolean): void {\n\tnode.metadata = (\n\t\t(node.metadata & Constants.IsInOverviewRulerMaskInverse) | ((value ? 1 : 0) << Constants.IsInOverviewRulerOffset)\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 implements IModelDecoration {\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;\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\tsetNodeIsInOverviewRuler(this, false);\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\tlet 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\tsetNodeIsInOverviewRuler(this, (this.options.overviewRuler && this.options.overviewRuler.color) ? true : false);\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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet newSizeLeft = calculateSize(x);\n\t\tlet newLFLeft = calculateLF(x);\n\t\tif (newSizeLeft !== x.parent.size_left || newLFLeft !== x.parent.lf_left) {\n\t\t\tlet delta = newSizeLeft - x.parent.size_left;\n\t\t\tlet 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\tif (delta === 0) {\n\t\t// go upwards till the node whose left subtree is changed.\n\t\twhile (x !== tree.root && x === x.parent.right) {\n\t\t\tx = x.parent;\n\t\t}\n\n\t\tif (x === tree.root) {\n\t\t\t// well, it means we add a node to the end (inorder)\n\t\t\treturn;\n\t\t}\n\n\t\t// x is the node whose right subtree is changed.\n\t\tx = x.parent;\n\n\t\tdelta = calculateSize(x.left) - x.size_left;\n\t\tlf_delta = calculateLF(x.left) - x.lf_left;\n\t\tx.size_left += delta;\n\t\tx.lf_left += lf_delta;\n\t}\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 { IRange } from 'vs/editor/common/core/range';\n\n/**\n * An event describing that the current mode 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}\n\n/**\n * An event describing that some ranges of lines have been tokenized (their tokens have changed).\n */\nexport interface IModelTokensChangedEvent {\n\treadonly tokenizationSupportChanged: 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 * 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\n\tconstructor(lineNumber: number, detail: string) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.detail = detail;\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\n\tconstructor(fromLineNumber: number, toLineNumber: number, detail: string[]) {\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\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}\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 * @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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { WordCharacterClass, WordCharacterClassifier, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EndOfLinePreference, FindMatch } 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});\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 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\nexport function createFindMatch(range: Range, rawMatches: RegExpExecArray, captureMatches: boolean): FindMatch {\n\tif (!captureMatches) {\n\t\treturn new FindMatch(range, null);\n\t}\n\tlet 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\tlet 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\tlet lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length);\n\t\t\tlet 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\tprivate 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\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 } from 'vs/editor/common/model';\nimport { NodeColor, SENTINEL, TreeNode, fixInsert, leftest, rbDelete, righttest, updateTreeMetadata } from 'vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase';\nimport { SearchData, 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\tlet r: number[] = [0], 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\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\tlet 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\tlet 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 valdiate(offset: number) {\n\t\tlet hasInvalidVal = false;\n\t\tlet tmp: Array<CacheEntry | null> = this._cache;\n\t\tfor (let i = 0; i < tmp.length; i++) {\n\t\t\tlet 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\tlet 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: string;\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\tlet 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\tlet averageBufferSize = AverageBufferSize;\n\t\tlet min = averageBufferSize - Math.floor(averageBufferSize / 3);\n\t\tlet max = min * 2;\n\n\t\tlet tempChunk = '';\n\t\tlet tempChunkLen = 0;\n\t\tlet chunks: StringBuffer[] = [];\n\n\t\tthis.iterate(this.root, node => {\n\t\t\tlet str = this.getNodeContent(node);\n\t\t\tlet 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\tlet 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\tlet 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(): string {\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 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\tlet 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\tlet 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\tlet 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\tlet lineStartOffset = this.getOffsetAt(lfCnt + 1, 1);\n\t\t\t\t\tlet 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\tlet lineStartOffset = this.getOffsetAt(lfCnt + 1, 1);\n\t\t\t\t\tlet 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\tlet startPosition = this.nodeAt2(range.startLineNumber, range.startColumn);\n\t\tlet endPosition = this.nodeAt2(range.endLineNumber, range.endColumn);\n\n\t\tlet 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\tlet node = startPosition.node;\n\t\t\tlet buffer = this._buffers[node.piece.bufferIndex].buffer;\n\t\t\tlet 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\tlet buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\tlet 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\tlet buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\tlet 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\treturn this.getContentOfSubTree(this.root).split(/\\r\\n|\\r|\\n/);\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\tpublic getLineCharCode(lineNumber: number, index: number): number {\n\t\tlet nodePos = this.nodeAt2(lineNumber, index + 1);\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\tlet matchingNode = nodePos.node.next();\n\t\t\tif (!matchingNode) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tlet buffer = this._buffers[matchingNode.piece.bufferIndex];\n\t\t\tlet startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start);\n\t\t\treturn buffer.buffer.charCodeAt(startOffset);\n\t\t} else {\n\t\t\tlet buffer = this._buffers[nodePos.node.piece.bufferIndex];\n\t\t\tlet startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start);\n\t\t\tlet targetOffset = startOffset + nodePos.remainder;\n\n\t\t\treturn buffer.buffer.charCodeAt(targetOffset);\n\t\t}\n\t}\n\n\tpublic getLineLength(lineNumber: number): number {\n\t\tif (lineNumber === this.getLineCount()) {\n\t\t\tlet 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\tlet buffer = this._buffers[node.piece.bufferIndex];\n\t\tlet startOffsetInBuffer = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start);\n\t\tlet start = this.offsetInBuffer(node.piece.bufferIndex, startCursor);\n\t\tlet 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\tsearcher.reset(start);\n\t\tlet ret: BufferCursor = { line: 0, column: 0 };\n\n\t\tdo {\n\t\t\tm = searcher.next(buffer.buffer);\n\n\t\t\tif (m) {\n\t\t\t\tif (m.index >= end) {\n\t\t\t\t\treturn resultLen;\n\t\t\t\t}\n\t\t\t\tthis.positionInBuffer(node, m.index - startOffsetInBuffer, ret);\n\t\t\t\tlet lineFeedCnt = this.getLineFeedCnt(node.piece.bufferIndex, startCursor, ret);\n\t\t\t\tlet retStartColumn = ret.line === startCursor.line ? ret.column - startCursor.column + startColumn : ret.column + 1;\n\t\t\t\tlet 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 (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 startPostion = this.nodeAt2(searchRange.startLineNumber, searchRange.startColumn);\n\t\tif (startPostion === null) {\n\t\t\treturn [];\n\t\t}\n\t\tlet 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(startPostion.node, startPostion.remainder);\n\t\tlet end = this.positionInBuffer(endPosition.node, endPosition.remainder);\n\n\t\tif (startPostion.node === endPosition.node) {\n\t\t\tthis.findMatchesInNode(startPostion.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 = startPostion.node;\n\t\twhile (currentNode !== endPosition.node) {\n\t\t\tlet 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\tlet lineStarts = this._buffers[currentNode.piece.bufferIndex].lineStarts;\n\t\t\t\tlet startOffsetInBuffer = this.offsetInBuffer(currentNode.piece.bufferIndex, currentNode.piece.start);\n\t\t\t\tlet nextLineStartOffset = lineStarts[start.line + lineBreakCnt];\n\t\t\t\tlet 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\tlet 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\tstartPostion = this.nodeAt2(startLineNumber, 1);\n\t\t\tcurrentNode = startPostion.node;\n\t\t\tstart = this.positionInBuffer(startPostion.node, startPostion.remainder);\n\t\t}\n\n\t\tif (startLineNumber === searchRange.endLineNumber) {\n\t\t\tlet 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\tlet 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\tinsert(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\tlet { node, remainder, nodeStartOffset } = this.nodeAt(offset);\n\t\t\tlet piece = node.piece;\n\t\t\tlet bufferIndex = piece.bufferIndex;\n\t\t\tlet 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.valdiate(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\tlet 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\tlet headOfRight = this.nodeCharCodeAt(node, remainder);\n\n\t\t\t\t\tif (headOfRight === 10 /** \\n */) {\n\t\t\t\t\t\tlet 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\tlet tailOfLeft = this.nodeCharCodeAt(node, remainder - 1);\n\t\t\t\t\tif (tailOfLeft === 13 /** \\r */) {\n\t\t\t\t\t\tlet 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\tlet 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\tlet 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\tdelete(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\tlet startPosition = this.nodeAt(offset);\n\t\tlet endPosition = this.nodeAt(offset + cnt);\n\t\tlet startNode = startPosition.node;\n\t\tlet endNode = endPosition.node;\n\n\t\tif (startNode === endNode) {\n\t\t\tlet startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder);\n\t\t\tlet 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\tlet 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.valdiate(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\tlet nodesToDel: TreeNode[] = [];\n\n\t\tlet startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder);\n\t\tthis.deleteNodeTail(startNode, startSplitPosInBuffer);\n\t\tthis._searchCache.valdiate(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\tlet 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\tlet 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\tlet 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\tinsertContentToNodeLeft(value: string, node: TreeNode) {\n\t\t// we are inserting content to the beginning of node\n\t\tlet 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\tlet piece = node.piece;\n\t\t\tlet newStart: BufferCursor = { line: piece.start.line + 1, column: 0 };\n\t\t\tlet 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\tlet 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\tinsertContentToNodeRight(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\tlet newPieces = this.createNewPieces(value);\n\t\tlet 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\tpositionInBuffer(node: TreeNode, remainder: number): BufferCursor;\n\tpositionInBuffer(node: TreeNode, remainder: number, ret: BufferCursor): null;\n\tpositionInBuffer(node: TreeNode, remainder: number, ret?: BufferCursor): BufferCursor | null {\n\t\tlet piece = node.piece;\n\t\tlet bufferIndex = node.piece.bufferIndex;\n\t\tlet lineStarts = this._buffers[bufferIndex].lineStarts;\n\n\t\tlet startOffset = lineStarts[piece.start.line] + piece.start.column;\n\n\t\tlet 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\tgetLineFeedCnt(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\tlet 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\tlet nextLineStartOffset = lineStarts[end.line + 1];\n\t\tlet 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\tlet previousCharOffset = endOffset - 1; // end.column > 0 so it's okay.\n\t\tlet 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\toffsetInBuffer(bufferIndex: number, cursor: BufferCursor): number {\n\t\tlet lineStarts = this._buffers[bufferIndex].lineStarts;\n\t\treturn lineStarts[cursor.line] + cursor.column;\n\t}\n\n\tdeleteNodes(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\tcreateNewPieces(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\tlet 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\tlet 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\tlet 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\tlet endIndex = this._buffers[0].lineStarts.length - 1;\n\t\tlet endColumn = endOffset - this._buffers[0].lineStarts[endIndex];\n\t\tlet endPos = { line: endIndex, column: endColumn };\n\t\tlet 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\tgetLineRawContent(lineNumber: number, endOffset: number = 0): string {\n\t\tlet x = this.root;\n\n\t\tlet ret = '';\n\t\tlet cache = this._searchCache.get2(lineNumber);\n\t\tif (cache) {\n\t\t\tx = cache.node;\n\t\t\tlet prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber - 1);\n\t\t\tlet buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\tlet 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 + prevAccumualtedValue, startOffset + x.piece.length);\n\t\t\t} else {\n\t\t\t\tlet accumualtedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber);\n\t\t\t\treturn buffer.substring(startOffset + prevAccumualtedValue, startOffset + accumualtedValue - 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\tlet prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\t\tlet accumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1);\n\t\t\t\t\tlet buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\t\t\tlet 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 + prevAccumualtedValue, startOffset + accumualtedValue - endOffset);\n\t\t\t\t} else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) {\n\t\t\t\t\tlet prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\t\tlet buffer = this._buffers[x.piece.bufferIndex].buffer;\n\t\t\t\t\tlet startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\n\t\t\t\t\tret = buffer.substring(startOffset + prevAccumualtedValue, 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\tlet buffer = this._buffers[x.piece.bufferIndex].buffer;\n\n\t\t\tif (x.piece.lineFeedCnt > 0) {\n\t\t\t\tlet accumualtedValue = this.getAccumulatedValue(x, 0);\n\t\t\t\tlet startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start);\n\n\t\t\t\tret += buffer.substring(startOffset, startOffset + accumualtedValue - endOffset);\n\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\tlet 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\tcomputeBufferMetadata() {\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.valdiate(this._length);\n\t}\n\n\t// #region node operations\n\tgetIndexOf(node: TreeNode, accumulatedValue: number): { index: number, remainder: number } {\n\t\tlet piece = node.piece;\n\t\tlet pos = this.positionInBuffer(node, accumulatedValue);\n\t\tlet 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\tlet 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\tgetAccumulatedValue(node: TreeNode, index: number) {\n\t\tif (index < 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tlet piece = node.piece;\n\t\tlet lineStarts = this._buffers[piece.bufferIndex].lineStarts;\n\t\tlet 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\tdeleteNodeTail(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\tdeleteNodeHead(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\tshrinkNode(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\tlet 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\tlet newNode = this.rbInsertRight(node, newPiece);\n\t\tthis.validateCRLFWithPrevNode(newNode);\n\t}\n\n\tappendToNode(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\tlet 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\tnodeAt(offset: number): NodePosition {\n\t\tlet x = this.root;\n\t\tlet 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\tlet 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\tnodeAt2(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\tlet prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2);\n\t\t\t\tlet accumualtedValue = 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, accumualtedValue),\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\tlet 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\tlet accumualtedValue = this.getAccumulatedValue(x, 0);\n\t\t\t\tlet 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, accumualtedValue),\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\tlet 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\tnodeCharCodeAt(node: TreeNode, offset: number): number {\n\t\tif (node.piece.lineFeedCnt < 1) {\n\t\t\treturn -1;\n\t\t}\n\t\tlet buffer = this._buffers[node.piece.bufferIndex];\n\t\tlet newOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start) + offset;\n\t\treturn buffer.buffer.charCodeAt(newOffset);\n\t}\n\n\toffsetOfNode(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\tshouldCheckCRLF() {\n\t\treturn !(this._EOLNormalized && this._EOL === '\\n');\n\t}\n\n\tstartWithLF(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\tlet piece = val.piece;\n\t\tlet lineStarts = this._buffers[piece.bufferIndex].lineStarts;\n\t\tlet line = piece.start.line;\n\t\tlet 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\tlet 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\tendWithCR(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\tvalidateCRLFWithPrevNode(nextNode: TreeNode) {\n\t\tif (this.shouldCheckCRLF() && this.startWithLF(nextNode)) {\n\t\t\tlet 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\tvalidateCRLFWithNextNode(node: TreeNode) {\n\t\tif (this.shouldCheckCRLF() && this.endWithCR(node)) {\n\t\t\tlet 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\tfixCRLF(prev: TreeNode, next: TreeNode) {\n\t\tlet nodesToDel: TreeNode[] = [];\n\t\t// update node\n\t\tlet 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\tlet 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\tlet 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\tadjustCarriageReturnFromNext(value: string, node: TreeNode): boolean {\n\t\tif (this.shouldCheckCRLF() && this.endWithCR(value)) {\n\t\t\tlet 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\tlet 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\tgetNodeContent(node: TreeNode) {\n\t\tif (node === SENTINEL) {\n\t\t\treturn '';\n\t\t}\n\t\tlet buffer = this._buffers[node.piece.bufferIndex];\n\t\tlet currentContent;\n\t\tlet piece = node.piece;\n\t\tlet startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start);\n\t\tlet endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end);\n\t\tcurrentContent = 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\trbInsertRight(node: TreeNode | null, p: Piece): TreeNode {\n\t\tlet 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\tlet 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\tlet 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\trbInsertLeft(node: TreeNode | null, p: Piece): TreeNode {\n\t\tlet 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\tlet 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\n\tgetContentOfSubTree(node: TreeNode): string {\n\t\tlet str = '';\n\n\t\tthis.iterate(node, node => {\n\t\t\tstr += this.getNodeContent(node);\n\t\t\treturn true;\n\t\t});\n\n\t\treturn str;\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 * 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, IIdentifiedSingleEditOperation, IInternalModelContentChange, ISingleEditOperationIdentifier, ITextBuffer } from 'vs/editor/common/model';\nimport { PieceTreeBase, StringBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase';\nimport { SearchData } from 'vs/editor/common/model/textModelSearch';\n\nexport interface IValidatedEditOperation {\n\tsortIndex: number;\n\tidentifier: ISingleEditOperationIdentifier | null;\n\trange: Range;\n\trangeOffset: number;\n\trangeLength: number;\n\tlines: string[] | null;\n\tforceMoveMarkers: boolean;\n\tisAutoWhitespaceEdit: boolean;\n}\n\nexport interface IReverseSingleEditOperation extends IIdentifiedSingleEditOperation {\n\tsortIndex: number;\n}\n\nexport class PieceTreeTextBuffer implements ITextBuffer {\n\tprivate readonly _pieceTree: PieceTreeBase;\n\tprivate readonly _BOM: string;\n\tprivate _mightContainRTL: boolean;\n\tprivate _mightContainNonBasicASCII: boolean;\n\n\tconstructor(chunks: StringBuffer[], BOM: string, eol: '\\r\\n' | '\\n', containsRTL: boolean, isBasicASCII: boolean, eolNormalized: boolean) {\n\t\tthis._BOM = BOM;\n\t\tthis._mightContainNonBasicASCII = !isBasicASCII;\n\t\tthis._mightContainRTL = containsRTL;\n\t\tthis._pieceTree = new PieceTreeBase(chunks, eol, eolNormalized);\n\t}\n\tpublic mightContainRTL(): boolean {\n\t\treturn this._mightContainRTL;\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(): string {\n\t\treturn this._pieceTree.getEOL();\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\tlet 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\tlet startOffset = this.getOffsetAt(range.startLineNumber, range.startColumn);\n\t\tlet endOffset = this.getOffsetAt(range.endLineNumber, range.endColumn);\n\t\treturn endOffset - startOffset;\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}\n\t\tthrow new Error('Unknown EOL preference');\n\t}\n\n\tpublic setEOL(newEOL: '\\r\\n' | '\\n'): void {\n\t\tthis._pieceTree.setEOL(newEOL);\n\t}\n\n\tpublic applyEdits(rawOperations: IIdentifiedSingleEditOperation[], recordTrimAutoWhitespace: boolean): ApplyEditsResult {\n\t\tlet mightContainRTL = this._mightContainRTL;\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\tlet op = rawOperations[i];\n\t\t\tif (canReduceOperations && op._isTracked) {\n\t\t\t\tcanReduceOperations = false;\n\t\t\t}\n\t\t\tlet validatedRange = op.range;\n\t\t\tif (!mightContainRTL && op.text) {\n\t\t\t\t// check if the new inserted text contains RTL\n\t\t\t\tmightContainRTL = strings.containsRTL(op.text);\n\t\t\t}\n\t\t\tif (!mightContainNonBasicASCII && op.text) {\n\t\t\t\tmightContainNonBasicASCII = !strings.isBasicASCII(op.text);\n\t\t\t}\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\tlines: op.text ? op.text.split(/\\r\\n|\\r|\\n/) : null,\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\tlet rangeEnd = operations[i].range.getEndPosition();\n\t\t\tlet 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\tlet reverseRanges = PieceTreeTextBuffer._getInverseEditRanges(operations);\n\t\tlet newTrimAutoWhitespaceCandidates: { lineNumber: number, oldContent: string }[] = [];\n\n\t\tfor (let i = 0; i < operations.length; i++) {\n\t\t\tlet op = operations[i];\n\t\t\tlet reverseRange = reverseRanges[i];\n\n\t\t\tif (recordTrimAutoWhitespace && op.isAutoWhitespaceEdit && op.range.isEmpty()) {\n\t\t\t\t// Record already the future line numbers that might be auto whitespace removal candidates on next edit\n\t\t\t\tfor (let lineNumber = reverseRange.startLineNumber; lineNumber <= reverseRange.endLineNumber; lineNumber++) {\n\t\t\t\t\tlet currentLineContent = '';\n\t\t\t\t\tif (lineNumber === reverseRange.startLineNumber) {\n\t\t\t\t\t\tcurrentLineContent = this.getLineContent(op.range.startLineNumber);\n\t\t\t\t\t\tif (strings.firstNonWhitespaceIndex(currentLineContent) !== -1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewTrimAutoWhitespaceCandidates.push({ lineNumber: lineNumber, oldContent: currentLineContent });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet reverseOperations: IReverseSingleEditOperation[] = [];\n\t\tfor (let i = 0; i < operations.length; i++) {\n\t\t\tlet op = operations[i];\n\t\t\tlet reverseRange = reverseRanges[i];\n\n\t\t\treverseOperations[i] = {\n\t\t\t\tsortIndex: op.sortIndex,\n\t\t\t\tidentifier: op.identifier,\n\t\t\t\trange: reverseRange,\n\t\t\t\ttext: this.getValueInRange(op.range),\n\t\t\t\tforceMoveMarkers: op.forceMoveMarkers\n\t\t\t};\n\t\t}\n\n\t\t// Can only sort reverse operations when the order is not significant\n\t\tif (!hasTouchingRanges) {\n\t\t\treverseOperations.sort((a, b) => a.sortIndex - b.sortIndex);\n\t\t}\n\n\t\tthis._mightContainRTL = mightContainRTL;\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\tlet 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\tlet prevContent = newTrimAutoWhitespaceCandidates[i].oldContent;\n\t\t\t\tlet 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\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\t\tfirstEditRange = operations[0].range,\n\t\t\tlastEditRange = operations[operations.length - 1].range,\n\t\t\tentireEditRange = new Range(firstEditRange.startLineNumber, firstEditRange.startColumn, lastEditRange.endLineNumber, lastEditRange.endColumn),\n\t\t\tlastEndLineNumber = firstEditRange.startLineNumber,\n\t\t\tlastEndColumn = firstEditRange.startColumn,\n\t\t\tresult: string[] = [];\n\n\t\tfor (let i = 0, len = operations.length; i < len; i++) {\n\t\t\tlet operation = operations[i],\n\t\t\t\trange = operation.range;\n\n\t\t\tforceMoveMarkers = forceMoveMarkers || operation.forceMoveMarkers;\n\n\t\t\t// (1) -- Push old text\n\t\t\tfor (let lineNumber = lastEndLineNumber; lineNumber < range.startLineNumber; lineNumber++) {\n\t\t\t\tif (lineNumber === lastEndLineNumber) {\n\t\t\t\t\tresult.push(this.getLineContent(lineNumber).substring(lastEndColumn - 1));\n\t\t\t\t} else {\n\t\t\t\t\tresult.push('\\n');\n\t\t\t\t\tresult.push(this.getLineContent(lineNumber));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (range.startLineNumber === lastEndLineNumber) {\n\t\t\t\tresult.push(this.getLineContent(range.startLineNumber).substring(lastEndColumn - 1, range.startColumn - 1));\n\t\t\t} else {\n\t\t\t\tresult.push('\\n');\n\t\t\t\tresult.push(this.getLineContent(range.startLineNumber).substring(0, range.startColumn - 1));\n\t\t\t}\n\n\t\t\t// (2) -- Push new text\n\t\t\tif (operation.lines) {\n\t\t\t\tfor (let j = 0, lenJ = operation.lines.length; j < lenJ; j++) {\n\t\t\t\t\tif (j !== 0) {\n\t\t\t\t\t\tresult.push('\\n');\n\t\t\t\t\t}\n\t\t\t\t\tresult.push(operation.lines[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlastEndLineNumber = operation.range.endLineNumber;\n\t\t\tlastEndColumn = operation.range.endColumn;\n\t\t}\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\tlines: result.join('').split('\\n'),\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\tlet 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\tlet 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.lines || op.lines.length === 0)) {\n\t\t\t\t// no-op\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst deletingLinesCnt = endLineNumber - startLineNumber;\n\t\t\tconst insertingLinesCnt = (op.lines ? op.lines.length - 1 : 0);\n\t\t\tconst editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt);\n\n\t\t\tconst text = (op.lines ? op.lines.join(this.getEOL()) : '');\n\n\t\t\tif (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, 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\tif (editingLinesCnt < insertingLinesCnt) {\n\t\t\t\tlet newLinesContent: string[] = [];\n\t\t\t\tfor (let j = editingLinesCnt + 1; j <= insertingLinesCnt; j++) {\n\t\t\t\t\tnewLinesContent.push(op.lines![j]);\n\t\t\t\t}\n\n\t\t\t\tnewLinesContent[newLinesContent.length - 1] = this.getLineContent(startLineNumber + insertingLinesCnt - 1);\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: 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\t/**\n\t * Assumes `operations` are validated and sorted ascending\n\t */\n\tpublic static _getInverseEditRanges(operations: IValidatedEditOperation[]): Range[] {\n\t\tlet 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\tlet 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.lines && op.lines.length > 0) {\n\t\t\t\t// the operation inserts something\n\t\t\t\tlet lineCount = op.lines.length;\n\t\t\t\tlet firstLine = op.lines[0];\n\t\t\t\tlet lastLine = op.lines[lineCount - 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 + firstLine.length);\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, lastLine.length + 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\tlet 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\tlet 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 * 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 _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): ITextBuffer {\n\t\tconst eol = this._getEOL(defaultEOL);\n\t\tlet 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\tlet str = chunks[i].buffer.replace(/\\r\\n|\\r|\\n/g, eol);\n\t\t\t\tlet newLineStart = createLineStartsFast(str);\n\t\t\t\tchunks[i] = new StringBuffer(str, newLineStart);\n\t\t\t}\n\t\t}\n\n\t\treturn new PieceTreeTextBuffer(chunks, this._bom, eol, this._containsRTL, this._isBasicASCII, this._normalizeEOL);\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 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.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 is basic ASCII\n\t\t\tthis.containsRTL = strings.containsRTL(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.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\tlet lastChunk = this.chunks[this.chunks.length - 1];\n\t\t\tlastChunk.buffer += String.fromCharCode(this._previousChar);\n\t\t\tlet 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 { IWordAtPosition } from 'vs/editor/common/model';\n\nexport const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\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\nfunction getWordAtPosFast(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition | null {\n\t// find whitespace enclosed text around column and match from there\n\n\tlet pos = column - 1 - textOffset;\n\tlet start = text.lastIndexOf(' ', pos - 1) + 1;\n\n\twordDefinition.lastIndex = start;\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 {\n\t\t\t\tword: match[0],\n\t\t\t\tstartColumn: textOffset + 1 + matchIndex,\n\t\t\t\tendColumn: textOffset + 1 + wordDefinition.lastIndex\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\n\nfunction getWordAtPosSlow(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition | null {\n\t// matches all words starting at the beginning\n\t// of the input until it finds a match that encloses\n\t// the desired column. slow but correct\n\n\tlet pos = column - 1 - textOffset;\n\twordDefinition.lastIndex = 0;\n\n\tlet match: RegExpMatchArray | null;\n\twhile (match = wordDefinition.exec(text)) {\n\t\tconst matchIndex = match.index || 0;\n\t\tif (matchIndex > pos) {\n\t\t\t// |nW -> matched only after the pos\n\t\t\treturn null;\n\n\t\t} else if (wordDefinition.lastIndex >= pos) {\n\t\t\t// W|W -> match encloses pos\n\t\t\treturn {\n\t\t\t\tword: match[0],\n\t\t\t\tstartColumn: textOffset + 1 + matchIndex,\n\t\t\t\tendColumn: textOffset + 1 + wordDefinition.lastIndex\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getWordAtText(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition | null {\n\n\t// if `words` can contain whitespace character we have to use the slow variant\n\t// otherwise we use the fast variant of finding a word\n\twordDefinition.lastIndex = 0;\n\tlet match = wordDefinition.exec(text);\n\tif (!match) {\n\t\treturn null;\n\t}\n\t// todo@joh the `match` could already be the (first) word\n\tconst ret = match[0].indexOf(' ') >= 0\n\t\t// did match a word which contains a space character -> use slow word find\n\t\t? getWordAtPosSlow(column, wordDefinition, text, textOffset)\n\t\t// sane word definition -> use fast word find\n\t\t: getWordAtPosFast(column, wordDefinition, text, textOffset);\n\n\t// both (getWordAtPosFast and getWordAtPosSlow) leave the wordDefinition-RegExp\n\t// in an undefined state and to not confuse other users of the wordDefinition\n\t// we reset the lastIndex\n\twordDefinition.lastIndex = 0;\n\n\treturn ret;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IMode, LanguageIdentifier } from 'vs/editor/common/modes';\n\nexport class FrankensteinMode implements IMode {\n\n\tprivate readonly _languageIdentifier: LanguageIdentifier;\n\n\tconstructor(languageIdentifier: LanguageIdentifier) {\n\t\tthis._languageIdentifier = languageIdentifier;\n\t}\n\n\tpublic getId(): string {\n\t\treturn this._languageIdentifier.language;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { StandardTokenType } from 'vs/editor/common/modes';\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\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?: IBracketElectricCharacterContribution;\n}\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\toneLineAboveText?: RegExp;\n\t/**\n\t * The action to execute.\n\t */\n\taction: EnterAction;\n}\n\nexport interface IBracketElectricCharacterContribution {\n\tdocComment?: IDocComment;\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 class StandardAutoClosingPairConditional {\n\t_standardAutoClosingPairConditionalBrand: void;\n\n\treadonly open: string;\n\treadonly close: string;\n\tprivate readonly _standardTokenMask: number;\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._standardTokenMask = 0;\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\tlet notIn = source.notIn[i];\n\t\t\t\tswitch (notIn) {\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\tthis._standardTokenMask |= StandardTokenType.String;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'comment':\n\t\t\t\t\t\tthis._standardTokenMask |= StandardTokenType.Comment;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'regex':\n\t\t\t\t\t\tthis._standardTokenMask |= StandardTokenType.RegEx;\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\treturn (this._standardTokenMask & <number>standardToken) === 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 { IRelativePattern, match as matchGlobPattern } from 'vs/base/common/glob';\nimport { URI } from 'vs/base/common/uri'; // TODO@Alex\n\nexport interface LanguageFilter {\n\tlanguage?: string;\n\tscheme?: string;\n\tpattern?: string | IRelativePattern;\n\t/**\n\t * This provider is implemented in the UI thread.\n\t */\n\thasAccessToAllModels?: boolean;\n\texclusive?: boolean;\n}\n\nexport type LanguageSelector = string | LanguageFilter | Array<string | LanguageFilter>;\n\nexport function score(selector: LanguageSelector | undefined, candidateUri: URI, candidateLanguage: string, candidateIsSynchronized: boolean): 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);\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 } = selector;\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 (pattern) {\n\t\t\tif (pattern === candidateUri.fsPath || matchGlobPattern(pattern, 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 { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\nimport { Uint8Matrix } from 'vs/editor/common/core/uint';\nimport { ILink } from 'vs/editor/common/modes';\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 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\tlet [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\tlet states = new Uint8Matrix(maxState, maxCharCode, State.Invalid);\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\n\t\t\tlet [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\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\tlet 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 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\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\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\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/core/lineTokens';\nimport * as modes from 'vs/editor/common/modes';\n\nexport function createScopedLineTokens(context: LineTokens, offset: number): ScopedLineTokens {\n\tlet tokenCount = context.getCount();\n\tlet tokenIndex = context.findTokenIndexAtOffset(offset);\n\tlet 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;\n\n\tpublic readonly languageId: modes.LanguageId;\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: modes.LanguageId,\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 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): modes.StandardTokenType {\n\t\treturn this._actual.getStandardTokenType(tokenIndex + this._firstTokenIndex);\n\t}\n}\n\nconst enum IgnoreBracketsInTokens {\n\tvalue = modes.StandardTokenType.Comment | modes.StandardTokenType.String | modes.StandardTokenType.RegEx\n}\n\nexport function ignoreBracketsInToken(standardTokenType: modes.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 { CharacterPair, IAutoClosingPair, IAutoClosingPairConditional, StandardAutoClosingPairConditional } from 'vs/editor/common/modes/languageConfiguration';\nimport { ScopedLineTokens } from 'vs/editor/common/modes/supports';\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\n\tconstructor(config: { brackets?: CharacterPair[]; autoClosingPairs?: IAutoClosingPairConditional[], surroundingPairs?: IAutoClosingPair[], autoCloseBefore?: string }) {\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\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(): IAutoClosingPair[] {\n\t\treturn this._autoClosingPairs;\n\t}\n\n\tpublic getAutoCloseBeforeSet(): string {\n\t\treturn this._autoCloseBefore;\n\t}\n\n\tpublic shouldAutoClosePair(character: string, 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\tlet tokenIndex = context.findTokenIndexAtOffset(column - 2);\n\t\tlet standardTokenType = context.getStandardTokenType(tokenIndex);\n\n\t\tfor (const autoClosingPair of this._autoClosingPairs) {\n\t\t\tif (autoClosingPair.open === character) {\n\t\t\t\treturn autoClosingPair.isOK(standardTokenType);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic getSurroundingPairs(): IAutoClosingPair[] {\n\t\treturn this._surroundingPairs;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/modes/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\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 && 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 && 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 && 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 && 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/modes';\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\tlet 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\tlet 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\tlet 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\tlet 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/modes/languageConfiguration';\n\nexport interface IOnEnterSupportOptions {\n\tbrackets?: CharacterPair[];\n\tregExpRules?: 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.regExpRules || [];\n\t}\n\n\tpublic onEnter(oneLineAboveText: string, beforeEnterText: string, afterEnterText: string): EnterAction | null {\n\t\t// (1): `regExpRules`\n\t\tfor (let i = 0, len = this._regExpRules.length; i < len; i++) {\n\t\t\tlet rule = this._regExpRules[i];\n\t\t\tconst regResult = [{\n\t\t\t\treg: rule.beforeText,\n\t\t\t\ttext: beforeEnterText\n\t\t\t}, {\n\t\t\t\treg: rule.afterText,\n\t\t\t\ttext: afterEnterText\n\t\t\t}, {\n\t\t\t\treg: rule.oneLineAboveText,\n\t\t\t\ttext: oneLineAboveText\n\t\t\t}].every((obj): boolean => {\n\t\t\t\treturn obj.reg ? obj.reg.test(obj.text) : true;\n\t\t\t});\n\n\t\t\tif (regResult) {\n\t\t\t\treturn rule.action;\n\t\t\t}\n\t\t}\n\n\n\t\t// (2): Special indent-outdent\n\t\tif (beforeEnterText.length > 0 && afterEnterText.length > 0) {\n\t\t\tfor (let i = 0, len = this._brackets.length; i < len; i++) {\n\t\t\t\tlet bracket = this._brackets[i];\n\t\t\t\tif (bracket.openRegExp.test(beforeEnterText) && bracket.closeRegExp.test(afterEnterText)) {\n\t\t\t\t\treturn { indentAction: IndentAction.IndentOutdent };\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 (beforeEnterText.length > 0) {\n\t\t\tfor (let i = 0, len = this._brackets.length; i < len; i++) {\n\t\t\t\tlet bracket = this._brackets[i];\n\t\t\t\tif (bracket.openRegExp.test(beforeEnterText)) {\n\t\t\t\t\treturn { indentAction: IndentAction.Indent };\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 { Range } from 'vs/editor/common/core/range';\nimport { LanguageIdentifier } from 'vs/editor/common/modes';\nimport { CharacterPair } from 'vs/editor/common/modes/languageConfiguration';\n\ninterface ISimpleInternalBracket {\n\topen: string;\n\tclose: string;\n}\n\nexport class RichEditBracket {\n\t_richEditBracketBrand: void;\n\n\treadonly languageIdentifier: LanguageIdentifier;\n\treadonly open: string;\n\treadonly close: string;\n\treadonly forwardRegex: RegExp;\n\treadonly reversedRegex: RegExp;\n\n\tconstructor(languageIdentifier: LanguageIdentifier, open: string, close: string, forwardRegex: RegExp, reversedRegex: RegExp) {\n\t\tthis.languageIdentifier = languageIdentifier;\n\t\tthis.open = open;\n\t\tthis.close = close;\n\t\tthis.forwardRegex = forwardRegex;\n\t\tthis.reversedRegex = reversedRegex;\n\t}\n}\n\nexport class RichEditBrackets {\n\t_richEditBracketsBrand: void;\n\n\tpublic readonly brackets: RichEditBracket[];\n\tpublic readonly forwardRegex: RegExp;\n\tpublic readonly reversedRegex: RegExp;\n\tpublic readonly maxBracketLength: number;\n\tpublic readonly textIsBracket: { [text: string]: RichEditBracket; };\n\tpublic readonly textIsOpenBracket: { [text: string]: boolean; };\n\n\tconstructor(languageIdentifier: LanguageIdentifier, brackets: CharacterPair[]) {\n\t\tthis.brackets = brackets.map((b) => {\n\t\t\treturn new RichEditBracket(\n\t\t\t\tlanguageIdentifier,\n\t\t\t\tb[0],\n\t\t\t\tb[1],\n\t\t\t\tgetRegexForBracketPair({ open: b[0], close: b[1] }),\n\t\t\t\tgetReversedRegexForBracketPair({ open: b[0], close: b[1] })\n\t\t\t);\n\t\t});\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\tlet maxBracketLength = 0;\n\t\tthis.brackets.forEach((b) => {\n\t\t\tthis.textIsBracket[b.open.toLowerCase()] = b;\n\t\t\tthis.textIsBracket[b.close.toLowerCase()] = b;\n\t\t\tthis.textIsOpenBracket[b.open.toLowerCase()] = true;\n\t\t\tthis.textIsOpenBracket[b.close.toLowerCase()] = false;\n\t\t\tmaxBracketLength = Math.max(maxBracketLength, b.open.length);\n\t\t\tmaxBracketLength = Math.max(maxBracketLength, b.close.length);\n\t\t});\n\t\tthis.maxBracketLength = maxBracketLength;\n\t}\n}\n\nfunction once<T, R>(keyFn: (input: T) => string, computeFn: (input: T) => R): (input: T) => R {\n\tlet cache: { [key: string]: R; } = {};\n\treturn (input: T): R => {\n\t\tlet key = keyFn(input);\n\t\tif (!cache.hasOwnProperty(key)) {\n\t\t\tcache[key] = computeFn(input);\n\t\t}\n\t\treturn cache[key];\n\t};\n}\n\nconst getRegexForBracketPair = once<ISimpleInternalBracket, RegExp>(\n\t(input) => `${input.open};${input.close}`,\n\t(input) => {\n\t\treturn createBracketOrRegExp([input.open, input.close]);\n\t}\n);\n\nconst getReversedRegexForBracketPair = once<ISimpleInternalBracket, RegExp>(\n\t(input) => `${input.open};${input.close}`,\n\t(input) => {\n\t\treturn createBracketOrRegExp([toReversedString(input.open), toReversedString(input.close)]);\n\t}\n);\n\nconst getRegexForBrackets = once<ISimpleInternalBracket[], RegExp>(\n\t(input) => input.map(b => `${b.open};${b.close}`).join(';'),\n\t(input) => {\n\t\tlet pieces: string[] = [];\n\t\tinput.forEach((b) => {\n\t\t\tpieces.push(b.open);\n\t\t\tpieces.push(b.close);\n\t\t});\n\t\treturn createBracketOrRegExp(pieces);\n\t}\n);\n\nconst getReversedRegexForBrackets = once<ISimpleInternalBracket[], RegExp>(\n\t(input) => input.map(b => `${b.open};${b.close}`).join(';'),\n\t(input) => {\n\t\tlet pieces: string[] = [];\n\t\tinput.forEach((b) => {\n\t\t\tpieces.push(toReversedString(b.open));\n\t\t\tpieces.push(toReversedString(b.close));\n\t\t});\n\t\treturn createBracketOrRegExp(pieces);\n\t}\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\tlet regexStr = `(${pieces.map(prepareBracketForRegExp).join(')|(')})`;\n\treturn strings.createRegExp(regexStr, true);\n}\n\nlet toReversedString = (function () {\n\n\tfunction reverse(str: string): string {\n\t\tlet reversedStr = '';\n\t\tfor (let i = str.length - 1; i >= 0; i--) {\n\t\t\treversedStr += str.charAt(i);\n\t\t}\n\t\treturn reversedStr;\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\tlet m = reversedText.match(reversedBracketRegex);\n\n\t\tif (!m) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet matchOffset = reversedText.length - (m.index || 0);\n\t\tlet matchLength = m[0].length;\n\t\tlet absoluteMatchOffset = offset + matchOffset;\n\n\t\treturn new Range(lineNumber, absoluteMatchOffset - matchLength + 1, lineNumber, absoluteMatchOffset + 1);\n\t}\n\n\tpublic static findPrevBracketInToken(reversedBracketRegex: RegExp, lineNumber: number, lineText: string, currentTokenStart: number, currentTokenEnd: 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\tlet reversedLineText = toReversedString(lineText);\n\t\tlet reversedTokenText = reversedLineText.substring(lineText.length - currentTokenEnd, lineText.length - currentTokenStart);\n\n\t\treturn this._findPrevBracketInText(reversedBracketRegex, lineNumber, reversedTokenText, currentTokenStart);\n\t}\n\n\tpublic static findNextBracketInText(bracketRegex: RegExp, lineNumber: number, text: string, offset: number): Range | null {\n\t\tlet m = text.match(bracketRegex);\n\n\t\tif (!m) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet matchOffset = m.index || 0;\n\t\tlet matchLength = m[0].length;\n\t\tif (matchLength === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tlet absoluteMatchOffset = offset + matchOffset;\n\n\t\treturn new Range(lineNumber, absoluteMatchOffset + 1, lineNumber, absoluteMatchOffset + 1 + matchLength);\n\t}\n\n\tpublic static findNextBracketInToken(bracketRegex: RegExp, lineNumber: number, lineText: string, currentTokenStart: number, currentTokenEnd: number): Range | null {\n\t\tlet currentTokenText = lineText.substring(currentTokenStart, currentTokenEnd);\n\n\t\treturn this.findNextBracketInText(bracketRegex, lineNumber, currentTokenText, currentTokenStart);\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 { IAutoClosingPairConditional, IBracketElectricCharacterContribution, StandardAutoClosingPairConditional } from 'vs/editor/common/modes/languageConfiguration';\nimport { ScopedLineTokens, ignoreBracketsInToken } from 'vs/editor/common/modes/supports';\nimport { BracketsUtils, RichEditBrackets } from 'vs/editor/common/modes/supports/richEditBrackets';\n\n/**\n * Interface used to support electric characters\n * @internal\n */\nexport interface IElectricAction {\n\t// Only one of the following properties should be defined:\n\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\t// The text will be appended after the electric character.\n\tappendText?: string;\n}\n\nexport class BracketElectricCharacterSupport {\n\n\tprivate readonly _richEditBrackets: RichEditBrackets | null;\n\tprivate readonly _complexAutoClosePairs: StandardAutoClosingPairConditional[];\n\n\tconstructor(richEditBrackets: RichEditBrackets | null, autoClosePairs: IAutoClosingPairConditional[], contribution: IBracketElectricCharacterContribution | null | undefined) {\n\t\tcontribution = contribution || {};\n\t\tthis._richEditBrackets = richEditBrackets;\n\t\tthis._complexAutoClosePairs = autoClosePairs.filter(pair => pair.open.length > 1 && !!pair.close).map(el => new StandardAutoClosingPairConditional(el));\n\t\tif (contribution.docComment) {\n\t\t\t// IDocComment is legacy, only partially supported\n\t\t\tthis._complexAutoClosePairs.push(new StandardAutoClosingPairConditional({ open: contribution.docComment.open, close: contribution.docComment.close || '' }));\n\t\t}\n\t}\n\n\tpublic getElectricCharacters(): string[] {\n\t\tlet result: string[] = [];\n\n\t\tif (this._richEditBrackets) {\n\t\t\tfor (let i = 0, len = this._richEditBrackets.brackets.length; i < len; i++) {\n\t\t\t\tlet bracketPair = this._richEditBrackets.brackets[i];\n\t\t\t\tlet lastChar = bracketPair.close.charAt(bracketPair.close.length - 1);\n\t\t\t\tresult.push(lastChar);\n\t\t\t}\n\t\t}\n\n\t\t// auto close\n\t\tfor (let pair of this._complexAutoClosePairs) {\n\t\t\tresult.push(pair.open.charAt(pair.open.length - 1));\n\t\t}\n\n\t\t// Filter duplicate entries\n\t\tresult = result.filter((item, pos, array) => {\n\t\t\treturn array.indexOf(item) === pos;\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tpublic onElectricCharacter(character: string, context: ScopedLineTokens, column: number): IElectricAction | null {\n\t\treturn (this._onElectricAutoClose(character, context, column) ||\n\t\t\tthis._onElectricAutoIndent(character, context, column));\n\t}\n\n\tprivate _onElectricAutoIndent(character: string, context: ScopedLineTokens, column: number): IElectricAction | null {\n\n\t\tif (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet tokenIndex = context.findTokenIndexAtOffset(column - 1);\n\t\tif (ignoreBracketsInToken(context.getStandardTokenType(tokenIndex))) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet reversedBracketRegex = this._richEditBrackets.reversedRegex;\n\t\tlet text = context.getLineContent().substring(0, column - 1) + character;\n\n\t\tlet r = BracketsUtils.findPrevBracketInToken(reversedBracketRegex, 1, text, 0, text.length);\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet bracketText = text.substring(r.startColumn - 1, r.endColumn - 1);\n\t\tbracketText = bracketText.toLowerCase();\n\n\t\tlet isOpen = this._richEditBrackets.textIsOpenBracket[bracketText];\n\t\tif (isOpen) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet textBeforeBracket = text.substring(0, 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\tprivate _onElectricAutoClose(character: string, context: ScopedLineTokens, column: number): IElectricAction | null {\n\t\tif (!this._complexAutoClosePairs.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet line = context.getLineContent();\n\n\t\tfor (let i = 0, len = this._complexAutoClosePairs.length; i < len; i++) {\n\t\t\tlet pair = this._complexAutoClosePairs[i];\n\n\t\t\t// See if the right electric character was pressed\n\t\t\tif (character !== pair.open.charAt(pair.open.length - 1)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// check if the full open bracket matches\n\t\t\tlet start = column - pair.open.length + 1;\n\t\t\tlet actual = line.substring(start - 1, column - 1) + character;\n\t\t\tif (actual !== pair.open) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet lastTokenIndex = context.findTokenIndexAtOffset(column - 1);\n\t\t\tlet lastTokenStandardType = context.getStandardTokenType(lastTokenIndex);\n\t\t\t// If we're in a scope listed in 'notIn', do nothing\n\t\t\tif (!pair.isOK(lastTokenStandardType)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If this line already contains the closing tag, do nothing.\n\t\t\tif (line.indexOf(pair.close, column - 1) >= 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn { appendText: pair.close };\n\t\t}\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { LineTokens } from 'vs/editor/common/core/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/model/wordHelper';\nimport { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';\nimport { EnterAction, FoldingRules, IAutoClosingPair, IAutoClosingPairConditional, IndentAction, IndentationRule, LanguageConfiguration } from 'vs/editor/common/modes/languageConfiguration';\nimport { createScopedLineTokens } from 'vs/editor/common/modes/supports';\nimport { CharacterPairSupport } from 'vs/editor/common/modes/supports/characterPair';\nimport { BracketElectricCharacterSupport, IElectricAction } from 'vs/editor/common/modes/supports/electricCharacter';\nimport { IndentConsts, IndentRulesSupport } from 'vs/editor/common/modes/supports/indentRules';\nimport { IOnEnterSupportOptions, OnEnterSupport } from 'vs/editor/common/modes/supports/onEnter';\nimport { RichEditBrackets } from 'vs/editor/common/modes/supports/richEditBrackets';\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\tgetLanguageIdentifier(): LanguageIdentifier;\n\tgetLanguageIdAtPosition(lineNumber: number, column: number): LanguageId;\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 class RichEditSupport {\n\n\tprivate readonly _conf: LanguageConfiguration;\n\tprivate readonly _languageIdentifier: LanguageIdentifier;\n\tprivate _brackets: RichEditBrackets | null;\n\tprivate _electricCharacter: BracketElectricCharacterSupport | null;\n\n\tpublic readonly comments: ICommentsConfiguration | null;\n\tpublic readonly characterPair: CharacterPairSupport;\n\tpublic readonly wordDefinition: RegExp;\n\tpublic readonly onEnter: OnEnterSupport | null;\n\tpublic readonly indentRulesSupport: IndentRulesSupport;\n\tpublic readonly indentationRules: IndentationRule | undefined;\n\tpublic readonly foldingRules: FoldingRules;\n\n\tconstructor(languageIdentifier: LanguageIdentifier, previous: RichEditSupport | undefined, rawConf: LanguageConfiguration) {\n\t\tthis._languageIdentifier = languageIdentifier;\n\n\t\tthis._brackets = null;\n\t\tthis._electricCharacter = null;\n\n\t\tlet prev: LanguageConfiguration | null = null;\n\t\tif (previous) {\n\t\t\tprev = previous._conf;\n\t\t}\n\n\t\tthis._conf = RichEditSupport._mergeConf(prev, rawConf);\n\n\t\tthis.onEnter = RichEditSupport._handleOnEnter(this._conf);\n\n\t\tthis.comments = RichEditSupport._handleComments(this._conf);\n\n\t\tthis.characterPair = new CharacterPairSupport(this._conf);\n\n\t\tthis.wordDefinition = this._conf.wordPattern || DEFAULT_WORD_REGEXP;\n\n\t\tthis.indentationRules = this._conf.indentationRules;\n\t\tif (this._conf.indentationRules) {\n\t\t\tthis.indentRulesSupport = new IndentRulesSupport(this._conf.indentationRules);\n\t\t}\n\n\t\tthis.foldingRules = this._conf.folding || {};\n\t}\n\n\tpublic get brackets(): RichEditBrackets | null {\n\t\tif (!this._brackets && this._conf.brackets) {\n\t\t\tthis._brackets = new RichEditBrackets(this._languageIdentifier, this._conf.brackets);\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\tlet autoClosingPairs: IAutoClosingPairConditional[] = [];\n\t\t\tif (this._conf.autoClosingPairs) {\n\t\t\t\tautoClosingPairs = this._conf.autoClosingPairs;\n\t\t\t} else if (this._conf.brackets) {\n\t\t\t\tautoClosingPairs = this._conf.brackets.map(b => {\n\t\t\t\t\treturn { open: b[0], close: b[1] };\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis._electricCharacter = new BracketElectricCharacterSupport(this.brackets, autoClosingPairs, this._conf.__electricCharacterSupport);\n\t\t}\n\t\treturn this._electricCharacter;\n\t}\n\n\tprivate static _mergeConf(prev: LanguageConfiguration | null, current: LanguageConfiguration): LanguageConfiguration {\n\t\treturn {\n\t\t\tcomments: (prev ? current.comments || prev.comments : current.comments),\n\t\t\tbrackets: (prev ? current.brackets || prev.brackets : current.brackets),\n\t\t\twordPattern: (prev ? current.wordPattern || prev.wordPattern : current.wordPattern),\n\t\t\tindentationRules: (prev ? current.indentationRules || prev.indentationRules : current.indentationRules),\n\t\t\tonEnterRules: (prev ? current.onEnterRules || prev.onEnterRules : current.onEnterRules),\n\t\t\tautoClosingPairs: (prev ? current.autoClosingPairs || prev.autoClosingPairs : current.autoClosingPairs),\n\t\t\tsurroundingPairs: (prev ? current.surroundingPairs || prev.surroundingPairs : current.surroundingPairs),\n\t\t\tautoCloseBefore: (prev ? current.autoCloseBefore || prev.autoCloseBefore : current.autoCloseBefore),\n\t\t\tfolding: (prev ? current.folding || prev.folding : current.folding),\n\t\t\t__electricCharacterSupport: (prev ? current.__electricCharacterSupport || prev.__electricCharacterSupport : current.__electricCharacterSupport),\n\t\t};\n\t}\n\n\tprivate static _handleOnEnter(conf: LanguageConfiguration): OnEnterSupport | null {\n\t\t// on enter\n\t\tlet onEnter: IOnEnterSupportOptions = {};\n\t\tlet empty = true;\n\n\t\tif (conf.brackets) {\n\t\t\tempty = false;\n\t\t\tonEnter.brackets = conf.brackets;\n\t\t}\n\t\tif (conf.indentationRules) {\n\t\t\tempty = false;\n\t\t}\n\t\tif (conf.onEnterRules) {\n\t\t\tempty = false;\n\t\t\tonEnter.regExpRules = conf.onEnterRules;\n\t\t}\n\n\t\tif (!empty) {\n\t\t\treturn new OnEnterSupport(onEnter);\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _handleComments(conf: LanguageConfiguration): ICommentsConfiguration | null {\n\t\tlet commentRule = conf.comments;\n\t\tif (!commentRule) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// comment configuration\n\t\tlet 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\tlet [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\nexport class LanguageConfigurationChangeEvent {\n\tlanguageIdentifier: LanguageIdentifier;\n}\n\nexport class LanguageConfigurationRegistryImpl {\n\n\tprivate readonly _entries = new Map<LanguageId, RichEditSupport>();\n\n\tprivate readonly _onDidChange = new Emitter<LanguageConfigurationChangeEvent>();\n\tpublic readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;\n\n\tpublic register(languageIdentifier: LanguageIdentifier, configuration: LanguageConfiguration): IDisposable {\n\t\tlet previous = this._getRichEditSupport(languageIdentifier.id);\n\t\tlet current = new RichEditSupport(languageIdentifier, previous, configuration);\n\t\tthis._entries.set(languageIdentifier.id, current);\n\t\tthis._onDidChange.fire({ languageIdentifier });\n\t\treturn toDisposable(() => {\n\t\t\tif (this._entries.get(languageIdentifier.id) === current) {\n\t\t\t\tthis._entries.set(languageIdentifier.id, previous);\n\t\t\t\tthis._onDidChange.fire({ languageIdentifier });\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _getRichEditSupport(languageId: LanguageId): RichEditSupport | undefined {\n\t\treturn this._entries.get(languageId);\n\t}\n\n\t// begin electricCharacter\n\n\tprivate _getElectricCharacterSupport(languageId: LanguageId): BracketElectricCharacterSupport | null {\n\t\tlet value = this._getRichEditSupport(languageId);\n\t\tif (!value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn value.electricCharacter || null;\n\t}\n\n\tpublic getElectricCharacters(languageId: LanguageId): string[] {\n\t\tlet electricCharacterSupport = this._getElectricCharacterSupport(languageId);\n\t\tif (!electricCharacterSupport) {\n\t\t\treturn [];\n\t\t}\n\t\treturn electricCharacterSupport.getElectricCharacters();\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\tlet scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tlet electricCharacterSupport = this._getElectricCharacterSupport(scopedLineTokens.languageId);\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\t// end electricCharacter\n\n\tpublic getComments(languageId: LanguageId): ICommentsConfiguration | null {\n\t\tlet value = this._getRichEditSupport(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 characterPair\n\n\tprivate _getCharacterPairSupport(languageId: LanguageId): CharacterPairSupport | null {\n\t\tlet value = this._getRichEditSupport(languageId);\n\t\tif (!value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn value.characterPair || null;\n\t}\n\n\tpublic getAutoClosingPairs(languageId: LanguageId): IAutoClosingPair[] {\n\t\tlet characterPairSupport = this._getCharacterPairSupport(languageId);\n\t\tif (!characterPairSupport) {\n\t\t\treturn [];\n\t\t}\n\t\treturn characterPairSupport.getAutoClosingPairs();\n\t}\n\n\tpublic getAutoCloseBeforeSet(languageId: LanguageId): string {\n\t\tlet characterPairSupport = this._getCharacterPairSupport(languageId);\n\t\tif (!characterPairSupport) {\n\t\t\treturn CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED;\n\t\t}\n\t\treturn characterPairSupport.getAutoCloseBeforeSet();\n\t}\n\n\tpublic getSurroundingPairs(languageId: LanguageId): IAutoClosingPair[] {\n\t\tlet characterPairSupport = this._getCharacterPairSupport(languageId);\n\t\tif (!characterPairSupport) {\n\t\t\treturn [];\n\t\t}\n\t\treturn characterPairSupport.getSurroundingPairs();\n\t}\n\n\tpublic shouldAutoClosePair(character: string, context: LineTokens, column: number): boolean {\n\t\tlet scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tlet characterPairSupport = this._getCharacterPairSupport(scopedLineTokens.languageId);\n\t\tif (!characterPairSupport) {\n\t\t\treturn false;\n\t\t}\n\t\treturn characterPairSupport.shouldAutoClosePair(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset);\n\t}\n\n\t// end characterPair\n\n\tpublic getWordDefinition(languageId: LanguageId): RegExp {\n\t\tlet value = this._getRichEditSupport(languageId);\n\t\tif (!value) {\n\t\t\treturn ensureValidWordDefinition(null);\n\t\t}\n\t\treturn ensureValidWordDefinition(value.wordDefinition || null);\n\t}\n\n\tpublic getFoldingRules(languageId: LanguageId): FoldingRules {\n\t\tlet value = this._getRichEditSupport(languageId);\n\t\tif (!value) {\n\t\t\treturn {};\n\t\t}\n\t\treturn value.foldingRules;\n\t}\n\n\t// begin Indent Rules\n\n\tpublic getIndentRulesSupport(languageId: LanguageId): IndentRulesSupport | null {\n\t\tlet value = this._getRichEditSupport(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 preceiding 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\tlet 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\tlet 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(model: IVirtualModel, lineNumber: number, honorIntentialIndent: boolean = true): { indentation: string; action: IndentAction | null; line?: number; } | null {\n\t\tlet indentRulesSupport = this.getIndentRulesSupport(model.getLanguageIdentifier().id);\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\tlet 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\tlet precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine);\n\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\tlet previousLine = precedingUnIgnoredLine - 1;\n\n\t\t\tlet 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\tlet 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(virtualModel: IVirtualModel, languageId: LanguageId, lineNumber: number, indentConverter: IIndentConverter): string | null {\n\t\tlet indentRulesSupport = this.getIndentRulesSupport(languageId);\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet indent = this.getInheritIndentForLine(virtualModel, lineNumber);\n\t\tlet lineContent = virtualModel.getLineContent(lineNumber);\n\n\t\tif (indent) {\n\t\t\tlet inheritLine = indent.line;\n\t\t\tif (inheritLine !== undefined) {\n\t\t\t\tlet onEnterSupport = this._getOnEnterSupport(languageId);\n\t\t\t\tlet enterResult: EnterAction | null = null;\n\t\t\t\ttry {\n\t\t\t\t\tif (onEnterSupport) {\n\t\t\t\t\t\tenterResult = onEnterSupport.onEnter('', virtualModel.getLineContent(inheritLine), '');\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tonUnexpectedError(e);\n\t\t\t\t}\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(model: ITextModel, range: Range, indentConverter: IIndentConverter, autoIndent: boolean): { beforeEnter: string, afterEnter: string } | null {\n\t\tmodel.forceTokenization(range.startLineNumber);\n\t\tlet lineTokens = model.getLineTokens(range.startLineNumber);\n\n\t\tlet beforeEnterText;\n\t\tlet afterEnterText;\n\t\tlet scopedLineTokens = createScopedLineTokens(lineTokens, range.startColumn - 1);\n\t\tlet scopedLineText = scopedLineTokens.getLineContent();\n\n\t\tlet embeddedLanguage = false;\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\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 indentRulesSupport = this.getIndentRulesSupport(scopedLineTokens.languageId);\n\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet beforeEnterResult = beforeEnterText;\n\t\tlet beforeEnterIndent = strings.getLeadingWhitespace(beforeEnterText);\n\n\t\tif (!autoIndent && !embeddedLanguage) {\n\t\t\tlet beforeEnterIndentAction = this.getInheritIndentForLine(model, range.startLineNumber);\n\n\t\t\tif (indentRulesSupport.shouldDecrease(beforeEnterText)) {\n\t\t\t\tif (beforeEnterIndentAction) {\n\t\t\t\t\tbeforeEnterIndent = beforeEnterIndentAction.indentation;\n\t\t\t\t\tif (beforeEnterIndentAction.action !== IndentAction.Indent) {\n\t\t\t\t\t\tbeforeEnterIndent = indentConverter.unshiftIndent(beforeEnterIndent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbeforeEnterResult = beforeEnterIndent + strings.ltrim(strings.ltrim(beforeEnterText, ' '), '\\t');\n\t\t}\n\n\t\tlet virtualModel: IVirtualModel = {\n\t\t\tgetLineTokens: (lineNumber: number) => {\n\t\t\t\treturn model.getLineTokens(lineNumber);\n\t\t\t},\n\t\t\tgetLanguageIdentifier: () => {\n\t\t\t\treturn model.getLanguageIdentifier();\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\tlet currentLineIndent = strings.getLeadingWhitespace(lineTokens.getLineContent());\n\t\tlet afterEnterAction = this.getInheritIndentForLine(virtualModel, range.startLineNumber + 1);\n\t\tif (!afterEnterAction) {\n\t\t\tlet 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(model: ITextModel, range: Range, ch: string, indentConverter: IIndentConverter): string | null {\n\t\tlet scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn);\n\t\tlet indentRulesSupport = this.getIndentRulesSupport(scopedLineTokens.languageId);\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet scopedLineText = scopedLineTokens.getLineContent();\n\t\tlet beforeTypeText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\tlet afterTypeText;\n\n\t\t// selection support\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\tlet r = this.getInheritIndentForLine(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\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\tlet indentRulesSupport = this.getIndentRulesSupport(model.getLanguageIdentifier().id);\n\t\tif (!indentRulesSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (lineNumber < 1 || lineNumber > model.getLineCount()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn indentRulesSupport.getIndentMetadata(model.getLineContent(lineNumber));\n\t}\n\n\t// end Indent Rules\n\n\t// begin onEnter\n\n\tprivate _getOnEnterSupport(languageId: LanguageId): OnEnterSupport | null {\n\t\tlet value = this._getRichEditSupport(languageId);\n\t\tif (!value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn value.onEnter || null;\n\t}\n\n\tpublic getRawEnterActionAtPosition(model: ITextModel, lineNumber: number, column: number): EnterAction | null {\n\t\tlet r = this.getEnterAction(model, new Range(lineNumber, column, lineNumber, column));\n\n\t\treturn r ? r.enterAction : null;\n\t}\n\n\tpublic getEnterAction(model: ITextModel, range: Range): { enterAction: EnterAction; indentation: string; } | null {\n\t\tlet indentation = this.getIndentationAtPosition(model, range.startLineNumber, range.startColumn);\n\n\t\tlet scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn);\n\t\tlet onEnterSupport = this._getOnEnterSupport(scopedLineTokens.languageId);\n\t\tif (!onEnterSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet scopedLineText = scopedLineTokens.getLineContent();\n\t\tlet beforeEnterText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset);\n\t\tlet afterEnterText;\n\n\t\t// selection support\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 lineNumber = range.startLineNumber;\n\t\tlet oneLineAboveText = '';\n\n\t\tif (lineNumber > 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\tlet oneLineAboveScopedLineTokens = this.getScopedLineTokens(model, lineNumber - 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\toneLineAboveText = oneLineAboveScopedLineTokens.getLineContent();\n\t\t\t}\n\t\t}\n\n\t\tlet enterResult: EnterAction | null = null;\n\t\ttry {\n\t\t\tenterResult = onEnterSupport.onEnter(oneLineAboveText, beforeEnterText, afterEnterText);\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t}\n\n\t\tif (!enterResult) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t// Here we add `\\t` to appendText first because enterAction is leveraging appendText and removeText to change indentation.\n\t\t\tif (!enterResult.appendText) {\n\t\t\t\tif (\n\t\t\t\t\t(enterResult.indentAction === IndentAction.Indent) ||\n\t\t\t\t\t(enterResult.indentAction === IndentAction.IndentOutdent)\n\t\t\t\t) {\n\t\t\t\t\tenterResult.appendText = '\\t';\n\t\t\t\t} else {\n\t\t\t\t\tenterResult.appendText = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (enterResult.removeText) {\n\t\t\tindentation = indentation.substring(0, indentation.length - enterResult.removeText);\n\t\t}\n\n\t\treturn {\n\t\t\tenterAction: enterResult,\n\t\t\tindentation: indentation,\n\t\t};\n\t}\n\n\tpublic getIndentationAtPosition(model: ITextModel, lineNumber: number, column: number): string {\n\t\tlet 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\n\t\treturn indentation;\n\t}\n\n\tprivate getScopedLineTokens(model: ITextModel, lineNumber: number, columnNumber?: number) {\n\t\tmodel.forceTokenization(lineNumber);\n\t\tlet lineTokens = model.getLineTokens(lineNumber);\n\t\tlet column = (typeof columnNumber === 'undefined' ? model.getLineMaxColumn(lineNumber) - 1 : columnNumber - 1);\n\t\tlet scopedLineTokens = createScopedLineTokens(lineTokens, column);\n\t\treturn scopedLineTokens;\n\t}\n\n\t// end onEnter\n\n\tpublic getBracketsSupport(languageId: LanguageId): RichEditBrackets | null {\n\t\tlet value = this._getRichEditSupport(languageId);\n\t\tif (!value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn value.brackets || null;\n\t}\n}\n\nexport const LanguageConfigurationRegistry = new LanguageConfigurationRegistryImpl();\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/modes';\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;\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\tlet result: ParsedTokenThemeRule[] = [], resultLen = 0;\n\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\tlet 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\tlet segments = entry.fontStyle.split(' ');\n\t\t\tfor (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n\t\t\t\tlet 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}\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\tlet 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\tlet 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\tlet 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\tlet foregroundColorId = colorMap.getId(defaultForeground);\n\tlet backgroundColorId = colorMap.getId(defaultBackground);\n\n\tlet defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId);\n\tlet root = new ThemeTrieElement(defaults);\n\tfor (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n\t\tlet 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\tlet rule = this._match(token);\n\t\t\tlet 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\tlet 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;\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;\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\tlet 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\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\tlet 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: Color[]): string {\n\tlet rules: string[] = [];\n\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\tlet 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\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 { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ColorId, ITokenizationRegistry, ITokenizationSupport, ITokenizationSupportChangedEvent } from 'vs/editor/common/modes';\nimport { withUndefinedAsNull } from 'vs/base/common/types';\nimport { keys } from 'vs/base/common/map';\n\nexport class TokenizationRegistryImpl implements ITokenizationRegistry {\n\n\tprivate readonly _map = new Map<string, ITokenizationSupport>();\n\tprivate readonly _promises = new Map<string, Thenable<void>>();\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 registerPromise(language: string, supportPromise: Thenable<ITokenizationSupport | null>): IDisposable {\n\n\t\tlet registration: IDisposable | null = null;\n\t\tlet isDisposed: boolean = false;\n\n\t\tthis._promises.set(language, supportPromise.then(support => {\n\t\t\tthis._promises.delete(language);\n\t\t\tif (isDisposed || !support) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tregistration = this.register(language, support);\n\t\t}));\n\n\t\treturn toDisposable(() => {\n\t\t\tisDisposed = true;\n\t\t\tif (registration) {\n\t\t\t\tregistration.dispose();\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic getPromise(language: string): Thenable<ITokenizationSupport> | null {\n\t\tconst support = this.get(language);\n\t\tif (support) {\n\t\t\treturn Promise.resolve(support);\n\t\t}\n\t\tconst promise = this._promises.get(language);\n\t\tif (promise) {\n\t\t\treturn promise.then(_ => this.get(language)!);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic get(language: string): ITokenizationSupport | null {\n\t\treturn withUndefinedAsNull(this._map.get(language));\n\t}\n\n\tpublic setColorMap(colorMap: Color[]): void {\n\t\tthis._colorMap = colorMap;\n\t\tthis._onDidChange.fire({\n\t\t\tchangedLanguages: keys(this._map),\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","/*!\nCopyright (c) 2014 Taylor Hakes\nCopyright (c) 2014 Forbes Lindesay\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n\t\ttypeof define === 'function' && define.amd ? define(\"vs/editor/common/standalone/promise-polyfill/polyfill\", factory) :\n\t\t\t(factory());\n}(this, (function () {\n\t'use strict';\n\n\t/**\n\t * @this {Promise}\n\t */\n\tfunction finallyConstructor(callback) {\n\t\tvar constructor = this.constructor;\n\t\treturn this.then(\n\t\t\tfunction (value) {\n\t\t\t\treturn constructor.resolve(callback()).then(function () {\n\t\t\t\t\treturn value;\n\t\t\t\t});\n\t\t\t},\n\t\t\tfunction (reason) {\n\t\t\t\treturn constructor.resolve(callback()).then(function () {\n\t\t\t\t\treturn constructor.reject(reason);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\n\t// Store setTimeout reference so promise-polyfill will be unaffected by\n\t// other code modifying setTimeout (like sinon.useFakeTimers())\n\tvar setTimeoutFunc = setTimeout;\n\n\tfunction noop() { }\n\n\t// Polyfill for Function.prototype.bind\n\tfunction bind(fn, thisArg) {\n\t\treturn function () {\n\t\t\tfn.apply(thisArg, arguments);\n\t\t};\n\t}\n\n\t/**\n\t * @constructor\n\t * @param {Function} fn\n\t */\n\tfunction Promise(fn) {\n\t\tif (!(this instanceof Promise))\n\t\t\tthrow new TypeError('Promises must be constructed via new');\n\t\tif (typeof fn !== 'function') throw new TypeError('not a function');\n\t\t/** @type {!number} */\n\t\tthis._state = 0;\n\t\t/** @type {!boolean} */\n\t\tthis._handled = false;\n\t\t/** @type {Promise|undefined} */\n\t\tthis._value = undefined;\n\t\t/** @type {!Array<!Function>} */\n\t\tthis._deferreds = [];\n\n\t\tdoResolve(fn, this);\n\t}\n\n\tfunction handle(self, deferred) {\n\t\twhile (self._state === 3) {\n\t\t\tself = self._value;\n\t\t}\n\t\tif (self._state === 0) {\n\t\t\tself._deferreds.push(deferred);\n\t\t\treturn;\n\t\t}\n\t\tself._handled = true;\n\t\tPromise._immediateFn(function () {\n\t\t\tvar cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n\t\t\tif (cb === null) {\n\t\t\t\t(self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar ret;\n\t\t\ttry {\n\t\t\t\tret = cb(self._value);\n\t\t\t} catch (e) {\n\t\t\t\treject(deferred.promise, e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(deferred.promise, ret);\n\t\t});\n\t}\n\n\tfunction resolve(self, newValue) {\n\t\ttry {\n\t\t\t// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n\t\t\tif (newValue === self)\n\t\t\t\tthrow new TypeError('A promise cannot be resolved with itself.');\n\t\t\tif (\n\t\t\t\tnewValue &&\n\t\t\t\t(typeof newValue === 'object' || typeof newValue === 'function')\n\t\t\t) {\n\t\t\t\tvar then = newValue.then;\n\t\t\t\tif (newValue instanceof Promise) {\n\t\t\t\t\tself._state = 3;\n\t\t\t\t\tself._value = newValue;\n\t\t\t\t\tfinale(self);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (typeof then === 'function') {\n\t\t\t\t\tdoResolve(bind(then, newValue), self);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tself._state = 1;\n\t\t\tself._value = newValue;\n\t\t\tfinale(self);\n\t\t} catch (e) {\n\t\t\treject(self, e);\n\t\t}\n\t}\n\n\tfunction reject(self, newValue) {\n\t\tself._state = 2;\n\t\tself._value = newValue;\n\t\tfinale(self);\n\t}\n\n\tfunction finale(self) {\n\t\tif (self._state === 2 && self._deferreds.length === 0) {\n\t\t\tPromise._immediateFn(function () {\n\t\t\t\tif (!self._handled) {\n\t\t\t\t\tPromise._unhandledRejectionFn(self._value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor (var i = 0, len = self._deferreds.length; i < len; i++) {\n\t\t\thandle(self, self._deferreds[i]);\n\t\t}\n\t\tself._deferreds = null;\n\t}\n\n\t/**\n\t * @constructor\n\t */\n\tfunction Handler(onFulfilled, onRejected, promise) {\n\t\tthis.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n\t\tthis.onRejected = typeof onRejected === 'function' ? onRejected : null;\n\t\tthis.promise = promise;\n\t}\n\n\t/**\n\t * Take a potentially misbehaving resolver function and make sure\n\t * onFulfilled and onRejected are only called once.\n\t *\n\t * Makes no guarantees about asynchrony.\n\t */\n\tfunction doResolve(fn, self) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(\n\t\t\t\tfunction (value) {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\tresolve(self, value);\n\t\t\t\t},\n\t\t\t\tfunction (reason) {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\treject(self, reason);\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\treject(self, ex);\n\t\t}\n\t}\n\n\tPromise.prototype['catch'] = function (onRejected) {\n\t\treturn this.then(null, onRejected);\n\t};\n\n\tPromise.prototype.then = function (onFulfilled, onRejected) {\n\t\t// @ts-ignore\n\t\tvar prom = new this.constructor(noop);\n\n\t\thandle(this, new Handler(onFulfilled, onRejected, prom));\n\t\treturn prom;\n\t};\n\n\tPromise.prototype['finally'] = finallyConstructor;\n\n\tPromise.all = function (arr) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tif (!arr || typeof arr.length === 'undefined')\n\t\t\t\tthrow new TypeError('Promise.all accepts an array');\n\t\t\tvar args = Array.prototype.slice.call(arr);\n\t\t\tif (args.length === 0) return resolve([]);\n\t\t\tvar remaining = args.length;\n\n\t\t\tfunction res(i, val) {\n\t\t\t\ttry {\n\t\t\t\t\tif (val && (typeof val === 'object' || typeof val === 'function')) {\n\t\t\t\t\t\tvar then = val.then;\n\t\t\t\t\t\tif (typeof then === 'function') {\n\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\tval,\n\t\t\t\t\t\t\t\tfunction (val) {\n\t\t\t\t\t\t\t\t\tres(i, val);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\treject\n\t\t\t\t\t\t\t);\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\targs[i] = val;\n\t\t\t\t\tif (--remaining === 0) {\n\t\t\t\t\t\tresolve(args);\n\t\t\t\t\t}\n\t\t\t\t} catch (ex) {\n\t\t\t\t\treject(ex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < args.length; i++) {\n\t\t\t\tres(i, args[i]);\n\t\t\t}\n\t\t});\n\t};\n\n\tPromise.resolve = function (value) {\n\t\tif (value && typeof value === 'object' && value.constructor === Promise) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn new Promise(function (resolve) {\n\t\t\tresolve(value);\n\t\t});\n\t};\n\n\tPromise.reject = function (value) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\treject(value);\n\t\t});\n\t};\n\n\tPromise.race = function (values) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tfor (var i = 0, len = values.length; i < len; i++) {\n\t\t\t\tvalues[i].then(resolve, reject);\n\t\t\t}\n\t\t});\n\t};\n\n\t// Use polyfill for setImmediate for performance gains\n\tPromise._immediateFn =\n\t\t(typeof setImmediate === 'function' &&\n\t\t\tfunction (fn) {\n\t\t\t\tsetImmediate(fn);\n\t\t\t}) ||\n\t\tfunction (fn) {\n\t\t\tsetTimeoutFunc(fn, 0);\n\t\t};\n\n\tPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n\t\tif (typeof console !== 'undefined' && console) {\n\t\t\tconsole.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n\t\t}\n\t};\n\n\t/** @suppress {undefinedVars} */\n\tvar globalNS = (function () {\n\t\t// the only reliable means to get the global object is\n\t\t// `Function('return this')()`\n\t\t// However, this causes CSP violations in Chrome apps.\n\t\tif (typeof self !== 'undefined') {\n\t\t\treturn self;\n\t\t}\n\t\tif (typeof window !== 'undefined') {\n\t\t\treturn window;\n\t\t}\n\t\tif (typeof global !== 'undefined') {\n\t\t\treturn global;\n\t\t}\n\t\tthrow new Error('unable to locate global object');\n\t})();\n\n\tif (!('Promise' in globalNS)) {\n\t\tglobalNS['Promise'] = Promise;\n\t} else if (!globalNS.Promise.prototype['finally']) {\n\t\tglobalNS.Promise.prototype['finally'] = finallyConstructor;\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\n// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.\n\n\nexport enum MarkerTag {\n\tUnnecessary = 1\n}\n\nexport enum MarkerSeverity {\n\tHint = 1,\n\tInfo = 2,\n\tWarning = 4,\n\tError = 8\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 enum KeyCode {\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\tKEY_0 = 21,\n\tKEY_1 = 22,\n\tKEY_2 = 23,\n\tKEY_3 = 24,\n\tKEY_4 = 25,\n\tKEY_5 = 26,\n\tKEY_6 = 27,\n\tKEY_7 = 28,\n\tKEY_8 = 29,\n\tKEY_9 = 30,\n\tKEY_A = 31,\n\tKEY_B = 32,\n\tKEY_C = 33,\n\tKEY_D = 34,\n\tKEY_E = 35,\n\tKEY_F = 36,\n\tKEY_G = 37,\n\tKEY_H = 38,\n\tKEY_I = 39,\n\tKEY_J = 40,\n\tKEY_K = 41,\n\tKEY_L = 42,\n\tKEY_M = 43,\n\tKEY_N = 44,\n\tKEY_O = 45,\n\tKEY_P = 46,\n\tKEY_Q = 47,\n\tKEY_R = 48,\n\tKEY_S = 49,\n\tKEY_T = 50,\n\tKEY_U = 51,\n\tKEY_V = 52,\n\tKEY_W = 53,\n\tKEY_X = 54,\n\tKEY_Y = 55,\n\tKEY_Z = 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\tUS_SEMICOLON = 80,\n\t/**\n\t * For any country/region, the '+' key\n\t * For the US standard keyboard, the '=+' key\n\t */\n\tUS_EQUAL = 81,\n\t/**\n\t * For any country/region, the ',' key\n\t * For the US standard keyboard, the ',<' key\n\t */\n\tUS_COMMA = 82,\n\t/**\n\t * For any country/region, the '-' key\n\t * For the US standard keyboard, the '-_' key\n\t */\n\tUS_MINUS = 83,\n\t/**\n\t * For any country/region, the '.' key\n\t * For the US standard keyboard, the '.>' key\n\t */\n\tUS_DOT = 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\tUS_SLASH = 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\tUS_BACKTICK = 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\tUS_OPEN_SQUARE_BRACKET = 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\tUS_BACKSLASH = 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\tUS_CLOSE_SQUARE_BRACKET = 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\tUS_QUOTE = 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\tOEM_102 = 92,\n\tNUMPAD_0 = 93,\n\tNUMPAD_1 = 94,\n\tNUMPAD_2 = 95,\n\tNUMPAD_3 = 96,\n\tNUMPAD_4 = 97,\n\tNUMPAD_5 = 98,\n\tNUMPAD_6 = 99,\n\tNUMPAD_7 = 100,\n\tNUMPAD_8 = 101,\n\tNUMPAD_9 = 102,\n\tNUMPAD_MULTIPLY = 103,\n\tNUMPAD_ADD = 104,\n\tNUMPAD_SEPARATOR = 105,\n\tNUMPAD_SUBTRACT = 106,\n\tNUMPAD_DECIMAL = 107,\n\tNUMPAD_DIVIDE = 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\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 = 112\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 ScrollbarVisibility {\n\tAuto = 1,\n\tHidden = 2,\n\tVisible = 3\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\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 * 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 * 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 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\nexport enum ScrollType {\n\tSmooth = 0,\n\tImmediate = 1\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\nexport enum RenderMinimap {\n\tNone = 0,\n\tSmall = 1,\n\tLarge = 2,\n\tSmallBlocks = 3,\n\tLargeBlocks = 4\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\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\nexport enum RenderLineNumbersType {\n\tOff = 0,\n\tOn = 1,\n\tRelative = 2,\n\tInterval = 3,\n\tCustom = 4\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 * 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 * 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 * 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 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\tSnippet = 25\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\n/**\n * How a suggest provider was triggered.\n */\nexport enum CompletionTriggerKind {\n\tInvoke = 0,\n\tTriggerCharacter = 1,\n\tTriggerForIncompleteCompletions = 2\n}\n\nexport enum SignatureHelpTriggerKind {\n\tInvoke = 1,\n\tTriggerCharacter = 2,\n\tContentChange = 3\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 * 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 * Copyright (c) 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/standalone/promise-polyfill/polyfill';\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/core/token';\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\nconst enum Constants {\n\tMINIMUM_HEIGHT = 4\n}\n\nexport class ColorZone {\n\t_colorZoneBrand: void;\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;\n\n\tpublic readonly startLineNumber: number;\n\tpublic readonly endLineNumber: 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\tcolor: string\n\t) {\n\t\tthis.startLineNumber = startLineNumber;\n\t\tthis.endLineNumber = endLineNumber;\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\treturn a.endLineNumber - b.endLineNumber;\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); // @perf\n\t\tconst totalHeight = Math.floor(this.getCanvasHeight()); // @perf\n\t\tconst outerHeight = Math.floor(this._outerHeight); // @perf\n\t\tconst heightRatio = totalHeight / outerHeight;\n\t\tconst halfMinimumHeight = Math.floor(Constants.MINIMUM_HEIGHT * this._pixelRatio / 2);\n\n\t\tlet 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 y1 = Math.floor(heightRatio * (this._getVerticalOffsetForLine(zone.startLineNumber)));\n\t\t\tconst y2 = Math.floor(heightRatio * (this._getVerticalOffsetForLine(zone.endLineNumber) + lineHeight));\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 { 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/viewModel';\n\nexport interface IViewLines {\n\tlinesVisibleRangesForRange(range: Range, includeNewLines: boolean): LineVisibleRanges[] | null;\n\tvisibleRangeForPosition(position: Position): HorizontalRange | null;\n}\n\nexport abstract class RestrictedRenderingContext {\n\t_restrictedRenderingContextBrand: void;\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;\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): HorizontalRange | null {\n\t\treturn this._viewLines.visibleRangeForPosition(position);\n\t}\n}\n\nexport class LineVisibleRanges {\n\t_lineVisibleRangesBrand: void;\n\n\tpublic lineNumber: number;\n\tpublic ranges: HorizontalRange[];\n\n\tconstructor(lineNumber: number, ranges: HorizontalRange[]) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.ranges = ranges;\n\t}\n}\n\nexport class HorizontalRange {\n\t_horizontalRangeBrand: void;\n\n\tpublic left: number;\n\tpublic width: number;\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/editor/common/core/uint';\nimport { HorizontalRange } from 'vs/editor/common/view/renderingContext';\n\nclass FloatHorizontalRange {\n\t_floatHorizontalRangeBrand: void;\n\n\tpublic readonly left: number;\n\tpublic readonly 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 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): ClientRectList | 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[]): HorizontalRange[] {\n\t\tif (ranges.length === 1) {\n\t\t\t// There is nothing to merge\n\t\t\treturn [new HorizontalRange(ranges[0].left, ranges[0].width)];\n\t\t}\n\n\t\tranges.sort(FloatHorizontalRange.compare);\n\n\t\tlet result: HorizontalRange[] = [], resultLen = 0;\n\t\tlet prevLeft = ranges[0].left;\n\t\tlet prevWidth = ranges[0].width;\n\n\t\tfor (let i = 1, len = ranges.length; i < len; i++) {\n\t\t\tconst range = ranges[i];\n\t\t\tconst myLeft = range.left;\n\t\t\tconst myWidth = range.width;\n\n\t\t\tif (prevLeft + prevWidth + 0.9 /* account for browser's rounding errors*/ >= myLeft) {\n\t\t\t\tprevWidth = Math.max(prevWidth, myLeft + myWidth - prevLeft);\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = new HorizontalRange(prevLeft, prevWidth);\n\t\t\t\tprevLeft = myLeft;\n\t\t\t\tprevWidth = myWidth;\n\t\t\t}\n\t\t}\n\n\t\tresult[resultLen++] = new HorizontalRange(prevLeft, prevWidth);\n\n\t\treturn result;\n\t}\n\n\tprivate static _createHorizontalRangesFromClientRects(clientRects: ClientRectList | DOMRectList | null, clientRectDeltaLeft: number): HorizontalRange[] | 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), clientRect.width);\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, endNode: HTMLElement): HorizontalRange[] | 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\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 = Number.MAX_VALUE;\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);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IConfiguration } from 'vs/editor/common/editorCommon';\nimport { ViewEventDispatcher } from 'vs/editor/common/view/viewEventDispatcher';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler';\nimport { IViewLayout, IViewModel } from 'vs/editor/common/viewModel/viewModel';\nimport { ITheme } from 'vs/platform/theme/common/themeService';\n\nexport class ViewContext {\n\n\tpublic readonly configuration: IConfiguration;\n\tpublic readonly model: IViewModel;\n\tpublic readonly viewLayout: IViewLayout;\n\tpublic readonly privateViewEventBus: ViewEventDispatcher;\n\n\tpublic theme: ITheme; // will be updated\n\n\tconstructor(\n\t\tconfiguration: IConfiguration,\n\t\ttheme: ITheme,\n\t\tmodel: IViewModel,\n\t\tprivateViewEventBus: ViewEventDispatcher\n\t) {\n\t\tthis.configuration = configuration;\n\t\tthis.theme = theme;\n\t\tthis.model = model;\n\t\tthis.viewLayout = model.viewLayout;\n\t\tthis.privateViewEventBus = privateViewEventBus;\n\t}\n\n\tpublic addEventHandler(eventHandler: ViewEventHandler): void {\n\t\tthis.privateViewEventBus.addEventHandler(eventHandler);\n\t}\n\n\tpublic removeEventHandler(eventHandler: ViewEventHandler): void {\n\t\tthis.privateViewEventBus.removeEventHandler(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 { ViewEvent } from 'vs/editor/common/view/viewEvents';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler';\n\nexport class ViewEventDispatcher {\n\n\tprivate readonly _eventHandlerGateKeeper: (callback: () => void) => void;\n\tprivate readonly _eventHandlers: ViewEventHandler[];\n\tprivate _eventQueue: ViewEvent[] | null;\n\tprivate _isConsumingQueue: boolean;\n\n\tconstructor(eventHandlerGateKeeper: (callback: () => void) => void) {\n\t\tthis._eventHandlerGateKeeper = eventHandlerGateKeeper;\n\t\tthis._eventHandlers = [];\n\t\tthis._eventQueue = null;\n\t\tthis._isConsumingQueue = false;\n\t}\n\n\tpublic addEventHandler(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 removeEventHandler(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 emit(event: ViewEvent): void {\n\n\t\tif (this._eventQueue) {\n\t\t\tthis._eventQueue.push(event);\n\t\t} else {\n\t\t\tthis._eventQueue = [event];\n\t\t}\n\n\t\tif (!this._isConsumingQueue) {\n\t\t\tthis.consumeQueue();\n\t\t}\n\t}\n\n\tpublic emitMany(events: ViewEvent[]): void {\n\t\tif (this._eventQueue) {\n\t\t\tthis._eventQueue = this._eventQueue.concat(events);\n\t\t} else {\n\t\t\tthis._eventQueue = events;\n\t\t}\n\n\t\tif (!this._isConsumingQueue) {\n\t\t\tthis.consumeQueue();\n\t\t}\n\t}\n\n\tprivate consumeQueue(): void {\n\t\tthis._eventHandlerGateKeeper(() => {\n\t\t\ttry {\n\t\t\t\tthis._isConsumingQueue = true;\n\n\t\t\t\tthis._doConsumeQueue();\n\n\t\t\t} finally {\n\t\t\t\tthis._isConsumingQueue = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _doConsumeQueue(): void {\n\t\twhile (this._eventQueue) {\n\t\t\t// Empty event queue, as events might come in while sending these off\n\t\t\tlet events = this._eventQueue;\n\t\t\tthis._eventQueue = null;\n\n\t\t\t// Use a clone of the event handlers list, as they might remove themselves\n\t\t\tlet eventHandlers = this._eventHandlers.slice(0);\n\t\t\tfor (let i = 0, len = eventHandlers.length; i < len; i++) {\n\t\t\t\teventHandlers[i].handleEvents(events);\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 errors from 'vs/base/common/errors';\nimport { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ScrollEvent } from 'vs/base/common/scrollable';\nimport { IConfigurationChangedEvent } 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';\n\nexport const enum ViewEventType {\n\tViewConfigurationChanged = 1,\n\tViewCursorStateChanged = 2,\n\tViewDecorationsChanged = 3,\n\tViewFlushed = 4,\n\tViewFocusChanged = 5,\n\tViewLineMappingChanged = 6,\n\tViewLinesChanged = 7,\n\tViewLinesDeleted = 8,\n\tViewLinesInserted = 9,\n\tViewRevealRangeRequest = 10,\n\tViewScrollChanged = 11,\n\tViewTokensChanged = 12,\n\tViewTokensColorsChanged = 13,\n\tViewZonesChanged = 14,\n\tViewThemeChanged = 15,\n\tViewLanguageConfigurationChanged = 16\n}\n\nexport class ViewConfigurationChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewConfigurationChanged;\n\n\tpublic readonly canUseLayerHinting: boolean;\n\tpublic readonly pixelRatio: boolean;\n\tpublic readonly editorClassName: boolean;\n\tpublic readonly lineHeight: boolean;\n\tpublic readonly readOnly: boolean;\n\tpublic readonly accessibilitySupport: boolean;\n\tpublic readonly emptySelectionClipboard: boolean;\n\tpublic readonly copyWithSyntaxHighlighting: boolean;\n\tpublic readonly layoutInfo: boolean;\n\tpublic readonly fontInfo: boolean;\n\tpublic readonly viewInfo: boolean;\n\tpublic readonly wrappingInfo: boolean;\n\n\tconstructor(source: IConfigurationChangedEvent) {\n\t\tthis.canUseLayerHinting = source.canUseLayerHinting;\n\t\tthis.pixelRatio = source.pixelRatio;\n\t\tthis.editorClassName = source.editorClassName;\n\t\tthis.lineHeight = source.lineHeight;\n\t\tthis.readOnly = source.readOnly;\n\t\tthis.accessibilitySupport = source.accessibilitySupport;\n\t\tthis.emptySelectionClipboard = source.emptySelectionClipboard;\n\t\tthis.copyWithSyntaxHighlighting = source.copyWithSyntaxHighlighting;\n\t\tthis.layoutInfo = source.layoutInfo;\n\t\tthis.fontInfo = source.fontInfo;\n\t\tthis.viewInfo = source.viewInfo;\n\t\tthis.wrappingInfo = source.wrappingInfo;\n\t}\n}\n\nexport class ViewCursorStateChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewCursorStateChanged;\n\n\t/**\n\t * The primary selection is always at index 0.\n\t */\n\tpublic readonly selections: Selection[];\n\n\tconstructor(selections: Selection[]) {\n\t\tthis.selections = selections;\n\t}\n}\n\nexport class ViewDecorationsChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewDecorationsChanged;\n\n\tconstructor() {\n\t\t// Nothing to do\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 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}\n\nexport class ViewRevealRangeRequestEvent {\n\n\tpublic readonly type = ViewEventType.ViewRevealRangeRequest;\n\n\t/**\n\t * Range to be reavealed.\n\t */\n\tpublic readonly range: Range;\n\n\tpublic readonly verticalType: VerticalRevealType;\n\t/**\n\t * If true: there should be a horizontal & vertical revealing\n\t * If false: there should be just a vertical revealing\n\t */\n\tpublic readonly revealHorizontal: boolean;\n\n\tpublic readonly scrollType: ScrollType;\n\n\tconstructor(range: Range, verticalType: VerticalRevealType, revealHorizontal: boolean, scrollType: ScrollType) {\n\t\tthis.range = range;\n\t\tthis.verticalType = verticalType;\n\t\tthis.revealHorizontal = revealHorizontal;\n\t\tthis.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 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 ViewThemeChangedEvent {\n\n\tpublic readonly type = ViewEventType.ViewThemeChanged;\n\n\tconstructor() {\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 class ViewLanguageConfigurationEvent {\n\n\tpublic readonly type = ViewEventType.ViewLanguageConfigurationChanged;\n\n\tconstructor() {\n\t}\n}\n\nexport type ViewEvent = (\n\tViewConfigurationChangedEvent\n\t| ViewCursorStateChangedEvent\n\t| ViewDecorationsChangedEvent\n\t| ViewFlushedEvent\n\t| ViewFocusChangedEvent\n\t| ViewLinesChangedEvent\n\t| ViewLineMappingChangedEvent\n\t| ViewLinesDeletedEvent\n\t| ViewLinesInsertedEvent\n\t| ViewRevealRangeRequestEvent\n\t| ViewScrollChangedEvent\n\t| ViewTokensChangedEvent\n\t| ViewTokensColorsChangedEvent\n\t| ViewZonesChangedEvent\n\t| ViewThemeChangedEvent\n\t| ViewLanguageConfigurationEvent\n);\n\nexport interface IViewEventListener {\n\t(events: ViewEvent[]): void;\n}\n\nexport class ViewEventEmitter extends Disposable {\n\tprivate _listeners: IViewEventListener[];\n\tprivate _collector: ViewEventsCollector | null;\n\tprivate _collectorCnt: number;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._listeners = [];\n\t\tthis._collector = null;\n\t\tthis._collectorCnt = 0;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._listeners = [];\n\t\tsuper.dispose();\n\t}\n\n\tprotected _beginEmit(): ViewEventsCollector {\n\t\tthis._collectorCnt++;\n\t\tif (this._collectorCnt === 1) {\n\t\t\tthis._collector = new ViewEventsCollector();\n\t\t}\n\t\treturn this._collector!;\n\t}\n\n\tprotected _endEmit(): void {\n\t\tthis._collectorCnt--;\n\t\tif (this._collectorCnt === 0) {\n\t\t\tconst events = this._collector!.finalize();\n\t\t\tthis._collector = null;\n\t\t\tif (events.length > 0) {\n\t\t\t\tthis._emit(events);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _emit(events: ViewEvent[]): void {\n\t\tconst listeners = this._listeners.slice(0);\n\t\tfor (let i = 0, len = listeners.length; i < len; i++) {\n\t\t\tsafeInvokeListener(listeners[i], events);\n\t\t}\n\t}\n\n\tpublic addEventListener(listener: (events: ViewEvent[]) => void): IDisposable {\n\t\tthis._listeners.push(listener);\n\t\treturn toDisposable(() => {\n\t\t\tlet listeners = this._listeners;\n\t\t\tfor (let i = 0, len = listeners.length; i < len; i++) {\n\t\t\t\tif (listeners[i] === listener) {\n\t\t\t\t\tlisteners.splice(i, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class ViewEventsCollector {\n\n\tprivate _events: ViewEvent[];\n\tprivate _eventsLen = 0;\n\n\tconstructor() {\n\t\tthis._events = [];\n\t\tthis._eventsLen = 0;\n\t}\n\n\tpublic emit(event: ViewEvent) {\n\t\tthis._events[this._eventsLen++] = event;\n\t}\n\n\tpublic finalize(): ViewEvent[] {\n\t\tlet result = this._events;\n\t\tthis._events = [];\n\t\treturn result;\n\t}\n\n}\n\nfunction safeInvokeListener(listener: IViewEventListener, events: ViewEvent[]): void {\n\ttry {\n\t\tlistener(events);\n\t} catch (e) {\n\t\terrors.onUnexpectedError(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 strings from 'vs/base/common/strings';\nimport { Constants } from 'vs/editor/common/core/uint';\nimport { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel/viewModel';\n\nexport class LineDecoration {\n\t_lineDecorationBrand: void;\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\tlet aLen = a.length;\n\t\tlet 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 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\tlet result: LineDecoration[] = [], resultLen = 0;\n\n\t\tfor (let i = 0, len = lineDecorations.length; i < len; i++) {\n\t\t\tlet d = lineDecorations[i];\n\t\t\tlet 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\tlet startColumn = (range.startLineNumber === lineNumber ? range.startColumn : minLineColumn);\n\t\t\tlet 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\tpublic static compare(a: LineDecoration, b: LineDecoration): number {\n\t\tif (a.startColumn === b.startColumn) {\n\t\t\tif (a.endColumn === b.endColumn) {\n\t\t\t\tif (a.className < b.className) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif (a.className > b.className) {\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 a.endColumn - b.endColumn;\n\t\t}\n\t\treturn a.startColumn - b.startColumn;\n\t}\n}\n\nexport class DecorationSegment {\n\tstartOffset: number;\n\tendOffset: number;\n\tclassName: string;\n\n\tconstructor(startOffset: number, endOffset: number, className: string) {\n\t\tthis.startOffset = startOffset;\n\t\tthis.endOffset = endOffset;\n\t\tthis.className = className;\n\t}\n}\n\nclass Stack {\n\tpublic count: number;\n\tprivate readonly stopOffsets: number[];\n\tprivate readonly classNames: string[];\n\n\tconstructor() {\n\t\tthis.stopOffsets = [];\n\t\tthis.classNames = [];\n\t\tthis.count = 0;\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(' ')));\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.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(' ')));\n\t\t\tnextStartOffset = maxStopOffset;\n\t\t}\n\n\t\treturn nextStartOffset;\n\t}\n\n\tpublic insert(stopOffset: number, className: string): 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} 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\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\tlet result: DecorationSegment[] = [];\n\n\t\tlet stack = new Stack();\n\t\tlet nextStartOffset = 0;\n\n\t\tfor (let i = 0, len = lineDecorations.length; i < len; i++) {\n\t\t\tlet d = lineDecorations[i];\n\t\t\tlet startColumn = d.startColumn;\n\t\t\tlet endColumn = d.endColumn;\n\t\t\tlet className = d.className;\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\tlet currentStartOffset = startColumn - 1;\n\t\t\tlet 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);\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { IViewLineTokens } from 'vs/editor/common/core/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/viewModel';\n\nexport const enum RenderWhitespace {\n\tNone = 0,\n\tBoundary = 1,\n\tAll = 2\n}\n\nclass LinePart {\n\t_linePartBrand: void;\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\n\tconstructor(endIndex: number, type: string) {\n\t\tthis.endIndex = endIndex;\n\t\tthis.type = type;\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 spaceWidth: number;\n\tpublic readonly stopRenderingLineAfter: number;\n\tpublic readonly renderWhitespace: RenderWhitespace;\n\tpublic readonly renderControlCharacters: boolean;\n\tpublic readonly fontLigatures: boolean;\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\tspaceWidth: number,\n\t\tstopRenderingLineAfter: number,\n\t\trenderWhitespace: 'none' | 'boundary' | 'all',\n\t\trenderControlCharacters: boolean,\n\t\tfontLigatures: boolean\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;\n\t\tthis.tabSize = tabSize;\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.None\n\t\t);\n\t\tthis.renderControlCharacters = renderControlCharacters;\n\t\tthis.fontLigatures = fontLigatures;\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.spaceWidth === other.spaceWidth\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);\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\n/**\n * Provides a both direction mapping between a line's character and its rendered position.\n */\nexport class CharacterMapping {\n\n\tpublic static getPartIndex(partData: number): number {\n\t\treturn (partData & CharacterMappingConstants.PART_INDEX_MASK) >>> CharacterMappingConstants.PART_INDEX_OFFSET;\n\t}\n\n\tpublic 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 setPartData(charOffset: number, partIndex: number, charIndex: number, partAbsoluteOffset: number): void {\n\t\tlet 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[charOffset] = partData;\n\t\tthis._absoluteOffsets[charOffset] = partAbsoluteOffset + charIndex;\n\t}\n\n\tpublic getAbsoluteOffsets(): Uint32Array {\n\t\treturn this._absoluteOffsets;\n\t}\n\n\tpublic 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 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\tlet 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\tlet mid = ((min + max) >>> 1);\n\t\t\tlet 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\tlet minEntry = this._data[min];\n\t\tlet 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\tlet minPartIndex = CharacterMapping.getPartIndex(minEntry);\n\t\tlet minCharIndex = CharacterMapping.getCharIndex(minEntry);\n\n\t\tlet 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\tlet minEntryDistance = charIndex - minCharIndex;\n\t\tlet 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;\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\tlet containsForeignElements = ForeignElementType.None;\n\n\t\t// This is basically for IE's hit test to work\n\t\tlet content: string = '<span><span>\\u00a0</span></span>';\n\n\t\tif (input.lineDecorations.length > 0) {\n\t\t\t// This line is empty, but it contains inline decorations\n\t\t\tlet classNames: string[] = [];\n\t\t\tfor (let i = 0, len = input.lineDecorations.length; i < len; i++) {\n\t\t\t\tconst lineDecoration = input.lineDecorations[i];\n\t\t\t\tif (lineDecoration.type === InlineDecorationType.Before) {\n\t\t\t\t\tclassNames.push(input.lineDecorations[i].className);\n\t\t\t\t\tcontainsForeignElements |= ForeignElementType.Before;\n\t\t\t\t}\n\t\t\t\tif (lineDecoration.type === InlineDecorationType.After) {\n\t\t\t\t\tclassNames.push(input.lineDecorations[i].className);\n\t\t\t\t\tcontainsForeignElements |= ForeignElementType.After;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (containsForeignElements !== ForeignElementType.None) {\n\t\t\t\tcontent = `<span><span class=\"${classNames.join(' ')}\"></span></span>`;\n\t\t\t}\n\t\t}\n\n\t\tsb.appendASCIIString(content);\n\t\treturn new RenderLineOutput(\n\t\t\tnew CharacterMapping(0, 0),\n\t\t\tfalse,\n\t\t\tcontainsForeignElements\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\tlet sb = createStringBuilder(10000);\n\tlet 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 tabSize: number,\n\t\tpublic readonly containsRTL: boolean,\n\t\tpublic readonly spaceWidth: 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 useMonospaceOptimizations = input.useMonospaceOptimizations;\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.renderWhitespace === RenderWhitespace.All || input.renderWhitespace === RenderWhitespace.Boundary) {\n\t\ttokens = _applyRenderWhitespace(lineContent, len, input.continuesWithWrappedLine, tokens, input.fauxIndentLength, input.tabSize, useMonospaceOptimizations, input.renderWhitespace === RenderWhitespace.Boundary);\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\tuseMonospaceOptimizations,\n\t\tinput.canUseHalfwidthRightwardsArrow,\n\t\tlineContent,\n\t\tlen,\n\t\tisOverflowing,\n\t\ttokens,\n\t\tcontainsForeignElements,\n\t\tinput.tabSize,\n\t\tinput.containsRTL,\n\t\tinput.spaceWidth,\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\tlet result: LinePart[] = [], 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, '');\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);\n\t\t\tbreak;\n\t\t}\n\t\tresult[resultLen++] = new LinePart(endIndex, type);\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\tlet result: LinePart[] = [], 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\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);\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);\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\tlet diff = (tokenEndIndex - lastTokenEndIndex);\n\t\t\tif (diff > Constants.LongToken) {\n\t\t\t\tconst tokenType = token.type;\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\tlet pieceEndIndex = lastTokenEndIndex + (j * Constants.LongToken);\n\t\t\t\t\tresult[resultLen++] = new LinePart(pieceEndIndex, tokenType);\n\t\t\t\t}\n\t\t\t\tresult[resultLen++] = new LinePart(tokenEndIndex, tokenType);\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\n/**\n * Whitespace is rendered by \"replacing\" tokens with a special-purpose `vs-whitespace` 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(lineContent: string, len: number, continuesWithWrappedLine: boolean, tokens: LinePart[], fauxIndentLength: number, tabSize: number, useMonospaceOptimizations: boolean, onlyBoundary: boolean): LinePart[] {\n\n\tlet result: LinePart[] = [], 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 firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n\tlet lastNonWhitespaceIndex: number;\n\tif (firstNonWhitespaceIndex === -1) {\n\t\t// The entire line is whitespace\n\t\tfirstNonWhitespaceIndex = len;\n\t\tlastNonWhitespaceIndex = len;\n\t} else {\n\t\tlastNonWhitespaceIndex = strings.lastNonWhitespaceIndex(lineContent);\n\t}\n\n\tlet tmpIndent = 0;\n\tfor (let charIndex = 0; charIndex < fauxIndentLength; charIndex++) {\n\t\tconst chCode = lineContent.charCodeAt(charIndex);\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\t}\n\ttmpIndent = tmpIndent % tabSize;\n\n\tlet wasInWhitespace = false;\n\tfor (let charIndex = fauxIndentLength; charIndex < len; charIndex++) {\n\t\tconst chCode = lineContent.charCodeAt(charIndex);\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\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\tresult[resultLen++] = new LinePart(charIndex, 'vs-whitespace');\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);\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\tif (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}\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\tlet lastCharCode = (len > 0 ? lineContent.charCodeAt(len - 1) : CharCode.Null);\n\t\t\tlet prevCharCode = (len > 1 ? lineContent.charCodeAt(len - 2) : CharCode.Null);\n\t\t\tlet 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\tresult[resultLen++] = new LinePart(len, generateWhitespace ? 'vs-whitespace' : tokenType);\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\tlet result: LinePart[] = [], resultLen = 0, 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\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);\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);\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);\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);\n\t\t}\n\t}\n\n\tconst lastTokenEndIndex = tokens[tokens.length - 1].endIndex;\n\tif (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {\n\t\tlet classNames: string[] = [];\n\t\twhile (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {\n\t\t\tclassNames.push(lineDecorations[lineDecorationIndex].className);\n\t\t\tlineDecorationIndex++;\n\t\t}\n\t\tresult[resultLen++] = new LinePart(lastResultEndIndex, classNames.join(' '));\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 tabSize = input.tabSize;\n\tconst containsRTL = input.containsRTL;\n\tconst spaceWidth = input.spaceWidth;\n\tconst renderWhitespace = input.renderWhitespace;\n\tconst renderControlCharacters = input.renderControlCharacters;\n\n\tconst characterMapping = new CharacterMapping(len + 1, parts.length);\n\n\tlet charIndex = 0;\n\tlet tabsCharDelta = 0;\n\tlet charOffsetInPart = 0;\n\n\tlet prevPartContentCnt = 0;\n\tlet partAbsoluteOffset = 0;\n\n\tsb.appendASCIIString('<span>');\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 && (partType.indexOf('vs-whitespace') >= 0));\n\t\tcharOffsetInPart = 0;\n\n\t\tsb.appendASCIIString('<span class=\"');\n\t\tsb.appendASCIIString(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 _tabsCharDelta = tabsCharDelta;\n\n\t\t\t\tfor (; _charIndex < partEndIndex; _charIndex++) {\n\t\t\t\t\tconst charCode = lineContent.charCodeAt(_charIndex);\n\n\t\t\t\t\tif (charCode === CharCode.Tab) {\n\t\t\t\t\t\tlet insertSpacesCount = tabSize - (_charIndex + _tabsCharDelta) % tabSize;\n\t\t\t\t\t\t_tabsCharDelta += insertSpacesCount - 1;\n\t\t\t\t\t\tpartContentCnt += insertSpacesCount;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// must be CharCode.Space\n\t\t\t\t\t\tpartContentCnt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!fontIsMonospace) {\n\t\t\t\tconst partIsOnlyWhitespace = (partType === 'vs-whitespace');\n\t\t\t\tif (partIsOnlyWhitespace || !containsForeignElements) {\n\t\t\t\t\tsb.appendASCIIString(' style=\"width:');\n\t\t\t\t\tsb.appendASCIIString(String(spaceWidth * partContentCnt));\n\t\t\t\t\tsb.appendASCIIString('px\"');\n\t\t\t\t}\n\t\t\t}\n\t\t\tsb.appendASCII(CharCode.GreaterThan);\n\n\t\t\tfor (; charIndex < partEndIndex; charIndex++) {\n\t\t\t\tcharacterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\n\t\t\t\tconst charCode = lineContent.charCodeAt(charIndex);\n\n\t\t\t\tif (charCode === 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\tcharOffsetInPart += insertSpacesCount - 1;\n\t\t\t\t\tif (insertSpacesCount > 0) {\n\t\t\t\t\t\tif (!canUseHalfwidthRightwardsArrow || insertSpacesCount > 1) {\n\t\t\t\t\t\t\tsb.write1(0x2192); // RIGHTWARDS ARROW\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW\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\twhile (insertSpacesCount > 0) {\n\t\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t\t\tinsertSpacesCount--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// must be CharCode.Space\n\t\t\t\t\tsb.write1(0xB7); // ·\n\t\t\t\t}\n\n\t\t\t\tcharOffsetInPart++;\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\tif (containsRTL) {\n\t\t\t\tsb.appendASCIIString(' dir=\"ltr\"');\n\t\t\t}\n\t\t\tsb.appendASCII(CharCode.GreaterThan);\n\n\t\t\tfor (; charIndex < partEndIndex; charIndex++) {\n\t\t\t\tcharacterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\n\t\t\t\tconst charCode = lineContent.charCodeAt(charIndex);\n\n\t\t\t\tswitch (charCode) {\n\t\t\t\t\tcase CharCode.Tab:\n\t\t\t\t\t\tlet insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize;\n\t\t\t\t\t\ttabsCharDelta += insertSpacesCount - 1;\n\t\t\t\t\t\tcharOffsetInPart += insertSpacesCount - 1;\n\t\t\t\t\t\twhile (insertSpacesCount > 0) {\n\t\t\t\t\t\t\tsb.write1(0xA0); // \n\t\t\t\t\t\t\tpartContentCnt++;\n\t\t\t\t\t\t\tinsertSpacesCount--;\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\tpartContentCnt++;\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\tpartContentCnt++;\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\tpartContentCnt++;\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\tpartContentCnt++;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase CharCode.Null:\n\t\t\t\t\t\tsb.appendASCIIString('�');\n\t\t\t\t\t\tpartContentCnt++;\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_2028:\n\t\t\t\t\t\tsb.write1(0xFFFD);\n\t\t\t\t\t\tpartContentCnt++;\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\ttabsCharDelta++;\n\t\t\t\t\t\t}\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\tpartContentCnt++;\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\tpartContentCnt++;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcharOffsetInPart++;\n\t\t\t}\n\n\t\t\tprevPartContentCnt = partContentCnt;\n\t\t}\n\n\t\tsb.appendASCIIString('</span>');\n\n\t}\n\n\t// When getting client rects for the last character, we will position the\n\t// text range at the end of the span, insteaf of at the beginning of next span\n\tcharacterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IViewModel, IViewWhitespaceViewportData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel';\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\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\nexport interface IEditorWhitespace {\n\treadonly id: number;\n\treadonly afterLineNumber: number;\n\treadonly heightInLines: number;\n}\n\n/**\n * Represent whitespaces in between lines and provide fast CRUD management methods.\n * The whitespaces are sorted ascending by `afterLineNumber`.\n */\nexport class WhitespaceComputer {\n\n\t/**\n\t * heights[i] is the height in pixels for whitespace at index i\n\t */\n\tprivate readonly _heights: number[];\n\n\t/**\n\t * minWidths[i] is the min width in pixels for whitespace at index i\n\t */\n\tprivate readonly _minWidths: number[];\n\n\t/**\n\t * afterLineNumbers[i] is the line number whitespace at index i is after\n\t */\n\tprivate readonly _afterLineNumbers: number[];\n\n\t/**\n\t * ordinals[i] is the orinal of the whitespace at index i\n\t */\n\tprivate readonly _ordinals: number[];\n\n\t/**\n\t * prefixSum[i] = SUM(heights[j]), 1 <= j <= i\n\t */\n\tprivate readonly _prefixSum: number[];\n\n\t/**\n\t * prefixSum[i], 1 <= i <= prefixSumValidIndex can be trusted\n\t */\n\tprivate _prefixSumValidIndex: number;\n\n\t/**\n\t * ids[i] is the whitespace id of whitespace at index i\n\t */\n\tprivate readonly _ids: number[];\n\n\t/**\n\t * index at which a whitespace is positioned (inside heights, afterLineNumbers, prefixSum members)\n\t */\n\tprivate readonly _whitespaceId2Index: {\n\t\t[id: string]: number;\n\t};\n\n\t/**\n\t * last whitespace id issued\n\t */\n\tprivate _lastWhitespaceId: number;\n\n\tprivate _minWidth: number;\n\n\tconstructor() {\n\t\tthis._heights = [];\n\t\tthis._minWidths = [];\n\t\tthis._ids = [];\n\t\tthis._afterLineNumbers = [];\n\t\tthis._ordinals = [];\n\t\tthis._prefixSum = [];\n\t\tthis._prefixSumValidIndex = -1;\n\t\tthis._whitespaceId2Index = {};\n\t\tthis._lastWhitespaceId = 0;\n\t\tthis._minWidth = -1; /* marker for not being computed */\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(sortedArray: number[], value: number, ordinals: number[], valueOrdinal: number): number {\n\t\tlet low = 0;\n\t\tlet high = sortedArray.length;\n\n\t\twhile (low < high) {\n\t\t\tlet mid = ((low + high) >>> 1);\n\n\t\t\tif (value === sortedArray[mid]) {\n\t\t\t\tif (valueOrdinal < ordinals[mid]) {\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 (value < sortedArray[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\n\t\treturn low;\n\t}\n\n\t/**\n\t * Insert a new whitespace of a certain height after a line number.\n\t * The whitespace has a \"sticky\" characteristic.\n\t * Irrespective of edits above or below `afterLineNumber`, the whitespace will follow the initial line.\n\t *\n\t * @param afterLineNumber The conceptual position of this whitespace. The whitespace will follow this line as best as possible even when deleting/inserting lines above/below.\n\t * @param heightInPx The height of the whitespace, in pixels.\n\t * @return An id that can be used later to mutate or delete the whitespace\n\t */\n\tpublic insertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): number {\n\t\tafterLineNumber = afterLineNumber | 0;\n\t\tordinal = ordinal | 0;\n\t\theightInPx = heightInPx | 0;\n\t\tminWidth = minWidth | 0;\n\n\t\tlet id = (++this._lastWhitespaceId);\n\t\tlet insertionIndex = WhitespaceComputer.findInsertionIndex(this._afterLineNumbers, afterLineNumber, this._ordinals, ordinal);\n\t\tthis._insertWhitespaceAtIndex(id, insertionIndex, afterLineNumber, ordinal, heightInPx, minWidth);\n\t\tthis._minWidth = -1; /* marker for not being computed */\n\t\treturn id;\n\t}\n\n\tprivate _insertWhitespaceAtIndex(id: number, insertIndex: number, afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): void {\n\t\tid = id | 0;\n\t\tinsertIndex = insertIndex | 0;\n\t\tafterLineNumber = afterLineNumber | 0;\n\t\tordinal = ordinal | 0;\n\t\theightInPx = heightInPx | 0;\n\t\tminWidth = minWidth | 0;\n\n\t\tthis._heights.splice(insertIndex, 0, heightInPx);\n\t\tthis._minWidths.splice(insertIndex, 0, minWidth);\n\t\tthis._ids.splice(insertIndex, 0, id);\n\t\tthis._afterLineNumbers.splice(insertIndex, 0, afterLineNumber);\n\t\tthis._ordinals.splice(insertIndex, 0, ordinal);\n\t\tthis._prefixSum.splice(insertIndex, 0, 0);\n\n\t\tlet keys = Object.keys(this._whitespaceId2Index);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tlet sid = keys[i];\n\t\t\tlet oldIndex = this._whitespaceId2Index[sid];\n\t\t\tif (oldIndex >= insertIndex) {\n\t\t\t\tthis._whitespaceId2Index[sid] = oldIndex + 1;\n\t\t\t}\n\t\t}\n\n\t\tthis._whitespaceId2Index[id.toString()] = insertIndex;\n\t\tthis._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, insertIndex - 1);\n\t}\n\n\t/**\n\t * Change properties associated with a certain whitespace.\n\t */\n\tpublic changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean {\n\t\tid = id | 0;\n\t\tnewAfterLineNumber = newAfterLineNumber | 0;\n\t\tnewHeight = newHeight | 0;\n\n\t\tlet hasChanges = false;\n\t\thasChanges = this.changeWhitespaceHeight(id, newHeight) || hasChanges;\n\t\thasChanges = this.changeWhitespaceAfterLineNumber(id, newAfterLineNumber) || hasChanges;\n\t\treturn hasChanges;\n\t}\n\n\t/**\n\t * Change the height of an existing whitespace\n\t *\n\t * @param id The whitespace to change\n\t * @param newHeightInPx The new height of the whitespace, in pixels\n\t * @return Returns true if the whitespace is found and if the new height is different than the old height\n\t */\n\tpublic changeWhitespaceHeight(id: number, newHeightInPx: number): boolean {\n\t\tid = id | 0;\n\t\tnewHeightInPx = newHeightInPx | 0;\n\n\t\tlet sid = id.toString();\n\t\tif (this._whitespaceId2Index.hasOwnProperty(sid)) {\n\t\t\tlet index = this._whitespaceId2Index[sid];\n\t\t\tif (this._heights[index] !== newHeightInPx) {\n\t\t\t\tthis._heights[index] = newHeightInPx;\n\t\t\t\tthis._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, index - 1);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Change the line number after which an existing whitespace flows.\n\t *\n\t * @param id The whitespace to change\n\t * @param newAfterLineNumber The new line number the whitespace will follow\n\t * @return Returns true if the whitespace is found and if the new line number is different than the old line number\n\t */\n\tpublic changeWhitespaceAfterLineNumber(id: number, newAfterLineNumber: number): boolean {\n\t\tid = id | 0;\n\t\tnewAfterLineNumber = newAfterLineNumber | 0;\n\n\t\tlet sid = id.toString();\n\t\tif (this._whitespaceId2Index.hasOwnProperty(sid)) {\n\t\t\tlet index = this._whitespaceId2Index[sid];\n\t\t\tif (this._afterLineNumbers[index] !== newAfterLineNumber) {\n\t\t\t\t// `afterLineNumber` changed for this whitespace\n\n\t\t\t\t// Record old ordinal\n\t\t\t\tlet ordinal = this._ordinals[index];\n\n\t\t\t\t// Record old height\n\t\t\t\tlet heightInPx = this._heights[index];\n\n\t\t\t\t// Record old min width\n\t\t\t\tlet minWidth = this._minWidths[index];\n\n\t\t\t\t// Since changing `afterLineNumber` can trigger a reordering, we're gonna remove this whitespace\n\t\t\t\tthis.removeWhitespace(id);\n\n\t\t\t\t// And add it again\n\t\t\t\tlet insertionIndex = WhitespaceComputer.findInsertionIndex(this._afterLineNumbers, newAfterLineNumber, this._ordinals, ordinal);\n\t\t\t\tthis._insertWhitespaceAtIndex(id, insertionIndex, newAfterLineNumber, ordinal, heightInPx, minWidth);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Remove an existing whitespace.\n\t *\n\t * @param id The whitespace to remove\n\t * @return Returns true if the whitespace is found and it is removed.\n\t */\n\tpublic removeWhitespace(id: number): boolean {\n\t\tid = id | 0;\n\n\t\tlet sid = id.toString();\n\n\t\tif (this._whitespaceId2Index.hasOwnProperty(sid)) {\n\t\t\tlet index = this._whitespaceId2Index[sid];\n\t\t\tdelete this._whitespaceId2Index[sid];\n\t\t\tthis._removeWhitespaceAtIndex(index);\n\t\t\tthis._minWidth = -1; /* marker for not being computed */\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate _removeWhitespaceAtIndex(removeIndex: number): void {\n\t\tremoveIndex = removeIndex | 0;\n\n\t\tthis._heights.splice(removeIndex, 1);\n\t\tthis._minWidths.splice(removeIndex, 1);\n\t\tthis._ids.splice(removeIndex, 1);\n\t\tthis._afterLineNumbers.splice(removeIndex, 1);\n\t\tthis._ordinals.splice(removeIndex, 1);\n\t\tthis._prefixSum.splice(removeIndex, 1);\n\t\tthis._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, removeIndex - 1);\n\n\t\tlet keys = Object.keys(this._whitespaceId2Index);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tlet sid = keys[i];\n\t\t\tlet oldIndex = this._whitespaceId2Index[sid];\n\t\t\tif (oldIndex >= removeIndex) {\n\t\t\t\tthis._whitespaceId2Index[sid] = oldIndex - 1;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Notify the computer that lines have been deleted (a continuous zone of lines).\n\t * This gives it a chance to update `afterLineNumber` for whitespaces, giving the \"sticky\" characteristic.\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\tfromLineNumber = fromLineNumber | 0;\n\t\ttoLineNumber = toLineNumber | 0;\n\n\t\tfor (let i = 0, len = this._afterLineNumbers.length; i < len; i++) {\n\t\t\tlet afterLineNumber = this._afterLineNumbers[i];\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._afterLineNumbers[i] = 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._afterLineNumbers[i] -= (toLineNumber - fromLineNumber + 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Notify the computer that lines have been inserted (a continuous zone of lines).\n\t * This gives it a chance to update `afterLineNumber` for whitespaces, giving the \"sticky\" characteristic.\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\tfromLineNumber = fromLineNumber | 0;\n\t\ttoLineNumber = toLineNumber | 0;\n\n\t\tfor (let i = 0, len = this._afterLineNumbers.length; i < len; i++) {\n\t\t\tlet afterLineNumber = this._afterLineNumbers[i];\n\n\t\t\tif (fromLineNumber <= afterLineNumber) {\n\t\t\t\tthis._afterLineNumbers[i] += (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 getTotalHeight(): number {\n\t\tif (this._heights.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.getAccumulatedHeight(this._heights.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 getAccumulatedHeight(index: number): number {\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._prefixSum[0] = this._heights[0];\n\t\t\tstartIndex++;\n\t\t}\n\n\t\tfor (let i = startIndex; i <= index; i++) {\n\t\t\tthis._prefixSum[i] = this._prefixSum[i - 1] + this._heights[i];\n\t\t}\n\t\tthis._prefixSumValidIndex = Math.max(this._prefixSumValidIndex, index);\n\t\treturn this._prefixSum[index];\n\t}\n\n\t/**\n\t * Find all whitespaces with `afterLineNumber` < `lineNumber` and return the sum of their heights.\n\t *\n\t * @param lineNumber The line number whitespaces should be before.\n\t * @return The sum of the heights of the whitespaces before `lineNumber`.\n\t */\n\tpublic getAccumulatedHeightBeforeLineNumber(lineNumber: number): number {\n\t\tlineNumber = lineNumber | 0;\n\n\t\tlet lastWhitespaceBeforeLineNumber = this._findLastWhitespaceBeforeLineNumber(lineNumber);\n\n\t\tif (lastWhitespaceBeforeLineNumber === -1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.getAccumulatedHeight(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\tlet afterLineNumbers = this._afterLineNumbers;\n\t\tlet low = 0;\n\t\tlet high = afterLineNumbers.length - 1;\n\n\t\twhile (low <= high) {\n\t\t\tlet delta = (high - low) | 0;\n\t\t\tlet halfDelta = (delta / 2) | 0;\n\t\t\tlet mid = (low + halfDelta) | 0;\n\n\t\t\tif (afterLineNumbers[mid] < lineNumber) {\n\t\t\t\tif (mid + 1 >= afterLineNumbers.length || afterLineNumbers[mid + 1] >= 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\tlet lastWhitespaceBeforeLineNumber = this._findLastWhitespaceBeforeLineNumber(lineNumber);\n\t\tlet firstWhitespaceAfterLineNumber = lastWhitespaceBeforeLineNumber + 1;\n\n\t\tif (firstWhitespaceAfterLineNumber < this._heights.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\tlineNumber = lineNumber | 0;\n\n\t\treturn this._findFirstWhitespaceAfterLineNumber(lineNumber);\n\t}\n\n\t/**\n\t * The number of whitespaces.\n\t */\n\tpublic getCount(): number {\n\t\treturn this._heights.length;\n\t}\n\n\t/**\n\t * The maximum min width for all whitespaces.\n\t */\n\tpublic getMinWidth(): number {\n\t\tif (this._minWidth === -1) {\n\t\t\tlet minWidth = 0;\n\t\t\tfor (let i = 0, len = this._minWidths.length; i < len; i++) {\n\t\t\t\tminWidth = Math.max(minWidth, this._minWidths[i]);\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 * 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\tindex = index | 0;\n\n\t\treturn this._afterLineNumbers[index];\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): number {\n\t\tindex = index | 0;\n\n\t\treturn this._ids[index];\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\tindex = index | 0;\n\n\t\treturn this._heights[index];\n\t}\n\n\t/**\n\t * Get all whitespaces.\n\t */\n\tpublic getWhitespaces(deviceLineHeight: number): IEditorWhitespace[] {\n\t\tdeviceLineHeight = deviceLineHeight | 0;\n\n\t\tlet result: IEditorWhitespace[] = [];\n\t\tfor (let i = 0; i < this._heights.length; i++) {\n\t\t\tresult.push({\n\t\t\t\tid: this._ids[i],\n\t\t\t\tafterLineNumber: this._afterLineNumbers[i],\n\t\t\t\theightInLines: this._heights[i] / deviceLineHeight\n\t\t\t});\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 { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { IEditorWhitespace, WhitespaceComputer } from 'vs/editor/common/viewLayout/whitespaceComputer';\nimport { IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel';\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 * This is written with no knowledge of an editor in mind.\n */\nexport class LinesLayout {\n\n\t/**\n\t * Keep track of the total number of lines.\n\t * This is useful for doing binary searches or for doing hit-testing.\n\t */\n\tprivate _lineCount: number;\n\n\t/**\n\t * The height of a line in pixels.\n\t */\n\tprivate _lineHeight: number;\n\n\t/**\n\t * Contains whitespace information in pixels\n\t */\n\tprivate readonly _whitespaces: WhitespaceComputer;\n\n\tconstructor(lineCount: number, lineHeight: number) {\n\t\tthis._lineCount = lineCount;\n\t\tthis._lineHeight = lineHeight;\n\t\tthis._whitespaces = new WhitespaceComputer();\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._lineHeight = lineHeight;\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._lineCount = lineCount;\n\t}\n\n\t/**\n\t * Insert a new whitespace of a certain height after a line number.\n\t * The whitespace has a \"sticky\" characteristic.\n\t * Irrespective of edits above or below `afterLineNumber`, the whitespace will follow the initial line.\n\t *\n\t * @param afterLineNumber The conceptual position of this whitespace. The whitespace will follow this line as best as possible even when deleting/inserting lines above/below.\n\t * @param heightInPx The height of the whitespace, in pixels.\n\t * @return An id that can be used later to mutate or delete the whitespace\n\t */\n\tpublic insertWhitespace(afterLineNumber: number, ordinal: number, heightInPx: number, minWidth: number): number {\n\t\treturn this._whitespaces.insertWhitespace(afterLineNumber, ordinal, heightInPx, minWidth);\n\t}\n\n\t/**\n\t * Change properties associated with a certain whitespace.\n\t */\n\tpublic changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean {\n\t\treturn this._whitespaces.changeWhitespace(id, newAfterLineNumber, newHeight);\n\t}\n\n\t/**\n\t * Remove an existing whitespace.\n\t *\n\t * @param id The whitespace to remove\n\t * @return Returns true if the whitespace is found and it is removed.\n\t */\n\tpublic removeWhitespace(id: number): boolean {\n\t\treturn this._whitespaces.removeWhitespace(id);\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._lineCount -= (toLineNumber - fromLineNumber + 1);\n\t\tthis._whitespaces.onLinesDeleted(fromLineNumber, toLineNumber);\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._lineCount += (toLineNumber - fromLineNumber + 1);\n\t\tthis._whitespaces.onLinesInserted(fromLineNumber, toLineNumber);\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\tlet linesHeight = this._lineHeight * this._lineCount;\n\t\tlet whitespacesHeight = this._whitespaces.getTotalHeight();\n\t\treturn linesHeight + whitespacesHeight;\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\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\tlet previousWhitespacesHeight = this._whitespaces.getAccumulatedHeightBeforeLineNumber(lineNumber);\n\n\t\treturn previousLinesHeight + previousWhitespacesHeight;\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\treturn this._whitespaces.getAccumulatedHeightBeforeLineNumber(lineNumber);\n\t}\n\n\tpublic getWhitespaceMinWidth(): number {\n\t\treturn this._whitespaces.getMinWidth();\n\t}\n\n\t/**\n\t * Check if `verticalOffset` is below all lines.\n\t */\n\tpublic isAfterLines(verticalOffset: number): boolean {\n\t\tlet totalHeight = this.getLinesTotalHeight();\n\t\treturn verticalOffset > totalHeight;\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\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\tlet midLineNumber = ((minLineNumber + maxLineNumber) / 2) | 0;\n\n\t\t\tlet 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\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._whitespaces.getFirstWhitespaceIndexAfterLineNumber(startLineNumber) | 0;\n\t\tconst whitespaceCount = this._whitespaces.getCount() | 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._whitespaces.getAfterLineNumberForWhitespaceIndex(whitespaceIndex) | 0;\n\t\t\tcurrentWhitespaceHeight = this._whitespaces.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\tlet 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\tlet currentLineTop = currentVerticalOffset;\n\t\t\t\tlet 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._whitespaces.getAfterLineNumberForWhitespaceIndex(whitespaceIndex) | 0;\n\t\t\t\t\tcurrentWhitespaceHeight = this._whitespaces.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\twhitespaceIndex = whitespaceIndex | 0;\n\n\t\tlet afterLineNumber = this._whitespaces.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._whitespaces.getAccumulatedHeight(whitespaceIndex - 1);\n\t\t} else {\n\t\t\tpreviousWhitespacesHeight = 0;\n\t\t}\n\t\treturn previousLinesHeight + previousWhitespacesHeight;\n\t}\n\n\tpublic getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset: number): number {\n\t\tverticalOffset = verticalOffset | 0;\n\n\t\tlet midWhitespaceIndex: number,\n\t\t\tminWhitespaceIndex = 0,\n\t\t\tmaxWhitespaceIndex = this._whitespaces.getCount() - 1,\n\t\t\tmidWhitespaceVerticalOffset: number,\n\t\t\tmidWhitespaceHeight: number;\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\tlet maxWhitespaceVerticalOffset = this.getVerticalOffsetForWhitespaceIndex(maxWhitespaceIndex);\n\t\tlet maxWhitespaceHeight = this._whitespaces.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\tmidWhitespaceIndex = Math.floor((minWhitespaceIndex + maxWhitespaceIndex) / 2);\n\n\t\t\tmidWhitespaceVerticalOffset = this.getVerticalOffsetForWhitespaceIndex(midWhitespaceIndex);\n\t\t\tmidWhitespaceHeight = this._whitespaces.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\tverticalOffset = verticalOffset | 0;\n\n\t\tlet candidateIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset);\n\n\t\tif (candidateIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (candidateIndex >= this._whitespaces.getCount()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet candidateTop = this.getVerticalOffsetForWhitespaceIndex(candidateIndex);\n\n\t\tif (candidateTop > verticalOffset) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet candidateHeight = this._whitespaces.getHeightForWhitespaceIndex(candidateIndex);\n\t\tlet candidateId = this._whitespaces.getIdForWhitespaceIndex(candidateIndex);\n\t\tlet candidateAfterLineNumber = this._whitespaces.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\tverticalOffset1 = verticalOffset1 | 0;\n\t\tverticalOffset2 = verticalOffset2 | 0;\n\n\t\tlet startIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset1);\n\t\tlet endIndex = this._whitespaces.getCount() - 1;\n\n\t\tif (startIndex < 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet result: IViewWhitespaceViewportData[] = [];\n\t\tfor (let i = startIndex; i <= endIndex; i++) {\n\t\t\tlet top = this.getVerticalOffsetForWhitespaceIndex(i);\n\t\t\tlet height = this._whitespaces.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._whitespaces.getIdForWhitespaceIndex(i),\n\t\t\t\tafterLineNumber: this._whitespaces.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\treturn this._whitespaces.getWhitespaces(this._lineHeight);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { toUint32 } from 'vs/editor/common/core/uint';\n\nexport class PrefixSumIndexOfResult {\n\t_prefixSumIndexOfResultBrand: void;\n\n\tindex: number;\n\tremainder: number;\n\n\tconstructor(index: number, remainder: number) {\n\t\tthis.index = index;\n\t\tthis.remainder = remainder;\n\t}\n}\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 getCount(): number {\n\t\treturn this.values.length;\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 changeValue(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, cnt: number): boolean {\n\t\tstartIndex = toUint32(startIndex);\n\t\tcnt = toUint32(cnt);\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\tlet maxCnt = oldValues.length - startIndex;\n\t\tif (cnt >= maxCnt) {\n\t\t\tcnt = maxCnt;\n\t\t}\n\n\t\tif (cnt === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.values = new Uint32Array(oldValues.length - cnt);\n\t\tthis.values.set(oldValues.subarray(0, startIndex), 0);\n\t\tthis.values.set(oldValues.subarray(startIndex + cnt), 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 getTotalValue(): number {\n\t\tif (this.values.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._getAccumulatedValue(this.values.length - 1);\n\t}\n\n\tpublic getAccumulatedValue(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._getAccumulatedValue(index);\n\t}\n\n\tprivate _getAccumulatedValue(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(accumulatedValue: number): PrefixSumIndexOfResult {\n\t\taccumulatedValue = Math.floor(accumulatedValue); //@perf\n\n\t\t// Compute all sums (to get a fully valid prefixSum)\n\t\tthis.getTotalValue();\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 (accumulatedValue < midStart) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else if (accumulatedValue >= 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, accumulatedValue - midStart);\n\t}\n}\n\nexport class PrefixSumComputerWithCache {\n\n\tprivate readonly _actual: PrefixSumComputer;\n\tprivate _cacheAccumulatedValueStart: number = 0;\n\tprivate _cache: PrefixSumIndexOfResult[] | null = null;\n\n\tconstructor(values: Uint32Array) {\n\t\tthis._actual = new PrefixSumComputer(values);\n\t\tthis._bustCache();\n\t}\n\n\tprivate _bustCache(): void {\n\t\tthis._cacheAccumulatedValueStart = 0;\n\t\tthis._cache = null;\n\t}\n\n\tpublic insertValues(insertIndex: number, insertValues: Uint32Array): void {\n\t\tif (this._actual.insertValues(insertIndex, insertValues)) {\n\t\t\tthis._bustCache();\n\t\t}\n\t}\n\n\tpublic changeValue(index: number, value: number): void {\n\t\tif (this._actual.changeValue(index, value)) {\n\t\t\tthis._bustCache();\n\t\t}\n\t}\n\n\tpublic removeValues(startIndex: number, cnt: number): void {\n\t\tif (this._actual.removeValues(startIndex, cnt)) {\n\t\t\tthis._bustCache();\n\t\t}\n\t}\n\n\tpublic getTotalValue(): number {\n\t\treturn this._actual.getTotalValue();\n\t}\n\n\tpublic getAccumulatedValue(index: number): number {\n\t\treturn this._actual.getAccumulatedValue(index);\n\t}\n\n\tpublic getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult {\n\t\taccumulatedValue = Math.floor(accumulatedValue); //@perf\n\n\t\tif (this._cache !== null) {\n\t\t\tlet cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart;\n\t\t\tif (cacheIndex >= 0 && cacheIndex < this._cache.length) {\n\t\t\t\t// Cache hit!\n\t\t\t\treturn this._cache[cacheIndex];\n\t\t\t}\n\t\t}\n\n\t\t// Cache miss!\n\t\treturn this._actual.getIndexOf(accumulatedValue);\n\t}\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these accumulated values.\n\t */\n\tpublic warmUpCache(accumulatedValueStart: number, accumulatedValueEnd: number): void {\n\t\tlet newCache: PrefixSumIndexOfResult[] = [];\n\t\tfor (let accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) {\n\t\t\tnewCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue);\n\t\t}\n\t\tthis._cache = newCache;\n\t\tthis._cacheAccumulatedValueStart = accumulatedValueStart;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { IModelContentChange } from 'vs/editor/common/model/textModelEvents';\nimport { PrefixSumComputer } from 'vs/editor/common/viewModel/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 class MirrorTextModel {\n\n\tprotected _uri: URI;\n\tprotected _lines: string[];\n\tprotected _eol: string;\n\tprotected _versionId: number;\n\tprotected _lineStarts: PrefixSumComputer | 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}\n\n\tdispose(): void {\n\t\tthis._lines.length = 0;\n\t}\n\n\tgetText(): string {\n\t\treturn this._lines.join(this._eol);\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}\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.changeValue(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\tlet insertLines = insertText.split(/\\r\\n|\\r|\\n/);\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\tlet 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 { mergeSort } from 'vs/base/common/arrays';\nimport { stringDiff } from 'vs/base/common/diff/diff';\nimport { FIN, Iterator, IteratorResult } from 'vs/base/common/iterator';\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 } from 'vs/editor/common/diff/diffComputer';\nimport { EndOfLineSequence, IWordAtPosition } from 'vs/editor/common/model';\nimport { IModelChangedEvent, MirrorTextModel as BaseMirrorModel } from 'vs/editor/common/model/mirrorTextModel';\nimport { ensureValidWordDefinition, getWordAtText } from 'vs/editor/common/model/wordHelper';\nimport { CompletionItem, CompletionItemKind, CompletionList, IInplaceReplaceSupportResult, ILink, TextEdit } from 'vs/editor/common/modes';\nimport { ILinkComputerTarget, computeLinks } from 'vs/editor/common/modes/linkComputer';\nimport { BasicInplaceReplace } from 'vs/editor/common/modes/supports/inplaceReplaceSupport';\nimport { IDiffComputationResult } from 'vs/editor/common/services/editorWorkerService';\nimport { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase';\nimport { getAllPropertyNames } from 'vs/base/common/types';\n\nexport interface IMirrorModel {\n\treadonly uri: URI;\n\treadonly version: number;\n\tgetValue(): string;\n}\n\nexport interface IWorkerContext {\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\tcreateWordIterator(wordDefinition: RegExp): Iterator<string>;\n\tgetWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition;\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 */\ninterface 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 */\nclass MirrorModel extends BaseMirrorModel implements ICommonModel {\n\n\tpublic get uri(): URI {\n\t\treturn this._uri;\n\t}\n\n\tpublic get version(): number {\n\t\treturn this._versionId;\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\tlet 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\tpublic getWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition {\n\t\tconst wordAtPosition = this.getWordAtPosition(position, wordDefinition);\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: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1),\n\t\t\tstartColumn: wordAtPosition.startColumn,\n\t\t\tendColumn: position.column\n\t\t};\n\t}\n\n\tpublic createWordIterator(wordDefinition: RegExp): Iterator<string> {\n\t\tlet obj: { done: false; value: string; };\n\t\tlet lineNumber = 0;\n\t\tlet lineText: string;\n\t\tlet wordRangesIdx = 0;\n\t\tlet wordRanges: IWordRange[] = [];\n\t\tlet next = (): IteratorResult<string> => {\n\n\t\t\tif (wordRangesIdx < wordRanges.length) {\n\t\t\t\tconst value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\n\t\t\t\twordRangesIdx += 1;\n\t\t\t\tif (!obj) {\n\t\t\t\t\tobj = { done: false, value: value };\n\t\t\t\t} else {\n\t\t\t\t\tobj.value = value;\n\t\t\t\t}\n\t\t\t\treturn obj;\n\n\t\t\t} else if (lineNumber >= this._lines.length) {\n\t\t\t\treturn FIN;\n\n\t\t\t} else {\n\t\t\t\tlineText = this._lines[lineNumber];\n\t\t\t\twordRanges = this._wordenize(lineText, wordDefinition);\n\t\t\t\twordRangesIdx = 0;\n\t\t\t\tlineNumber += 1;\n\t\t\t\treturn next();\n\t\t\t}\n\t\t};\n\t\treturn { next };\n\t}\n\n\tpublic getLineWords(lineNumber: number, wordDefinition: RegExp): IWordAtPosition[] {\n\t\tlet content = this._lines[lineNumber - 1];\n\t\tlet ranges = this._wordenize(content, wordDefinition);\n\t\tlet 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\tlet lineEnding = this._eol;\n\t\tlet startLineIndex = range.startLineNumber - 1;\n\t\tlet endLineIndex = range.endLineNumber - 1;\n\t\tlet 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!.getAccumulatedValue(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\tlet out = this._lineStarts!.getIndexOf(offset);\n\t\tlet 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\tlet 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 var require: any;\n\n/**\n * @internal\n */\nexport abstract class BaseEditorSimpleWorker {\n\tprivate readonly _foreignModuleFactory: IForeignModuleFactory | null;\n\tprivate _foreignModule: any;\n\n\tconstructor(foreignModuleFactory: IForeignModuleFactory | null) {\n\t\tthis._foreignModuleFactory = foreignModuleFactory;\n\t\tthis._foreignModule = null;\n\t}\n\n\tprotected abstract _getModel(uri: string): ICommonModel;\n\tprotected abstract _getModels(): ICommonModel[];\n\n\t// ---- BEGIN diff --------------------------------------------------------------------------\n\n\tpublic computeDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean): 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 Promise.resolve(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});\n\n\t\tconst changes = diffComputer.computeDiff();\n\t\tlet identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified));\n\t\treturn Promise.resolve({\n\t\t\tidentical: identical,\n\t\t\tchanges: 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 computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): Promise<TextEdit[]> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(edits);\n\t\t}\n\n\t\tconst result: TextEdit[] = [];\n\t\tlet lastEol: EndOfLineSequence | undefined = undefined;\n\n\t\tedits = mergeSort(edits, (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\tlet aRng = a.range ? 0 : 1;\n\t\t\tlet 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) > BaseEditorSimpleWorker._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 Promise.resolve(result);\n\t}\n\n\t// ---- END minimal edits ---------------------------------------------------------------\n\n\tpublic computeLinks(modelUrl: string): Promise<ILink[] | null> {\n\t\tlet model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn Promise.resolve(computeLinks(model));\n\t}\n\n\t// ---- BEGIN suggest --------------------------------------------------------------------------\n\n\tprivate static readonly _suggestionsLimit = 10000;\n\n\tpublic textualSuggest(modelUrl: string, position: IPosition, wordDef: string, wordDefFlags: string): Promise<CompletionList | null> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\tconst seen: Record<string, boolean> = Object.create(null);\n\t\tconst suggestions: CompletionItem[] = [];\n\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n\t\tconst wordUntil = model.getWordUntilPosition(position, wordDefRegExp);\n\n\t\tconst wordAt = model.getWordAtPosition(position, wordDefRegExp);\n\t\tif (wordAt) {\n\t\t\tseen[model.getValueInRange(wordAt)] = true;\n\t\t}\n\n\t\tfor (\n\t\t\tlet iter = model.createWordIterator(wordDefRegExp), e = iter.next();\n\t\t\t!e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit;\n\t\t\te = iter.next()\n\t\t) {\n\t\t\tconst word = e.value;\n\t\t\tif (seen[word]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseen[word] = true;\n\t\t\tif (!isNaN(Number(word))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tsuggestions.push({\n\t\t\t\tkind: CompletionItemKind.Text,\n\t\t\t\tlabel: word,\n\t\t\t\tinsertText: word,\n\t\t\t\trange: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn }\n\t\t\t});\n\t\t}\n\t\treturn Promise.resolve({ suggestions });\n\t}\n\n\n\t// ---- END suggest --------------------------------------------------------------------------\n\n\t//#region -- word ranges --\n\n\tcomputeWordRanges(modelUrl: string, range: IRange, wordDef: string, wordDefFlags: string): Promise<{ [word: string]: IRange[] }> {\n\t\tlet model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(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\tlet 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 Promise.resolve(result);\n\t}\n\n\t//#endregion\n\n\tpublic navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): Promise<IInplaceReplaceSupportResult | null> {\n\t\tlet model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\tlet 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\tlet selectionText = model.getValueInRange(range);\n\n\t\tlet wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\n\t\tif (!wordRange) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\t\tlet word = model.getValueInRange(wordRange);\n\t\tlet result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\n\t\treturn Promise.resolve(result);\n\t}\n\n\t// ---- BEGIN foreign module support --------------------------------------------------------------------------\n\n\tpublic loadForeignModule(moduleId: string, createData: any): Promise<string[]> {\n\t\tlet ctx: IWorkerContext = {\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\tlet methods: string[] = [];\n\t\t\tfor (const prop of getAllPropertyNames(this._foreignModule)) {\n\t\t\t\tif (typeof this._foreignModule[prop] === 'function') {\n\t\t\t\t\tmethods.push(prop);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Promise.resolve(methods);\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\tlet methods: string[] = [];\n\t\t\t\tfor (const prop of getAllPropertyNames(this._foreignModule)) {\n\t\t\t\t\tif (typeof this._foreignModule[prop] === 'function') {\n\t\t\t\t\t\tmethods.push(prop);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tresolve(methods);\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 * @internal\n */\nexport class EditorSimpleWorkerImpl extends BaseEditorSimpleWorker implements IRequestHandler, IDisposable {\n\t_requestHandlerBrand: any;\n\n\tprivate _models: { [uri: string]: MirrorModel; };\n\n\tconstructor(foreignModuleFactory: IForeignModuleFactory | null) {\n\t\tsuper(foreignModuleFactory);\n\t\tthis._models = Object.create(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\tprotected _getModels(): ICommonModel[] {\n\t\tlet 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\tlet 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\n/**\n * Called on the worker side\n * @internal\n */\nexport function create(): IRequestHandler {\n\treturn new EditorSimpleWorkerImpl(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 * Copyright (c) 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/view/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 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 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\tpublic onThemeChanged(e: viewEvents.ViewThemeChangedEvent): 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\tlet e = events[i];\n\n\t\t\tswitch (e.type) {\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.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\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\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/common/view/renderingContext';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/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 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\tif (target instanceof FastDomNode) {\n\t\t\ttarget.setAttribute('data-mprt', String(partId));\n\t\t} else {\n\t\t\ttarget.setAttribute('data-mprt', String(partId));\n\t\t}\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\tlet result: PartFingerprint[] = [], 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 { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { Constants } from 'vs/editor/common/core/uint';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { withUndefinedAsNull } from 'vs/base/common/types';\n\nclass Coordinate {\n\t_coordinateBrand: void;\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 dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic 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 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 onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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 onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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, position: IPosition | null | undefined, range: IRange | null | undefined, preference: ContentWidgetPositionPreference[] | null | undefined): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(position, 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\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 _position: IPosition | null;\n\tprivate _viewPosition: Position | null;\n\tprivate _range: IRange | null;\n\tprivate _viewRange: Range | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeClientWidth: number;\n\tprivate _cachedDomNodeClientHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: Coordinate | 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\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\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\tthis._fixedOverflowWidgets = this._context.configuration.editor.viewInfo.fixedOverflowWidgets;\n\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\n\t\tthis._setPosition(null, null);\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeClientWidth = -1;\n\t\tthis._cachedDomNodeClientHeight = -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.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\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = this._context.configuration.editor.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._position, this._range);\n\t}\n\n\tprivate _setPosition(position: IPosition | null | undefined, range: IRange | null | undefined): void {\n\t\tthis._position = withUndefinedAsNull(position);\n\t\tthis._range = withUndefinedAsNull(range);\n\t\tthis._viewPosition = null;\n\t\tthis._viewRange = null;\n\n\t\tif (this._position) {\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = this._context.model.validateModelPosition(this._position);\n\t\t\tif (this._context.model.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tthis._viewPosition = this._context.model.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition);\n\t\t\t}\n\t\t}\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.model.validateModelRange(this._range);\n\t\t\tthis._viewRange = this._context.model.coordinatesConverter.convertModelRangeToViewRange(validModelRange);\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!.clientWidth || document.body.clientWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(position: IPosition | null | undefined, range: IRange | null | undefined, preference: ContentWidgetPositionPreference[] | null | undefined): void {\n\t\tthis._setPosition(position, range);\n\t\tthis._preference = withUndefinedAsNull(preference);\n\t\tthis._cachedDomNodeClientWidth = -1;\n\t\tthis._cachedDomNodeClientHeight = -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 _layoutBoxInPage(topLeft: Coordinate, bottomLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveLeft0 = topLeft.left - ctx.scrollLeft;\n\t\tconst belowLeft0 = bottomLeft.left - ctx.scrollLeft;\n\n\t\tif (aboveLeft0 < 0 || aboveLeft0 > this._contentWidth) {\n\t\t\t// Don't render if position is scrolled outside viewport\n\t\t\treturn null;\n\t\t}\n\n\t\tlet aboveTop = topLeft.top - height;\n\t\tlet belowTop = bottomLeft.top + this._lineHeight;\n\t\tlet aboveLeft = aboveLeft0 + this._contentLeft;\n\t\tlet belowLeft = belowLeft0 + this._contentLeft;\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\t\tlet absoluteAboveLeft = domNodePosition.left + aboveLeft - dom.StandardWindow.scrollX;\n\t\tlet absoluteBelowLeft = domNodePosition.left + belowLeft - dom.StandardWindow.scrollX;\n\n\t\tconst INNER_WIDTH = window.innerWidth || document.documentElement!.clientWidth || document.body.clientWidth;\n\t\tconst INNER_HEIGHT = window.innerHeight || document.documentElement!.clientHeight || document.body.clientHeight;\n\n\t\t// Leave some clearance to the bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING),\n\t\t\tfitsBelow = (absoluteBelowTop + height <= INNER_HEIGHT - BOTTOM_PADDING);\n\n\t\tif (absoluteAboveLeft + width + 20 > INNER_WIDTH) {\n\t\t\tconst delta = absoluteAboveLeft - (INNER_WIDTH - width - 20);\n\t\t\tabsoluteAboveLeft -= delta;\n\t\t\taboveLeft -= delta;\n\t\t}\n\t\tif (absoluteBelowLeft + width + 20 > INNER_WIDTH) {\n\t\t\tconst delta = absoluteBelowLeft - (INNER_WIDTH - width - 20);\n\t\t\tabsoluteBelowLeft -= delta;\n\t\t\tbelowLeft -= delta;\n\t\t}\n\t\tif (absoluteAboveLeft < 0) {\n\t\t\tconst delta = absoluteAboveLeft;\n\t\t\tabsoluteAboveLeft -= delta;\n\t\t\taboveLeft -= delta;\n\t\t}\n\t\tif (absoluteBelowLeft < 0) {\n\t\t\tconst delta = absoluteBelowLeft;\n\t\t\tabsoluteBelowLeft -= delta;\n\t\t\tbelowLeft -= delta;\n\t\t}\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\taboveTop = absoluteAboveTop;\n\t\t\tbelowTop = absoluteBelowTop;\n\t\t\taboveLeft = absoluteAboveLeft;\n\t\t\tbelowLeft = absoluteBelowLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, aboveLeft, fitsBelow, belowTop, belowLeft };\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._viewPosition) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\tconst visibleRangeForPosition = ctx.visibleRangeForPosition(this._viewPosition);\n\t\tif (!visibleRangeForPosition) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\tconst topForPosition = ctx.getVerticalOffsetForLineNumber(this._viewPosition.lineNumber) - ctx.scrollTop;\n\t\tconst topLeft = new Coordinate(topForPosition, visibleRangeForPosition.left);\n\n\t\tlet largestLineNumber = this._viewPosition.lineNumber;\n\t\tlet smallestLeft = visibleRangeForPosition.left;\n\n\t\tif (this._viewRange) {\n\t\t\tconst visibleRangesForRange = ctx.linesVisibleRangesForRange(this._viewRange, false);\n\t\t\tif (visibleRangesForRange && visibleRangesForRange.length > 0) {\n\t\t\t\tfor (let i = visibleRangesForRange.length - 1; i >= 0; i--) {\n\t\t\t\t\tconst visibleRangesForLine = visibleRangesForRange[i];\n\t\t\t\t\tif (visibleRangesForLine.lineNumber >= largestLineNumber) {\n\t\t\t\t\t\tif (visibleRangesForLine.lineNumber > largestLineNumber) {\n\t\t\t\t\t\t\tlargestLineNumber = visibleRangesForLine.lineNumber;\n\t\t\t\t\t\t\tsmallestLeft = Constants.MAX_SAFE_SMALL_INTEGER;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (let j = 0, lenJ = visibleRangesForLine.ranges.length; j < lenJ; j++) {\n\t\t\t\t\t\t\tconst visibleRange = visibleRangesForLine.ranges[j];\n\n\t\t\t\t\t\t\tif (visibleRange.left < smallestLeft) {\n\t\t\t\t\t\t\t\tsmallestLeft = visibleRange.left;\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\tconst topForBottomLine = ctx.getVerticalOffsetForLineNumber(largestLineNumber) - ctx.scrollTop;\n\t\tconst bottomLeft = new Coordinate(topForBottomLine, smallestLeft);\n\n\t\treturn [topLeft, bottomLeft];\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): Coordinate | null {\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._cachedDomNodeClientWidth === -1 || this._cachedDomNodeClientHeight === -1) {\n\t\t\tconst domNode = this.domNode.domNode;\n\t\t\tthis._cachedDomNodeClientWidth = domNode.clientWidth;\n\t\t\tthis._cachedDomNodeClientHeight = domNode.clientHeight;\n\t\t}\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(topLeft, bottomLeft, this._cachedDomNodeClientWidth, this._cachedDomNodeClientHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(topLeft, bottomLeft, this._cachedDomNodeClientWidth, this._cachedDomNodeClientHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tif (this._preference) {\n\t\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\t\tfor (const pref of this._preference) {\n\t\t\t\t\t// placement\n\t\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\t\treturn new Coordinate(placement.aboveTop, placement.aboveLeft);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\t\treturn new Coordinate(placement.belowTop, placement.belowLeft);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\t\treturn this._prepareRenderWidgetAtExactPositionOverflowing(topLeft);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn topLeft;\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\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._viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._viewPosition.lineNumber < viewportData.startLineNumber || this._viewPosition.lineNumber > 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\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.top);\n\t\t\tthis.domNode.setLeft(this._renderData.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.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\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel';\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\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._renderResult = null;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.fontInfo) {\n\t\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged || e.scrollWidthChanged;\n\t}\n\tpublic 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[] = [], 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.model.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\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 === 0) {\n\t\t\t\t\t// collapsed range case => make the decoration visible by faking its width\n\t\t\t\t\tlineVisibleRanges.ranges[0] = new HorizontalRange(singleVisibleRange.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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\n\nexport class DecorationToRender {\n\t_decorationToRenderBrand: void;\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\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._glyphMargin = this._context.configuration.editor.viewInfo.glyphMargin;\n\t\tthis._glyphMarginLeft = this._context.configuration.editor.layoutInfo.glyphMarginLeft;\n\t\tthis._glyphMarginWidth = this._context.configuration.editor.layoutInfo.glyphMarginWidth;\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._glyphMargin = this._context.configuration.editor.viewInfo.glyphMargin;\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._glyphMarginLeft = this._context.configuration.editor.layoutInfo.glyphMarginLeft;\n\t\t\tthis._glyphMarginWidth = this._context.configuration.editor.layoutInfo.glyphMarginWidth;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic 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\tlet r: DecorationToRender[] = [], 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 '\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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\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\tthis._decorationsLeft = this._context.configuration.editor.layoutInfo.decorationsLeft;\n\t\tthis._decorationsWidth = this._context.configuration.editor.layoutInfo.decorationsWidth;\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.layoutInfo) {\n\t\t\tthis._decorationsLeft = this._context.configuration.editor.layoutInfo.decorationsLeft;\n\t\t\tthis._decorationsWidth = this._context.configuration.editor.layoutInfo.decorationsWidth;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic 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\tlet r: DecorationToRender[] = [], 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}\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 * Copyright (c) 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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\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\tthis._canUseLayerHinting = this._context.configuration.editor.canUseLayerHinting;\n\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\tthis._glyphMarginLeft = this._context.configuration.editor.layoutInfo.glyphMarginLeft;\n\t\tthis._glyphMarginWidth = this._context.configuration.editor.layoutInfo.glyphMarginWidth;\n\n\t\tthis._domNode = this._createDomNode();\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic getDomNode(): FastDomNode<HTMLElement> {\n\t\treturn this._domNode;\n\t}\n\n\tprivate _createDomNode(): FastDomNode<HTMLElement> {\n\t\tconst domNode = createFastDomNode(document.createElement('div'));\n\t\tdomNode.setClassName(Margin.OUTER_CLASS_NAME);\n\t\tdomNode.setPosition('absolute');\n\t\tdomNode.setAttribute('role', 'presentation');\n\t\tdomNode.setAttribute('aria-hidden', 'true');\n\n\t\tthis._glyphMarginBackgroundDomNode = createFastDomNode(document.createElement('div'));\n\t\tthis._glyphMarginBackgroundDomNode.setClassName(Margin.CLASS_NAME);\n\n\t\tdomNode.appendChild(this._glyphMarginBackgroundDomNode);\n\t\treturn domNode;\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.canUseLayerHinting) {\n\t\t\tthis._canUseLayerHinting = this._context.configuration.editor.canUseLayerHinting;\n\t\t}\n\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\t\tthis._glyphMarginLeft = this._context.configuration.editor.layoutInfo.glyphMarginLeft;\n\t\t\tthis._glyphMarginWidth = this._context.configuration.editor.layoutInfo.glyphMarginWidth;\n\t\t}\n\n\t\treturn true;\n\t}\n\tpublic 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\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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/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 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic 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\tlet r: DecorationToRender[] = [], 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 * Copyright (c) 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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\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\tthis._widgets = {};\n\t\tthis._verticalScrollbarWidth = this._context.configuration.editor.layoutInfo.verticalScrollbarWidth;\n\t\tthis._minimapWidth = this._context.configuration.editor.layoutInfo.minimapWidth;\n\t\tthis._horizontalScrollbarHeight = this._context.configuration.editor.layoutInfo.horizontalScrollbarHeight;\n\t\tthis._editorHeight = this._context.configuration.editor.layoutInfo.height;\n\t\tthis._editorWidth = this._context.configuration.editor.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 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.layoutInfo) {\n\t\t\tthis._verticalScrollbarWidth = this._context.configuration.editor.layoutInfo.verticalScrollbarWidth;\n\t\t\tthis._minimapWidth = this._context.configuration.editor.layoutInfo.minimapWidth;\n\t\t\tthis._horizontalScrollbarHeight = this._context.configuration.editor.layoutInfo.horizontalScrollbarHeight;\n\t\t\tthis._editorHeight = this._context.configuration.editor.layoutInfo.height;\n\t\t\tthis._editorWidth = this._context.configuration.editor.layoutInfo.width;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\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 { IOverviewRuler } from 'vs/editor/browser/editorBrowser';\nimport { OverviewRulerPosition } from 'vs/editor/common/config/editorOptions';\nimport { ColorZone, OverviewRulerZone, OverviewZoneManager } from 'vs/editor/common/view/overviewZoneManager';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/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\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\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(this._context.configuration.editor.lineHeight);\n\n\t\tthis._zoneManager.setPixelRatio(this._context.configuration.editor.pixelRatio);\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._zoneManager.setLineHeight(this._context.configuration.editor.lineHeight);\n\t\t\tthis._render();\n\t\t}\n\n\t\tif (e.pixelRatio) {\n\t\t\tthis._zoneManager.setPixelRatio(this._context.configuration.editor.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 onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\tthis._render();\n\t\treturn true;\n\t}\n\tpublic 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 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 { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IViewZone } 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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel';\n\nexport interface IMyViewZone {\n\twhitespaceId: number;\n\tdelegate: IViewZone;\n\tisVisible: boolean;\n\tdomNode: FastDomNode<HTMLElement>;\n\tmarginDomNode: FastDomNode<HTMLElement> | null;\n}\n\ninterface IComputedViewZoneProps {\n\tafterViewLineNumber: number;\n\theightInPx: number;\n\tminWidthInPx: number;\n}\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\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\t\tthis._contentLeft = this._context.configuration.editor.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 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\tlet hadAChange = false;\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\t\t\tconst props = this._computeWhitespaceProps(zone.delegate);\n\t\t\tif (this._context.viewLayout.changeWhitespace(parseInt(id, 10), props.afterViewLineNumber, props.heightInPx)) {\n\t\t\t\tthis._safeCallOnComputedHeight(zone.delegate, props.heightInPx);\n\t\t\t\thadAChange = true;\n\t\t\t}\n\t\t}\n\n\t\treturn hadAChange;\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t\treturn this._recomputeWhitespacesProps();\n\t\t}\n\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\t\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tconst hadAChange = this._recomputeWhitespacesProps();\n\t\tif (hadAChange) {\n\t\t\tthis._context.viewLayout.onHeightMaybeChanged();\n\t\t}\n\t\treturn hadAChange;\n\t}\n\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged || e.scrollWidthChanged;\n\t}\n\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\tpublic 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\n\tprivate _computeWhitespaceProps(zone: IViewZone): IComputedViewZoneProps {\n\t\tif (zone.afterLineNumber === 0) {\n\t\t\treturn {\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.model.validateModelPosition({\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.model.validateModelPosition({\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.model.getModelLineMaxColumn(validAfterLineNumber)\n\t\t\t);\n\t\t}\n\n\t\tlet zoneBeforeModelPosition: Position;\n\t\tif (zoneAfterModelPosition.column === this._context.model.getModelLineMaxColumn(zoneAfterModelPosition.lineNumber)) {\n\t\t\tzoneBeforeModelPosition = this._context.model.validateModelPosition({\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.model.validateModelPosition({\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.model.coordinatesConverter.convertModelPositionToViewPosition(zoneAfterModelPosition);\n\t\tconst isVisible = this._context.model.coordinatesConverter.modelPositionIsVisible(zoneBeforeModelPosition);\n\t\treturn {\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 addZone(zone: IViewZone): number {\n\t\tconst props = this._computeWhitespaceProps(zone);\n\t\tconst whitespaceId = this._context.viewLayout.addWhitespace(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\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.toString());\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.toString());\n\t\t\tthis.marginDomNode.appendChild(myZone.marginDomNode);\n\t\t}\n\n\t\tthis._zones[myZone.whitespaceId.toString()] = myZone;\n\n\n\t\tthis.setShouldRender();\n\n\t\treturn myZone.whitespaceId;\n\t}\n\n\tpublic removeZone(id: number): boolean {\n\t\tif (this._zones.hasOwnProperty(id.toString())) {\n\t\t\tconst zone = this._zones[id.toString()];\n\t\t\tdelete this._zones[id.toString()];\n\t\t\tthis._context.viewLayout.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\tpublic layoutZone(id: number): boolean {\n\t\tlet changed = false;\n\t\tif (this._zones.hasOwnProperty(id.toString())) {\n\t\t\tconst zone = this._zones[id.toString()];\n\t\t\tconst props = this._computeWhitespaceProps(zone.delegate);\n\t\t\t// const newOrdinal = this._getZoneOrdinal(zone.delegate);\n\t\t\tchanged = this._context.viewLayout.changeWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx) || changed;\n\t\t\t// TODO@Alex: change `newOrdinal` too\n\n\t\t\tif (changed) {\n\t\t\t\tthis._safeCallOnComputedHeight(zone.delegate, props.heightInPx);\n\t\t\t\tthis.setShouldRender();\n\t\t\t}\n\t\t}\n\t\treturn changed;\n\t}\n\n\tpublic shouldSuppressMouseDownOnViewZone(id: number): boolean {\n\t\tif (this._zones.hasOwnProperty(id.toString())) {\n\t\t\tconst zone = this._zones[id.toString()];\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 (let i = 0, len = visibleWhitespaces.length; i < len; i++) {\n\t\t\tvisibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IScrollPosition, Scrollable } from 'vs/base/common/scrollable';\nimport * as strings from 'vs/base/common/strings';\nimport { IViewLineTokens } from 'vs/editor/common/core/lineTokens';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { INewScrollPosition } from 'vs/editor/common/editorCommon';\nimport { EndOfLinePreference, IActiveIndentGuideInfo, IModelDecorationOptions, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { IViewEventListener } from 'vs/editor/common/view/viewEvents';\nimport { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { ITheme } from 'vs/platform/theme/common/themeService';\n\nexport interface IViewWhitespaceViewportData {\n\treadonly id: number;\n\treadonly afterLineNumber: number;\n\treadonly verticalOffset: number;\n\treadonly height: number;\n}\n\nexport class Viewport {\n\treadonly _viewportBrand: void;\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 IViewLayout {\n\n\treadonly scrollable: Scrollable;\n\n\tonMaxLineWidthChanged(width: number): void;\n\n\tgetScrollWidth(): number;\n\tgetScrollHeight(): number;\n\n\tgetCurrentScrollLeft(): number;\n\tgetCurrentScrollTop(): number;\n\tgetCurrentViewport(): Viewport;\n\n\tgetFutureViewport(): Viewport;\n\n\tvalidateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition;\n\tsetScrollPositionNow(position: INewScrollPosition): void;\n\tsetScrollPositionSmooth(position: INewScrollPosition): void;\n\tdeltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void;\n\n\tgetLinesViewportData(): IPartialViewLinesViewportData;\n\n\tisAfterLines(verticalOffset: number): boolean;\n\tgetLineNumberAtVerticalOffset(verticalOffset: number): number;\n\tgetVerticalOffsetForLineNumber(lineNumber: number): number;\n\tgetWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null;\n\n\t// --------------- Begin vertical whitespace management\n\n\t/**\n\t * Reserve rendering space.\n\t * @return an identifier that can be later used to remove or change the whitespace.\n\t */\n\taddWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): number;\n\t/**\n\t * Change the properties of a whitespace.\n\t */\n\tchangeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean;\n\t/**\n\t * Remove rendering space\n\t */\n\tremoveWhitespace(id: number): boolean;\n\t/**\n\t * Get the layout information for whitespaces currently in the viewport\n\t */\n\tgetWhitespaceViewportData(): IViewWhitespaceViewportData[];\n\n\t// TODO@Alex whitespace management should work via a change accessor sort of thing\n\tonHeightMaybeChanged(): void;\n\n\t// --------------- End vertical whitespace management\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): Position;\n\tconvertModelRangeToViewRange(modelRange: Range): Range;\n\tmodelPositionIsVisible(modelPosition: Position): boolean;\n}\n\nexport interface IViewModel {\n\n\taddEventListener(listener: IViewEventListener): IDisposable;\n\n\treadonly coordinatesConverter: ICoordinatesConverter;\n\n\treadonly viewLayout: IViewLayout;\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\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\tgetOptions(): TextModelResolvedOptions;\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\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\n\tgetAllOverviewRulerDecorations(theme: ITheme): IOverviewRulerDecorations;\n\tinvalidateOverviewRulerColorCache(): void;\n\tgetValueInRange(range: Range, eol: EndOfLinePreference): string;\n\n\tgetModelLineMaxColumn(modelLineNumber: number): number;\n\tvalidateModelPosition(modelPosition: IPosition): Position;\n\tvalidateModelRange(range: IRange): Range;\n\n\tdeduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position;\n\tgetEOL(): string;\n\tgetPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[];\n\tgetHTMLToCopy(ranges: Range[], emptySelectionClipboard: boolean): string | null;\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;\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 tokens at this view line.\n\t */\n\tpublic readonly tokens: IViewLineTokens;\n\n\tconstructor(\n\t\tcontent: string,\n\t\tcontinuesWithWrappedLine: boolean,\n\t\tminColumn: number,\n\t\tmaxColumn: number,\n\t\ttokens: IViewLineTokens\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.tokens = tokens;\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\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) {\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}\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 ViewModelDecoration {\n\t_viewModelDecorationBrand: void;\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\n/**\n * Decorations are encoded in a number array using the following scheme:\n * - 3*i = lane\n * - 3*i+1 = startLineNumber\n * - 3*i+2 = endLineNumber\n */\nexport interface IOverviewRulerDecorations {\n\t[color: string]: number[];\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Event } from 'vs/base/common/event';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { IScrollDimensions, IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { LinesLayout } from 'vs/editor/common/viewLayout/linesLayout';\nimport { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer';\nimport { IViewLayout, IViewWhitespaceViewportData, Viewport } from 'vs/editor/common/viewModel/viewModel';\n\nconst SMOOTH_SCROLLING_TIME = 125;\n\nexport class ViewLayout extends Disposable implements IViewLayout {\n\n\tprivate readonly _configuration: editorCommon.IConfiguration;\n\tprivate readonly _linesLayout: LinesLayout;\n\n\tpublic readonly scrollable: Scrollable;\n\tpublic readonly onDidScroll: Event<ScrollEvent>;\n\n\tconstructor(configuration: editorCommon.IConfiguration, lineCount: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) {\n\t\tsuper();\n\n\t\tthis._configuration = configuration;\n\t\tthis._linesLayout = new LinesLayout(lineCount, this._configuration.editor.lineHeight);\n\n\t\tthis.scrollable = this._register(new Scrollable(0, scheduleAtNextAnimationFrame));\n\t\tthis._configureSmoothScrollDuration();\n\n\t\tthis.scrollable.setScrollDimensions({\n\t\t\twidth: configuration.editor.layoutInfo.contentWidth,\n\t\t\theight: configuration.editor.layoutInfo.contentHeight\n\t\t});\n\t\tthis.onDidScroll = this.scrollable.onScroll;\n\n\t\tthis._updateHeight();\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\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.editor.viewInfo.smoothScrolling ? SMOOTH_SCROLLING_TIME : 0);\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic onConfigurationChanged(e: IConfigurationChangedEvent): void {\n\t\tif (e.lineHeight) {\n\t\t\tthis._linesLayout.setLineHeight(this._configuration.editor.lineHeight);\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis.scrollable.setScrollDimensions({\n\t\t\t\twidth: this._configuration.editor.layoutInfo.contentWidth,\n\t\t\t\theight: this._configuration.editor.layoutInfo.contentHeight\n\t\t\t});\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._configureSmoothScrollDuration();\n\t\t}\n\t\tthis._updateHeight();\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(scrollDimensions: IScrollDimensions): number {\n\t\tif (this._configuration.editor.viewInfo.scrollbar.horizontal === ScrollbarVisibility.Hidden) {\n\t\t\t// horizontal scrollbar not visible\n\t\t\treturn 0;\n\t\t}\n\t\tif (scrollDimensions.width >= scrollDimensions.scrollWidth) {\n\t\t\t// horizontal scrollbar not visible\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._configuration.editor.viewInfo.scrollbar.horizontalScrollbarSize;\n\t}\n\n\tprivate _getTotalHeight(): number {\n\t\tconst scrollDimensions = this.scrollable.getScrollDimensions();\n\n\t\tlet result = this._linesLayout.getLinesTotalHeight();\n\t\tif (this._configuration.editor.viewInfo.scrollBeyondLastLine) {\n\t\t\tresult += scrollDimensions.height - this._configuration.editor.lineHeight;\n\t\t} else {\n\t\t\tresult += this._getHorizontalScrollbarHeight(scrollDimensions);\n\t\t}\n\n\t\treturn Math.max(scrollDimensions.height, result);\n\t}\n\n\tprivate _updateHeight(): void {\n\t\tthis.scrollable.setScrollDimensions({\n\t\t\tscrollHeight: this._getTotalHeight()\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 _computeScrollWidth(maxLineWidth: number, viewportWidth: number): number {\n\t\tlet isViewportWrapping = this._configuration.editor.wrappingInfo.isViewportWrapping;\n\t\tif (!isViewportWrapping) {\n\t\t\tconst extraHorizontalSpace = this._configuration.editor.viewInfo.scrollBeyondLastColumn * this._configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t\tconst whitespaceMinWidth = this._linesLayout.getWhitespaceMinWidth();\n\t\t\treturn Math.max(maxLineWidth + extraHorizontalSpace, viewportWidth, whitespaceMinWidth);\n\t\t}\n\t\treturn Math.max(maxLineWidth, viewportWidth);\n\t}\n\n\tpublic onMaxLineWidthChanged(maxLineWidth: number): void {\n\t\tlet newScrollWidth = this._computeScrollWidth(maxLineWidth, this.getCurrentViewport().width);\n\t\tthis.scrollable.setScrollDimensions({\n\t\t\tscrollWidth: newScrollWidth\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\tlet scrollTop = currentScrollPosition.scrollTop;\n\t\tlet firstLineNumberInViewport = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(scrollTop);\n\t\tlet 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// ---- IVerticalLayoutProvider\n\n\tpublic addWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): number {\n\t\treturn this._linesLayout.insertWhitespace(afterLineNumber, ordinal, height, minWidth);\n\t}\n\tpublic changeWhitespace(id: number, newAfterLineNumber: number, newHeight: number): boolean {\n\t\treturn this._linesLayout.changeWhitespace(id, newAfterLineNumber, newHeight);\n\t}\n\tpublic removeWhitespace(id: number): boolean {\n\t\treturn this._linesLayout.removeWhitespace(id);\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 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// ---- IScrollingProvider\n\n\n\tpublic getScrollWidth(): number {\n\t\tconst scrollDimensions = this.scrollable.getScrollDimensions();\n\t\treturn scrollDimensions.scrollWidth;\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: editorCommon.INewScrollPosition): IScrollPosition {\n\t\treturn this.scrollable.validateScrollPosition(scrollPosition);\n\t}\n\n\tpublic setScrollPositionNow(position: editorCommon.INewScrollPosition): void {\n\t\tthis.scrollable.setScrollPositionNow(position);\n\t}\n\n\tpublic setScrollPositionSmooth(position: editorCommon.INewScrollPosition): void {\n\t\tthis.scrollable.setScrollPositionSmooth(position);\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IModelDecoration, ITextModel } from 'vs/editor/common/model';\nimport { IViewModelLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection';\nimport { ICoordinatesConverter, InlineDecoration, InlineDecorationType, ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel';\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: editorCommon.IConfiguration;\n\tprivate readonly _linesCollection: IViewModelLinesCollection;\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: editorCommon.IConfiguration, linesCollection: IViewModelLinesCollection, 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._clearCachedModelDecorationsResolver();\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));\n\t\t\t\tconst end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)));\n\t\t\t\tviewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t\t\t} else {\n\t\t\t\tviewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange);\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, this.configuration.editor.readOnly);\n\t\tconst startLineNumber = viewportRange.startLineNumber;\n\t\tconst endLineNumber = viewportRange.endLineNumber;\n\n\t\tlet decorationsInViewport: ViewModelDecoration[] = [], decorationsInViewportLen = 0;\n\t\tlet 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\tlet modelDecoration = modelDecorations[i];\n\t\t\tlet decorationOptions = modelDecoration.options;\n\n\t\t\tlet viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);\n\t\t\tlet viewRange = viewModelDecoration.range;\n\n\t\t\tdecorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;\n\n\t\t\tif (decorationOptions.inlineClassName) {\n\t\t\t\tlet inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? InlineDecorationType.RegularAffectingLetterSpacing : InlineDecorationType.Regular);\n\t\t\t\tlet intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);\n\t\t\t\tlet 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\tlet 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\tlet 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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\tprivate _cutStartIndex: number;\n\tprivate _cutEndIndex: number;\n\tprivate _moved: boolean;\n\n\tprivate _selectionId: string;\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\tlet s = this._selection;\n\t\tthis._selectionId = builder.trackSelection(s);\n\t\tif (s.startLineNumber !== s.endLineNumber) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._isMovingLeft && s.startColumn === 0) {\n\t\t\treturn;\n\t\t} else if (!this._isMovingLeft && s.endColumn === model.getLineMaxColumn(s.startLineNumber)) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet lineNumber = s.selectionStartLineNumber;\n\t\tlet lineContent = model.getLineContent(lineNumber);\n\n\t\tlet left: string;\n\t\tlet middle: string;\n\t\tlet right: string;\n\n\t\tif (this._isMovingLeft) {\n\t\t\tleft = lineContent.substring(0, s.startColumn - 2);\n\t\t\tmiddle = lineContent.substring(s.startColumn - 1, s.endColumn - 1);\n\t\t\tright = lineContent.substring(s.startColumn - 2, s.startColumn - 1) + lineContent.substring(s.endColumn - 1);\n\t\t} else {\n\t\t\tleft = lineContent.substring(0, s.startColumn - 1) + lineContent.substring(s.endColumn - 1, s.endColumn);\n\t\t\tmiddle = lineContent.substring(s.startColumn - 1, s.endColumn - 1);\n\t\t\tright = lineContent.substring(s.endColumn);\n\t\t}\n\n\t\tlet newLineContent = left + middle + right;\n\n\t\tbuilder.addEditOperation(new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber)), null);\n\t\tbuilder.addEditOperation(new Range(lineNumber, 1, lineNumber, 1), newLineContent);\n\n\t\tthis._cutStartIndex = s.startColumn + (this._isMovingLeft ? -1 : 1);\n\t\tthis._cutEndIndex = this._cutStartIndex + s.endColumn - s.startColumn;\n\t\tthis._moved = true;\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {\n\t\tlet result = helper.getTrackedSelection(this._selectionId);\n\t\tif (this._moved) {\n\t\t\tresult = result.setStartPosition(result.startLineNumber, this._cutStartIndex);\n\t\t\tresult = result.setEndPosition(result.startLineNumber, this._cutEndIndex);\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 { startsWith } from 'vs/base/common/strings';\nimport { CodeAction } from 'vs/editor/common/modes';\n\nexport class CodeActionKind {\n\tprivate static readonly sep = '.';\n\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 = new CodeActionKind('source.organizeImports');\n\tpublic static readonly SourceFixAll = new CodeActionKind('source.fixAll');\n\n\tconstructor(\n\t\tpublic readonly value: string\n\t) { }\n\n\tpublic contains(other: CodeActionKind): boolean {\n\t\treturn this.value === other.value || startsWith(other.value, 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\nexport const enum CodeActionAutoApply {\n\tIfSingle,\n\tFirst,\n\tNever,\n}\n\nexport interface CodeActionFilter {\n\treadonly kind?: 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.kind && !filter.kind.intersects(providedKind)) {\n\t\treturn false;\n\t}\n\n\t// Don't return source actions unless they are explicitly requested\n\tif (CodeActionKind.Source.contains(providedKind) && !filter.includeSourceActions) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\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.kind) {\n\t\tif (!actionKind || !filter.kind.contains(actionKind)) {\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\nexport interface CodeActionTrigger {\n\treadonly type: 'auto' | 'manual';\n\treadonly filter?: CodeActionFilter;\n\treadonly autoApply?: CodeActionAutoApply;\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Action } from 'vs/base/common/actions';\nimport { canceled } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { CodeAction } from 'vs/editor/common/modes';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction';\n\nexport class CodeActionContextMenu {\n\n\tprivate _visible: boolean;\n\n\tprivate readonly _onDidExecuteCodeAction = new Emitter<void>();\n\tpublic readonly onDidExecuteCodeAction: Event<void> = this._onDidExecuteCodeAction.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _onApplyCodeAction: (action: CodeAction) => Promise<any>\n\t) { }\n\n\tasync show(actionsToShow: Promise<CodeActionSet>, at?: { x: number; y: number } | Position): Promise<void> {\n\t\tconst codeActions = await actionsToShow;\n\t\tif (!this._editor.getDomNode()) {\n\t\t\t// cancel when editor went off-dom\n\t\t\treturn Promise.reject(canceled());\n\t\t}\n\t\tthis._visible = true;\n\t\tconst actions = codeActions.actions.map(action => this.codeActionToAction(action));\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tgetAnchor: () => {\n\t\t\t\tif (Position.isIPosition(at)) {\n\t\t\t\t\tat = this._toCoords(at);\n\t\t\t\t}\n\t\t\t\treturn at || { x: 0, y: 0 };\n\t\t\t},\n\t\t\tgetActions: () => actions,\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});\n\t}\n\n\tprivate codeActionToAction(action: CodeAction): Action {\n\t\tconst id = action.command ? action.command.id : action.title;\n\t\tconst title = action.title;\n\t\treturn new Action(id, title, undefined, true, () =>\n\t\t\tthis._onApplyCodeAction(action)\n\t\t\t\t.finally(() => this._onDidExecuteCodeAction.fire(undefined)));\n\t}\n\n\tget isVisible(): boolean {\n\t\treturn this._visible;\n\t}\n\n\tprivate _toCoords(position: Position): { 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/modes';\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 _onColorFlushed = new Emitter<Color>();\n\treadonly onColorFlushed: Event<Color> = this._onColorFlushed.event;\n\n\tprivate _onDidChangeColor = new Emitter<Color>();\n\treadonly onDidChangeColor: Event<Color> = this._onDidChangeColor.event;\n\n\tprivate _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 === 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 } 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 * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\n\nexport class BlockCommentCommand implements editorCommon.ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate _usedEndToken: string | null;\n\n\tconstructor(selection: Selection) {\n\t\tthis._selection = selection;\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, model: ITextModel, builder: editorCommon.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: IIdentifiedSingleEditOperation[];\n\n\t\tif (startTokenIndex !== -1 && endTokenIndex !== -1) {\n\t\t\t// Consider spaces as part of the comment tokens\n\t\t\tif (startTokenIndex + startToken.length < startLineText.length) {\n\t\t\t\tif (startLineText.charCodeAt(startTokenIndex + startToken.length) === CharCode.Space) {\n\t\t\t\t\t// Pretend the start token contains a trailing space\n\t\t\t\t\tstartToken = startToken + ' ';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (endTokenIndex > 0) {\n\t\t\t\tif (endLineText.charCodeAt(endTokenIndex - 1) === CharCode.Space) {\n\t\t\t\t\t// Pretend the end token contains a leading space\n\t\t\t\t\tendToken = ' ' + endToken;\n\t\t\t\t\tendTokenIndex -= 1;\n\t\t\t\t}\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);\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): IIdentifiedSingleEditOperation[] {\n\t\tlet res: IIdentifiedSingleEditOperation[] = [];\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): IIdentifiedSingleEditOperation[] {\n\t\tlet res: IIdentifiedSingleEditOperation[] = [];\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 + ' '));\n\n\t\t\t// Insert block comment end\n\t\t\tres.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), ' ' + 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: editorCommon.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 = 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\tthis._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, model, builder);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: editorCommon.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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\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 { Selection } from 'vs/editor/common/core/selection';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { BlockCommentCommand } from 'vs/editor/contrib/comment/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 editorCommon.ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate _selectionId: string;\n\tprivate _deltaColumn: number;\n\tprivate _moveEndPositionDown: boolean;\n\tprivate readonly _tabSize: number;\n\tprivate readonly _type: Type;\n\n\tconstructor(selection: Selection, tabSize: number, type: Type) {\n\t\tthis._selection = selection;\n\t\tthis._tabSize = tabSize;\n\t\tthis._type = type;\n\t\tthis._deltaColumn = 0;\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\tpublic static _gatherPreflightCommentStrings(model: ITextModel, startLineNumber: number, endLineNumber: number): ILinePreflightData[] | null {\n\n\t\tmodel.tokenizeIfCheap(startLineNumber);\n\t\tconst languageId = model.getLanguageIdAtPosition(startLineNumber, 1);\n\n\t\tconst config = LanguageConfigurationRegistry.getComments(languageId);\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, model: ISimpleModel, lines: ILinePreflightData[], startLineNumber: number): 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\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\tif (type === Type.Toggle) {\n\t\t\t\t\tlineData.ignore = true;\n\t\t\t\t} else if (type === Type.ForceAdd) {\n\t\t\t\t\tlineData.ignore = true;\n\t\t\t\t} else {\n\t\t\t\t\tlineData.ignore = true;\n\t\t\t\t}\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) {\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, model: ITextModel, startLineNumber: number, endLineNumber: number): IPreflightData {\n\t\tconst lines = LineCommentCommand._gatherPreflightCommentStrings(model, startLineNumber, endLineNumber);\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, model, lines, startLineNumber);\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: editorCommon.IEditOperationBuilder, data: IPreflightDataSupported, s: Selection): void {\n\n\t\tlet ops: IIdentifiedSingleEditOperation[];\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 = LineCommentCommand._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 (ops[i].range.isEmpty() && ops[i].range.getStartPosition().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): IIdentifiedSingleEditOperation[] | 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: editorCommon.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), startToken, endToken\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)), startToken, endToken\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: editorCommon.IEditOperationBuilder): void {\n\n\t\tlet s = this._selection;\n\t\tthis._moveEndPositionDown = false;\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(this._type, model, s.startLineNumber, s.endLineNumber);\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: editorCommon.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): IIdentifiedSingleEditOperation[] {\n\t\tlet res: IIdentifiedSingleEditOperation[] = [];\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\tpublic static _createAddLineCommentsOperations(lines: ILinePreflightData[], startLineNumber: number): IIdentifiedSingleEditOperation[] {\n\t\tlet res: IIdentifiedSingleEditOperation[] = [];\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 + ' '));\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t// TODO@Alex -> duplicated in characterHardWrappingLineMapper\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 = Number.MAX_VALUE;\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 editorCommon from 'vs/editor/common/editorCommon';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\n\n\nexport class DragAndDropCommand implements editorCommon.ICommand {\n\n\tprivate readonly selection: Selection;\n\tprivate readonly targetPosition: Position;\n\tprivate targetSelection: Selection;\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}\n\n\tpublic getEditOperations(model: ITextModel, builder: editorCommon.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 postion. 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: editorCommon.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 { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { Range } from 'vs/editor/common/core/range';\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\tsearchScope: boolean;\n\tmatchesPosition: boolean;\n\tmatchesCount: boolean;\n\tcurrentMatch: boolean;\n}\n\nexport const enum FindOptionOverride {\n\tNotSet = 0,\n\tTrue = 1,\n\tFalse = 2\n}\n\nexport interface INewFindReplaceState {\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\tsearchScope?: Range | null;\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 implements IDisposable {\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 _searchScope: Range | null;\n\tprivate _matchesPosition: number;\n\tprivate _matchesCount: number;\n\tprivate _currentMatch: Range | null;\n\tprivate readonly _onFindReplaceStateChange: 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\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\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 get onFindReplaceStateChange(): Event<FindReplaceStateChangedEvent> { return this._onFindReplaceStateChange.event; }\n\n\tconstructor() {\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._searchScope = null;\n\t\tthis._matchesPosition = 0;\n\t\tthis._matchesCount = 0;\n\t\tthis._currentMatch = null;\n\t\tthis._onFindReplaceStateChange = new Emitter<FindReplaceStateChangedEvent>();\n\t}\n\n\tpublic dispose(): void {\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\tsearchScope: false,\n\t\t\tmatchesPosition: false,\n\t\t\tmatchesCount: false,\n\t\t\tcurrentMatch: 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, 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\tsearchScope: false,\n\t\t\tmatchesPosition: false,\n\t\t\tmatchesCount: false,\n\t\t\tcurrentMatch: 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\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.searchScope !== 'undefined') {\n\t\t\tif (!Range.equalsRange(this._searchScope, newState.searchScope)) {\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\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\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 (somethingChanged) {\n\t\t\tthis._onFindReplaceStateChange.fire(changeEvent);\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 * as editorCommon 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 editorCommon.ICommand {\n\n\tprivate readonly _editorSelection: Selection;\n\tprivate _trackedEditorSelectionId: string;\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}\n\n\tpublic getEditOperations(model: ITextModel, builder: editorCommon.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: editorCommon.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';\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 replacemend 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): string {\n\t\tif (this._state.kind === ReplacePatternKind.StaticValue) {\n\t\t\treturn this._state.staticValue;\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\tresult += ReplacePattern._substitute(piece.matchIndex, matches);\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);\n\t}\n\n\tpublic static matchIndex(index: number): ReplacePiece {\n\t\treturn new ReplacePiece(null, index);\n\t}\n\n\tpublic readonly staticValue: string | null;\n\tpublic readonly matchIndex: number;\n\n\tprivate constructor(staticValue: string | null, matchIndex: number) {\n\t\tthis.staticValue = staticValue;\n\t\tthis.matchIndex = matchIndex;\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): 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.matchIndex(index);\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 * $$\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 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}\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);\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);\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);\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}\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 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 * Copyright (c) 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, IModelDecorationOptions, IModelDeltaDecoration, IModelDecorationsChangeAccessor } from 'vs/editor/common/model';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { FoldingRegions, ILineRange, FoldingRegion } from './foldingRanges';\n\nexport interface IDecorationProvider {\n\tgetDecorationOption(isCollapsed: 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 _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();\n\n\tpublic get regions(): FoldingRegions { return this._regions; }\n\tpublic get onDidChange(): Event<FoldingModelChangeEvent> { return this._updateEventEmitter.event; }\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(regions: FoldingRegion[]) {\n\t\tif (!regions.length) {\n\t\t\treturn;\n\t\t}\n\t\tlet processed = {};\n\t\tthis._decorationProvider.changeDecorations(accessor => {\n\t\t\tfor (let region of regions) {\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\t\t\t\t\tlet newCollapseState = !this._regions.isCollapsed(index);\n\t\t\t\t\tthis._regions.setCollapsed(index, newCollapseState);\n\t\t\t\t\taccessor.changeDecorationOptions(editorDecorationId, this._decorationProvider.getDecorationOption(newCollapseState));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis._updateEventEmitter.fire({ model: this, collapseStateChanged: regions });\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 initRange = (index: number, isCollapsed: boolean) => {\n\t\t\tlet startLineNumber = newRegions.getStartLineNumber(index);\n\t\t\tif (isCollapsed && isBlocked(startLineNumber, newRegions.getEndLineNumber(index))) {\n\t\t\t\tisCollapsed = false;\n\t\t\t}\n\t\t\tnewRegions.setCollapsed(index, isCollapsed);\n\t\t\tlet maxColumn = this._textModel.getLineMaxColumn(startLineNumber);\n\t\t\tlet decorationRange = {\n\t\t\t\tstartLineNumber: startLineNumber,\n\t\t\t\tstartColumn: maxColumn,\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) });\n\t\t};\n\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 (this._textModel.getLineMaxColumn(collapsedStartLineNumber) === decRange.startColumn) { // test that the decoration is still at the end otherwise 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?: (r: FoldingRegion, level?: number) => boolean): 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(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\n\n\n/**\n * Collapse or expand the regions at the given locations including all children.\n * @param doCollapse Wheter to collase 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[]) {\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 Wheter to collase 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 setCollapseStateLevelsUp(foldingModel: FoldingModel, doCollapse: boolean, levels: number, lineNumbers: number[]) {\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 * 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 Wheter to collase 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 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 * Copyright (c) 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 { Range, IRange } from 'vs/editor/common/core/range';\nimport { FoldingModel, CollapseMemento } from 'vs/editor/contrib/folding/foldingModel';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { findFirstInSorted } from 'vs/base/common/arrays';\n\nexport class HiddenRangeModel {\n\tprivate readonly _foldingModel: FoldingModel;\n\tprivate _hiddenRanges: IRange[];\n\tprivate _foldingModelListener: IDisposable | null;\n\tprivate _updateEventEmitter = new Emitter<IRange[]>();\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\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 (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._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 * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { FoldingRangeProvider, FoldingRange, FoldingContext } from 'vs/editor/common/modes';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { RangeProvider } from './folding';\nimport { MAX_LINE_NUMBER, FoldingRegions } from './foldingRanges';\nimport { CancellationToken } from 'vs/base/common/cancellation';\n\nconst MAX_FOLDING_REGIONS = 5000;\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\tconstructor(private readonly editorModel: ITextModel, private providers: FoldingRangeProvider[], private limit = MAX_FOLDING_REGIONS) {\n\t}\n\n\tcompute(cancellationToken: CancellationToken): 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);\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}\n\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) {\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\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): FoldingRegions {\n\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);\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 { ITextModel, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { FoldingRegions, ILineRange } from 'vs/editor/contrib/folding/foldingRanges';\nimport { RangeProvider } from './folding';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IFoldingRangeData, sanitizeRanges } from 'vs/editor/contrib/folding/syntaxRangeProvider';\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\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 } from 'vs/editor/common/core/editOperation';\nimport { Range } from 'vs/editor/common/core/range';\nimport { EndOfLineSequence, ISingleEditOperation } from 'vs/editor/common/model';\nimport { TextEdit } from 'vs/editor/common/modes';\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[]) {\n\t\teditor.pushUndoStop();\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\teditor.pushUndoStop();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./goToDefinitionMouse';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport * as browser from 'vs/base/browser/browser';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { ICodeEditor, IEditorMouseEvent, IMouseTarget } from 'vs/editor/browser/editorBrowser';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport * as platform from 'vs/base/common/platform';\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 = (browser.isIE || source.event.detail <= 1); // IE does not support event.detail properly\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\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._opts = createOptions(this._editor.getConfiguration().multiCursorModifier);\n\n\t\tthis.lastMouseMoveEvent = null;\n\t\tthis.hasTriggerKeyOnMouseDown = false;\n\n\t\tthis._register(this._editor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.multiCursorModifier) {\n\t\t\t\tconst newOpts = createOptions(this._editor.getConfiguration().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._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}\n\n\tprivate onEditorMouseUp(mouseEvent: ClickLinkMouseEvent): void {\n\t\tif (this.hasTriggerKeyOnMouseDown) {\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 { CancelablePromise, RunOnceScheduler, createCancelablePromise } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\n\nexport interface IHoverComputer<Result> {\n\n\t/**\n\t * This is called after half the hover time\n\t */\n\tcomputeAsync?: (token: CancellationToken) => Promise<Result>;\n\n\t/**\n\t * This is called after all the hover time\n\t */\n\tcomputeSync?: () => Result;\n\n\t/**\n\t * This is called whenever one of the compute* methods returns a truey value\n\t */\n\tonResult: (result: Result, isFromSynchronousComputation: boolean) => void;\n\n\t/**\n\t * This is what will be sent as progress/complete to the computation promise\n\t */\n\tgetResult: () => Result;\n\n\tgetResultWithLoadingMessage: () => Result;\n\n}\n\nconst enum ComputeHoverOperationState {\n\tIDLE = 0,\n\tFIRST_WAIT = 1,\n\tSECOND_WAIT = 2,\n\tWAITING_FOR_ASYNC_COMPUTATION = 3\n}\n\nexport const enum HoverStartMode {\n\tDelayed = 0,\n\tImmediate = 1\n}\n\nexport class HoverOperation<Result> {\n\n\tprivate readonly _computer: IHoverComputer<Result>;\n\tprivate _state: ComputeHoverOperationState;\n\tprivate _hoverTime: number;\n\n\tprivate readonly _firstWaitScheduler: RunOnceScheduler;\n\tprivate readonly _secondWaitScheduler: RunOnceScheduler;\n\tprivate readonly _loadingMessageScheduler: RunOnceScheduler;\n\tprivate _asyncComputationPromise: CancelablePromise<Result> | null;\n\tprivate _asyncComputationPromiseDone: boolean;\n\n\tprivate readonly _completeCallback: (r: Result) => void;\n\tprivate readonly _errorCallback: ((err: any) => void) | null | undefined;\n\tprivate readonly _progressCallback: (progress: any) => void;\n\n\tconstructor(computer: IHoverComputer<Result>, success: (r: Result) => void, error: ((err: any) => void) | null | undefined, progress: (progress: any) => void, hoverTime: number) {\n\t\tthis._computer = computer;\n\t\tthis._state = ComputeHoverOperationState.IDLE;\n\t\tthis._hoverTime = hoverTime;\n\n\t\tthis._firstWaitScheduler = new RunOnceScheduler(() => this._triggerAsyncComputation(), 0);\n\t\tthis._secondWaitScheduler = new RunOnceScheduler(() => this._triggerSyncComputation(), 0);\n\t\tthis._loadingMessageScheduler = new RunOnceScheduler(() => this._showLoadingMessage(), 0);\n\n\t\tthis._asyncComputationPromise = null;\n\t\tthis._asyncComputationPromiseDone = false;\n\n\t\tthis._completeCallback = success;\n\t\tthis._errorCallback = error;\n\t\tthis._progressCallback = progress;\n\t}\n\n\tpublic setHoverTime(hoverTime: number): void {\n\t\tthis._hoverTime = hoverTime;\n\t}\n\n\tprivate _firstWaitTime(): number {\n\t\treturn this._hoverTime / 2;\n\t}\n\n\tprivate _secondWaitTime(): number {\n\t\treturn this._hoverTime / 2;\n\t}\n\n\tprivate _loadingMessageTime(): number {\n\t\treturn 3 * this._hoverTime;\n\t}\n\n\tprivate _triggerAsyncComputation(): void {\n\t\tthis._state = ComputeHoverOperationState.SECOND_WAIT;\n\t\tthis._secondWaitScheduler.schedule(this._secondWaitTime());\n\n\t\tif (this._computer.computeAsync) {\n\t\t\tthis._asyncComputationPromiseDone = false;\n\t\t\tthis._asyncComputationPromise = createCancelablePromise(token => this._computer.computeAsync!(token));\n\t\t\tthis._asyncComputationPromise.then((asyncResult: Result) => {\n\t\t\t\tthis._asyncComputationPromiseDone = true;\n\t\t\t\tthis._withAsyncResult(asyncResult);\n\t\t\t}, (e) => this._onError(e));\n\n\t\t} else {\n\t\t\tthis._asyncComputationPromiseDone = true;\n\t\t}\n\t}\n\n\tprivate _triggerSyncComputation(): void {\n\t\tif (this._computer.computeSync) {\n\t\t\tthis._computer.onResult(this._computer.computeSync(), true);\n\t\t}\n\n\t\tif (this._asyncComputationPromiseDone) {\n\t\t\tthis._state = ComputeHoverOperationState.IDLE;\n\t\t\tthis._onComplete(this._computer.getResult());\n\t\t} else {\n\t\t\tthis._state = ComputeHoverOperationState.WAITING_FOR_ASYNC_COMPUTATION;\n\t\t\tthis._onProgress(this._computer.getResult());\n\t\t}\n\t}\n\n\tprivate _showLoadingMessage(): void {\n\t\tif (this._state === ComputeHoverOperationState.WAITING_FOR_ASYNC_COMPUTATION) {\n\t\t\tthis._onProgress(this._computer.getResultWithLoadingMessage());\n\t\t}\n\t}\n\n\tprivate _withAsyncResult(asyncResult: Result): void {\n\t\tif (asyncResult) {\n\t\t\tthis._computer.onResult(asyncResult, false);\n\t\t}\n\n\t\tif (this._state === ComputeHoverOperationState.WAITING_FOR_ASYNC_COMPUTATION) {\n\t\t\tthis._state = ComputeHoverOperationState.IDLE;\n\t\t\tthis._onComplete(this._computer.getResult());\n\t\t}\n\t}\n\n\tprivate _onComplete(value: Result): void {\n\t\tif (this._completeCallback) {\n\t\t\tthis._completeCallback(value);\n\t\t}\n\t}\n\n\tprivate _onError(error: any): void {\n\t\tif (this._errorCallback) {\n\t\t\tthis._errorCallback(error);\n\t\t} else {\n\t\t\tonUnexpectedError(error);\n\t\t}\n\t}\n\n\tprivate _onProgress(value: Result): void {\n\t\tif (this._progressCallback) {\n\t\t\tthis._progressCallback(value);\n\t\t}\n\t}\n\n\tpublic start(mode: HoverStartMode): void {\n\t\tif (mode === HoverStartMode.Delayed) {\n\t\t\tif (this._state === ComputeHoverOperationState.IDLE) {\n\t\t\t\tthis._state = ComputeHoverOperationState.FIRST_WAIT;\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 ComputeHoverOperationState.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 ComputeHoverOperationState.SECOND_WAIT:\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._loadingMessageScheduler.cancel();\n\t\tif (this._state === ComputeHoverOperationState.FIRST_WAIT) {\n\t\t\tthis._firstWaitScheduler.cancel();\n\t\t}\n\t\tif (this._state === ComputeHoverOperationState.SECOND_WAIT) {\n\t\t\tthis._secondWaitScheduler.cancel();\n\t\t\tif (this._asyncComputationPromise) {\n\t\t\t\tthis._asyncComputationPromise.cancel();\n\t\t\t\tthis._asyncComputationPromise = null;\n\t\t\t}\n\t\t}\n\t\tif (this._state === ComputeHoverOperationState.WAITING_FOR_ASYNC_COMPUTATION) {\n\t\t\tif (this._asyncComputationPromise) {\n\t\t\t\tthis._asyncComputationPromise.cancel();\n\t\t\t\tthis._asyncComputationPromise = null;\n\t\t\t}\n\t\t}\n\t\tthis._state = ComputeHoverOperationState.IDLE;\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 { toggleClass } from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\n\nexport class ContentHoverWidget extends Widget implements editorBrowser.IContentWidget {\n\n\tprivate readonly _id: string;\n\tprotected _editor: editorBrowser.ICodeEditor;\n\tprivate _isVisible: boolean;\n\tprivate readonly _containerDomNode: HTMLElement;\n\tprivate readonly _domNode: HTMLElement;\n\tprotected _showAtPosition: Position | null;\n\tprotected _showAtRange: Range | null;\n\tprivate _stoleFocus: boolean;\n\tprivate readonly scrollbar: DomScrollableElement;\n\tprivate disposables: IDisposable[] = [];\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\tpublic allowEditorOverflow = true;\n\n\tprotected get isVisible(): boolean {\n\t\treturn this._isVisible;\n\t}\n\n\tprotected set isVisible(value: boolean) {\n\t\tthis._isVisible = value;\n\t\ttoggleClass(this._containerDomNode, 'hidden', !this._isVisible);\n\t}\n\n\tconstructor(id: string, editor: editorBrowser.ICodeEditor) {\n\t\tsuper();\n\t\tthis._id = id;\n\t\tthis._editor = editor;\n\t\tthis._isVisible = false;\n\n\t\tthis._containerDomNode = document.createElement('div');\n\t\tthis._containerDomNode.className = 'monaco-editor-hover hidden';\n\t\tthis._containerDomNode.tabIndex = 0;\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'monaco-editor-hover-content';\n\n\t\tthis.scrollbar = new DomScrollableElement(this._domNode, {});\n\t\tthis.disposables.push(this.scrollbar);\n\t\tthis._containerDomNode.appendChild(this.scrollbar.getDomNode());\n\n\t\tthis.onkeydown(this._containerDomNode, (e: IKeyboardEvent) => {\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t});\n\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {\n\t\t\tif (e.fontInfo) {\n\t\t\t\tthis.updateFont();\n\t\t\t}\n\t\t}));\n\n\t\tthis._editor.onDidLayoutChange(e => this.layout());\n\n\t\tthis.layout();\n\t\tthis._editor.addContentWidget(this);\n\t\tthis._showAtPosition = null;\n\t\tthis._showAtRange = null;\n\t}\n\n\tpublic getId(): string {\n\t\treturn this._id;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._containerDomNode;\n\t}\n\n\tpublic showAt(position: Position, range: Range | null, focus: boolean): void {\n\t\t// Position has changed\n\t\tthis._showAtPosition = position;\n\t\tthis._showAtRange = range;\n\t\tthis.isVisible = true;\n\n\t\tthis._editor.layoutContentWidget(this);\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\t\tthis._stoleFocus = focus;\n\t\tif (focus) {\n\t\t\tthis._containerDomNode.focus();\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (!this.isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isVisible = false;\n\n\t\tthis._editor.layoutContentWidget(this);\n\t\tif (this._stoleFocus) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tpublic getPosition(): editorBrowser.IContentWidgetPosition | null {\n\t\tif (this.isVisible) {\n\t\t\treturn {\n\t\t\t\tposition: this._showAtPosition,\n\t\t\t\trange: this._showAtRange,\n\t\t\t\tpreference: [\n\t\t\t\t\teditorBrowser.ContentWidgetPositionPreference.ABOVE,\n\t\t\t\t\teditorBrowser.ContentWidgetPositionPreference.BELOW\n\t\t\t\t]\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._editor.removeContentWidget(this);\n\t\tthis.disposables = dispose(this.disposables);\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateFont(): void {\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._domNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprotected updateContents(node: Node): void {\n\t\tthis._domNode.textContent = '';\n\t\tthis._domNode.appendChild(node);\n\t\tthis.updateFont();\n\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis.onContentsChange();\n\t}\n\n\tprotected onContentsChange(): void {\n\t\tthis.scrollbar.scanDomNode();\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.getConfiguration().fontInfo;\n\n\t\tthis._domNode.style.fontSize = `${fontSize}px`;\n\t\tthis._domNode.style.lineHeight = `${lineHeight}px`;\n\t\tthis._domNode.style.maxHeight = `${height}px`;\n\t\tthis._domNode.style.maxWidth = `${Math.max(this._editor.getLayoutInfo().width * 0.66, 500)}px`;\n\t}\n}\n\nexport class GlyphHoverWidget extends Widget implements editorBrowser.IOverlayWidget {\n\n\tprivate readonly _id: string;\n\tprotected _editor: editorBrowser.ICodeEditor;\n\tprivate _isVisible: boolean;\n\tprivate readonly _domNode: HTMLElement;\n\tprotected _showAtLineNumber: number;\n\n\tconstructor(id: string, editor: editorBrowser.ICodeEditor) {\n\t\tsuper();\n\t\tthis._id = id;\n\t\tthis._editor = editor;\n\t\tthis._isVisible = false;\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'monaco-editor-hover hidden';\n\t\tthis._domNode.setAttribute('aria-hidden', 'true');\n\t\tthis._domNode.setAttribute('role', 'presentation');\n\n\t\tthis._showAtLineNumber = -1;\n\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {\n\t\t\tif (e.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\tprotected get isVisible(): boolean {\n\t\treturn this._isVisible;\n\t}\n\n\tprotected set isVisible(value: boolean) {\n\t\tthis._isVisible = value;\n\t\ttoggleClass(this._domNode, 'hidden', !this._isVisible);\n\t}\n\n\tpublic getId(): string {\n\t\treturn this._id;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic showAt(lineNumber: number): void {\n\t\tthis._showAtLineNumber = lineNumber;\n\n\t\tif (!this.isVisible) {\n\t\t\tthis.isVisible = true;\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(this._showAtLineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getConfiguration().lineHeight;\n\t\tconst nodeHeight = this._domNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\n\t\tthis._domNode.style.left = `${editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth}px`;\n\t\tthis._domNode.style.top = `${Math.max(Math.round(top), 0)}px`;\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}\n\n\tpublic getPosition(): editorBrowser.IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tprivate updateFont(): void {\n\t\tconst codeTags: HTMLElement[] = Array.prototype.slice.call(this._domNode.getElementsByTagName('code'));\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._domNode.getElementsByClassName('code'));\n\n\t\t[...codeTags, ...codeClasses].forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprotected updateContents(node: Node): void {\n\t\tthis._domNode.textContent = '';\n\t\tthis._domNode.appendChild(node);\n\t\tthis.updateFont();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Selection } from 'vs/editor/common/core/selection';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class InPlaceReplaceCommand implements editorCommon.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: editorCommon.IEditOperationBuilder): void {\n\t\tbuilder.addTrackedEditOperation(this._editRange, this._text);\n\t}\n\n\tpublic computeCursorState(model: ITextModel, helper: editorCommon.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 { Range } from 'vs/editor/common/core/range';\nimport { Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\n\nexport class CopyLinesCommand implements editorCommon.ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _isCopyingDown: boolean;\n\n\tprivate _selectionDirection: SelectionDirection;\n\tprivate _selectionId: string;\n\tprivate _startLineNumberDelta: number;\n\tprivate _endLineNumberDelta: number;\n\n\tconstructor(selection: Selection, isCopyingDown: boolean) {\n\t\tthis._selection = selection;\n\t\tthis._isCopyingDown = isCopyingDown;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: editorCommon.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._isCopyingDown) {\n\t\t\tbuilder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\\n' + sourceText);\n\t\t} else {\n\t\t\tbuilder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), sourceText + '\\n');\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: editorCommon.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 } from 'vs/editor/common/core/editOperation';\nimport { 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, ITextModel } from 'vs/editor/common/model';\n\nexport class SortLinesCommand implements editorCommon.ICommand {\n\n\tprivate readonly selection: Selection;\n\tprivate selectionId: string;\n\tprivate readonly descending: boolean;\n\n\tconstructor(selection: Selection, descending: boolean) {\n\t\tthis.selection = selection;\n\t\tthis.descending = descending;\n\t}\n\n\tpublic getEditOperations(model: ITextModel, builder: editorCommon.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: editorCommon.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((a, b) => {\n\t\treturn a.toLowerCase().localeCompare(b.toLowerCase());\n\t});\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): IIdentifiedSingleEditOperation | 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 { SelectionRangeProvider, SelectionRange } from 'vs/editor/common/modes';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { LinkedList } from 'vs/base/common/linkedList';\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(resolve => BracketSelectionRangeProvider._bracketsRightYield(resolve, 0, model, position, ranges));\n\t\t\tawait new Promise(resolve => BracketSelectionRangeProvider._bracketsLeftYield(resolve, 0, model, position, ranges, bucket));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static readonly _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.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;\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.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;\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, kind: 'statement.brackets' });\n\t\t\t\t\t\tbucket.push({ range: outerBracket, kind: 'statement.brackets.full' });\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()), kind: 'statement.brackets.leading' });\n\t\t\tbucket.push({ range: Range.fromPositions(new Position(startLine, 1), bracket.getEndPosition()), kind: 'statement.brackets.leading.full' });\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()), kind: 'statement.brackets.leading' });\n\t\t\t\tbucket.push({ range: Range.fromPositions(new Position(aboveLine, 1), bracket.getEndPosition()), kind: 'statement.brackets.leading.full' });\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 { SelectionRangeProvider, SelectionRange } from 'vs/editor/common/modes';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { isUpperAsciiLetter, isLowerAsciiLetter } from 'vs/base/common/strings';\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(), kind: 'statement.all' });\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 (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), kind: 'statement.word.part' });\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), kind: 'statement.word' });\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)), kind: 'statement.line' });\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;\n\n\tconstructor() {\n\t\tthis.text('');\n\t}\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\ttoString() {\n\t\treturn this.value;\n\t}\n\tlen(): 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\tappendChild(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\ttoString() {\n\t\treturn this.options[0].value;\n\t}\n\n\tlen(): 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;\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\ttoString(): 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 (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-z]+/gi);\n\t\tif (!match) {\n\t\t\treturn value;\n\t\t}\n\t\treturn match.map(function (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\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\tappendChild(child: Marker) {\n\t\tthis._placeholders = undefined;\n\t\treturn super.appendChild(child);\n\t}\n\n\treplace(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\tprivate _scanner = new Scanner();\n\tprivate _token: Token;\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[]>();\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\tif (this._token.type === TokenType.EOF) {\n\t\t\treturn false;\n\t\t}\n\t\tlet start = this._token;\n\t\twhile (this._token.type !== type) {\n\t\t\tthis._token = this._scanner.next();\n\t\t\tif (this._token.type === TokenType.EOF) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tlet value = this._scanner.value.substring(start.pos, this._token.pos);\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 { binarySearch, isFalsyOrEmpty } from 'vs/base/common/arrays';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { CompletionItem, CompletionItemKind } from 'vs/editor/common/modes';\nimport { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/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 create(service: IEditorWorkerService, editor: ICodeEditor): Promise<WordDistance> {\n\n\t\tif (!editor.getConfiguration().contribInfo.suggest.localityBonus) {\n\t\t\treturn Promise.resolve(WordDistance.None);\n\t\t}\n\n\t\tif (!editor.hasModel()) {\n\t\t\treturn Promise.resolve(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 Promise.resolve(WordDistance.None);\n\t\t}\n\n\t\treturn new BracketSelectionRangeProvider().provideSelectionRanges(model, [position]).then(ranges => {\n\t\t\tif (!ranges || ranges.length === 0 || ranges[0].length === 0) {\n\t\t\t\treturn WordDistance.None;\n\t\t\t}\n\t\t\treturn service.computeWordRanges(model.uri, ranges[0][0].range).then(wordRanges => {\n\t\t\t\treturn new class extends WordDistance {\n\t\t\t\t\tdistance(anchor: IPosition, suggestion: CompletionItem) {\n\t\t\t\t\t\tif (!wordRanges || !position.equals(editor.getPosition())) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (suggestion.kind === CompletionItemKind.Keyword) {\n\t\t\t\t\t\t\treturn 2 << 20;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet word = suggestion.label;\n\t\t\t\t\t\tlet wordLines = wordRanges[word];\n\t\t\t\t\t\tif (isFalsyOrEmpty(wordLines)) {\n\t\t\t\t\t\t\treturn 2 << 20;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet idx = binarySearch(wordLines, Range.fromPositions(anchor), Range.compareRangesUsingStarts);\n\t\t\t\t\t\tlet bestWordRange = idx >= 0 ? wordLines[idx] : wordLines[Math.max(0, ~idx - 1)];\n\t\t\t\t\t\tlet blockDistance = ranges.length;\n\t\t\t\t\t\tfor (const range of ranges[0]) {\n\t\t\t\t\t\t\tif (!Range.containsRange(range.range, bestWordRange)) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tblockDistance -= 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn blockDistance;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\t\t});\n\t}\n\n\tabstract distance(anchor: IPosition, suggestion: CompletionItem): number;\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\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\tnoThrow: boolean;\n\tignoreCase: 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\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 (let idx in obj) {\n\t\tif (obj.hasOwnProperty(idx)) {\n\t\t\tif (!(elemType(obj[idx]))) {\n\t\t\t\treturn false;\n\t\t\t}\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.\n * Also replaces @\\w+ or sequences with the content of the specified attribute\n */\nfunction compileRegExp(lexer: monarchCommon.ILexerMin, str: string): RegExp {\n\tlet n = 0;\n\twhile (str.indexOf('@') >= 0 && n < 5) { // at most 5 expansions\n\t\tn++;\n\t\tstr = str.replace(/@(\\w+)/g, function (s, attr?) {\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}\n\n\treturn new RegExp(str, (lexer.ignoreCase ? 'i' : ''));\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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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\tlet patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s, id, matches, state, eos) {\n\t\t\t\tlet 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\tlet 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\tlet 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\tlet results: monarchCommon.FuzzyAction[] = [];\n\t\tfor (let idx in action) {\n\t\t\tif (action.hasOwnProperty(idx)) {\n\t\t\t\tresults[idx] = compileAction(lexer, ruleName, action[idx]);\n\t\t\t}\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\tlet 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 (let idx in cases) {\n\t\t\t\t\tif (cases.hasOwnProperty(idx)) {\n\t\t\t\t\t\tconst _case = cases[idx];\n\t\t\t\t\t\tconst didmatch = (!_case.test || _case.test(id, matches, state, eos));\n\t\t\t\t\t\tif (didmatch) {\n\t\t\t\t\t\t\treturn _case.value;\n\t\t\t\t\t\t}\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\tlet lexer: monarchCommon.ILexer = <monarchCommon.ILexer>{};\n\tlexer.languageId = languageId;\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\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\tlet lexerMin: monarchCommon.ILexerMin = <any>json;\n\tlexerMin.languageId = languageId;\n\tlexerMin.ignoreCase = lexer.ignoreCase;\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 (let idx in rules) {\n\t\t\tif (rules.hasOwnProperty(idx)) {\n\t\t\t\tconst rule = rules[idx];\n\t\t\t\tlet include = rule.include;\n\t\t\t\tif (include) {\n\t\t\t\t\tif (typeof (include) !== 'string') {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\tif (include[0] === '@') {\n\t\t\t\t\t\tinclude = include.substr(1); // peel off starting @\n\t\t\t\t\t}\n\t\t\t\t\tif (!json.tokenizer[include]) {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\taddRules(state + '.' + include, newrules, json.tokenizer[include]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconst newrule = new Rule(state);\n\n\n\t\t\t\t\t// Set up new rule attributes\n\t\t\t\t\tif (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n\t\t\t\t\t\tnewrule.setRegex(lexerMin, rule[0]);\n\t\t\t\t\t\tif (rule.length >= 3) {\n\t\t\t\t\t\t\tif (typeof (rule[1]) === 'string') {\n\t\t\t\t\t\t\t\tnewrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (typeof (rule[1]) === 'object') {\n\t\t\t\t\t\t\t\tconst rule1 = rule[1];\n\t\t\t\t\t\t\t\trule1.next = rule[2];\n\t\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\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\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule[1]);\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\tif (!rule.regex) {\n\t\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\t}\n\t\t\t\t\t\tif (rule.name) {\n\t\t\t\t\t\t\tif (typeof rule.name === 'string') {\n\t\t\t\t\t\t\t\tnewrule.name = rule.name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (rule.matchOnlyAtStart) {\n\t\t\t\t\t\t\tnewrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewrule.setRegex(lexerMin, rule.regex);\n\t\t\t\t\t\tnewrule.setAction(lexerMin, rule.action);\n\t\t\t\t\t}\n\n\t\t\t\t\tnewrules.push(newrule);\n\t\t\t\t}\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\tlet brackets: IMonarchLanguageBracket[] = [];\n\tfor (let bracketIdx in json.brackets) {\n\t\tif (json.brackets.hasOwnProperty(bracketIdx)) {\n\t\t\tlet desc = <any>json.brackets[bracketIdx];\n\t\t\tif (desc && Array.isArray(desc) && desc.length === 3) {\n\t\t\t\tdesc = { token: desc[2], open: desc[0], close: desc[1] };\n\t\t\t}\n\t\t\tif (desc.open === desc.close) {\n\t\t\t\tthrow monarchCommon.createError(lexer, 'open and close brackets in a \\'brackets\\' attribute must be different: ' + desc.open +\n\t\t\t\t\t'\\n hint: use the \\'bracket\\' attribute if matching on equal brackets is required.');\n\t\t\t}\n\t\t\tif (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') {\n\t\t\t\tbrackets.push({\n\t\t\t\t\ttoken: desc.token + lexer.tokenPostfix,\n\t\t\t\t\topen: monarchCommon.fixCase(lexer, desc.open),\n\t\t\t\t\tclose: monarchCommon.fixCase(lexer, desc.close)\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow monarchCommon.createError(lexer, 'every element in the \\'brackets\\' array must be a \\'{open,close,token}\\' object or array');\n\t\t\t}\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\nimport 'vs/css!./actionbar';\nimport * as platform from 'vs/base/common/platform';\nimport * as nls from 'vs/nls';\nimport { Disposable, dispose } from 'vs/base/common/lifecycle';\nimport { IAction, IActionRunner, Action, IActionChangeEvent, ActionRunner, IRunEvent } from 'vs/base/common/actions';\nimport * as DOM from 'vs/base/browser/dom';\nimport * as types from 'vs/base/common/types';\nimport { EventType, Gesture } from 'vs/base/browser/touch';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { asArray } from 'vs/base/common/arrays';\n\nexport interface IActionItem {\n\tactionRunner: IActionRunner;\n\tsetActionContext(context: any): void;\n\trender(element: HTMLElement): void;\n\tisEnabled(): boolean;\n\tfocus(fromRight?: boolean): void;\n\tblur(): void;\n\tdispose(): void;\n}\n\nexport interface IBaseActionItemOptions {\n\tdraggable?: boolean;\n\tisMenu?: boolean;\n}\n\nexport class BaseActionItem extends Disposable implements IActionItem {\n\n\telement?: HTMLElement;\n\t_context: any;\n\t_action: IAction;\n\n\tprivate _actionRunner: IActionRunner;\n\n\tconstructor(context: any, action: IAction, protected options?: IBaseActionItemOptions) {\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\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this._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: any): void {\n\t\tthis._context = newContext;\n\t}\n\n\trender(container: HTMLElement): void {\n\t\tthis.element = container;\n\t\tGesture.addTarget(container);\n\n\t\tconst enableDragging = this.options && this.options.draggable;\n\t\tif (enableDragging) {\n\t\t\tcontainer.draggable = true;\n\t\t}\n\n\t\tthis._register(DOM.addDisposableListener(this.element, EventType.Tap, e => this.onClick(e)));\n\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.MOUSE_DOWN, e => {\n\t\t\tif (!enableDragging) {\n\t\t\t\tDOM.EventHelper.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 && this.element) {\n\t\t\t\tDOM.addClass(this.element, 'active');\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.CLICK, e => {\n\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t// See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard\n\t\t\t// > Writing to the clipboard\n\t\t\t// > You can use the \"cut\" and \"copy\" commands without any special\n\t\t\t// permission if you are using them in a short-lived event handler\n\t\t\t// for a user action (for example, a click handler).\n\n\t\t\t// => to get the Copy and Paste context menu actions working on Firefox,\n\t\t\t// there should be no timeout here\n\t\t\tif (this.options && this.options.isMenu) {\n\t\t\t\tthis.onClick(e);\n\t\t\t} else {\n\t\t\t\tplatform.setImmediate(() => this.onClick(e));\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.DBLCLICK, e => {\n\t\t\tDOM.EventHelper.stop(e, true);\n\t\t}));\n\n\t\t[DOM.EventType.MOUSE_UP, DOM.EventType.MOUSE_OUT].forEach(event => {\n\t\t\tthis._register(DOM.addDisposableListener(this.element!, event, e => {\n\t\t\t\tDOM.EventHelper.stop(e);\n\t\t\t\tDOM.removeClass(this.element!, 'active');\n\t\t\t}));\n\t\t});\n\t}\n\n\tonClick(event: DOM.EventLike): void {\n\t\tDOM.EventHelper.stop(event, true);\n\n\t\tlet context: any;\n\t\tif (types.isUndefinedOrNull(this._context)) {\n\t\t\tcontext = event;\n\t\t} else {\n\t\t\tcontext = this._context;\n\n\t\t\tif (types.isObject(context)) {\n\t\t\t\tcontext.event = event;\n\t\t\t}\n\t\t}\n\n\t\tthis._actionRunner.run(this._action, context);\n\t}\n\n\tfocus(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.focus();\n\t\t\tDOM.addClass(this.element, 'focused');\n\t\t}\n\t}\n\n\tblur(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.blur();\n\t\t\tDOM.removeClass(this.element, 'focused');\n\t\t}\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\tdispose(): void {\n\t\tif (this.element) {\n\t\t\tDOM.removeNode(this.element);\n\t\t\tthis.element = undefined;\n\t\t}\n\n\t\tsuper.dispose();\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\t\tthis.checked = false;\n\t\tthis.radio = false;\n\t\tthis.enabled = false;\n\t}\n}\n\nexport interface IActionItemOptions extends IBaseActionItemOptions {\n\ticon?: boolean;\n\tlabel?: boolean;\n\tkeybinding?: string | null;\n}\n\nexport class ActionItem extends BaseActionItem {\n\n\tprotected label: HTMLElement;\n\tprotected options: IActionItemOptions;\n\n\tprivate cssClass?: string;\n\n\tconstructor(context: any, action: IAction, options: IActionItemOptions = {}) {\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\trender(container: HTMLElement): void {\n\t\tsuper.render(container);\n\n\t\tif (this.element) {\n\t\t\tthis.label = DOM.append(this.element, DOM.$('a.action-label'));\n\t\t}\n\t\tif (this._action.id === Separator.ID) {\n\t\t\tthis.label.setAttribute('role', 'presentation'); // A separator is a presentation item\n\t\t} else {\n\t\t\tif (this.options.isMenu) {\n\t\t\t\tthis.label.setAttribute('role', 'menuitem');\n\t\t\t} else {\n\t\t\t\tthis.label.setAttribute('role', 'button');\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.label && this.options.keybinding && this.element) {\n\t\t\tDOM.append(this.element, DOM.$('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\tfocus(): void {\n\t\tsuper.focus();\n\n\t\tthis.label.focus();\n\t}\n\n\tupdateLabel(): void {\n\t\tif (this.options.label) {\n\t\t\tthis.label.textContent = this.getAction().label;\n\t\t}\n\t}\n\n\tupdateTooltip(): 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) {\n\t\t\tthis.label.title = title;\n\t\t}\n\t}\n\n\tupdateClass(): void {\n\t\tif (this.cssClass) {\n\t\t\tDOM.removeClasses(this.label, this.cssClass);\n\t\t}\n\n\t\tif (this.options.icon) {\n\t\t\tthis.cssClass = this.getAction().class;\n\t\t\tDOM.addClass(this.label, 'icon');\n\t\t\tif (this.cssClass) {\n\t\t\t\tDOM.addClasses(this.label, this.cssClass);\n\t\t\t}\n\n\t\t\tthis.updateEnabled();\n\t\t} else {\n\t\t\tDOM.removeClass(this.label, 'icon');\n\t\t}\n\t}\n\n\tupdateEnabled(): void {\n\t\tif (this.getAction().enabled) {\n\t\t\tthis.label.removeAttribute('aria-disabled');\n\t\t\tif (this.element) {\n\t\t\t\tDOM.removeClass(this.element, 'disabled');\n\t\t\t}\n\t\t\tDOM.removeClass(this.label, 'disabled');\n\t\t\tthis.label.tabIndex = 0;\n\t\t} else {\n\t\t\tthis.label.setAttribute('aria-disabled', 'true');\n\t\t\tif (this.element) {\n\t\t\t\tDOM.addClass(this.element, 'disabled');\n\t\t\t}\n\t\t\tDOM.addClass(this.label, 'disabled');\n\t\t\tDOM.removeTabIndexAndUpdateFocus(this.label);\n\t\t}\n\t}\n\n\tupdateChecked(): void {\n\t\tif (this.getAction().checked) {\n\t\t\tDOM.addClass(this.label, 'checked');\n\t\t} else {\n\t\t\tDOM.removeClass(this.label, 'checked');\n\t\t}\n\t}\n}\n\nexport const enum ActionsOrientation {\n\tHORIZONTAL,\n\tHORIZONTAL_REVERSE,\n\tVERTICAL,\n\tVERTICAL_REVERSE,\n}\n\nexport interface ActionTrigger {\n\tkeys: KeyCode[];\n\tkeyDown: boolean;\n}\n\nexport interface IActionItemProvider {\n\t(action: IAction): IActionItem | undefined;\n}\n\nexport interface IActionBarOptions {\n\torientation?: ActionsOrientation;\n\tcontext?: any;\n\tactionItemProvider?: IActionItemProvider;\n\tactionRunner?: IActionRunner;\n\tariaLabel?: string;\n\tanimated?: boolean;\n\ttriggerKeys?: ActionTrigger;\n}\n\nconst defaultOptions: IActionBarOptions = {\n\torientation: ActionsOrientation.HORIZONTAL,\n\tcontext: null,\n\ttriggerKeys: {\n\t\tkeys: [KeyCode.Enter, KeyCode.Space],\n\t\tkeyDown: false\n\t}\n};\n\nexport interface IActionOptions extends IActionItemOptions {\n\tindex?: number;\n}\n\nexport class ActionBar extends Disposable implements IActionRunner {\n\n\toptions: IActionBarOptions;\n\n\tprivate _actionRunner: IActionRunner;\n\tprivate _context: any;\n\n\t// Items\n\titems: IActionItem[];\n\tprotected focusedItem?: number;\n\tprivate focusTracker: DOM.IFocusTracker;\n\n\t// Elements\n\tdomNode: HTMLElement;\n\tprotected actionsList: HTMLElement;\n\n\tprivate _onDidBlur = this._register(new Emitter<void>());\n\tget onDidBlur(): Event<void> { return this._onDidBlur.event; }\n\n\tprivate _onDidCancel = this._register(new Emitter<void>());\n\tget onDidCancel(): Event<void> { return this._onDidCancel.event; }\n\n\tprivate _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun(): Event<IRunEvent> { return this._onDidRun.event; }\n\n\tprivate _onDidBeforeRun = this._register(new Emitter<IRunEvent>());\n\tget onDidBeforeRun(): Event<IRunEvent> { return this._onDidBeforeRun.event; }\n\n\tconstructor(container: HTMLElement, options: IActionBarOptions = defaultOptions) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis._context = options.context;\n\n\t\tif (!this.options.triggerKeys) {\n\t\t\tthis.options.triggerKeys = defaultOptions.triggerKeys;\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.onDidBeforeRun(e => this._onDidBeforeRun.fire(e)));\n\n\t\tthis.items = [];\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\tDOM.addClass(this.domNode, 'animated');\n\t\t}\n\n\t\tlet previousKey: KeyCode;\n\t\tlet nextKey: KeyCode;\n\n\t\tswitch (this.options.orientation) {\n\t\t\tcase ActionsOrientation.HORIZONTAL:\n\t\t\t\tpreviousKey = KeyCode.LeftArrow;\n\t\t\t\tnextKey = KeyCode.RightArrow;\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.HORIZONTAL_REVERSE:\n\t\t\t\tpreviousKey = KeyCode.RightArrow;\n\t\t\t\tnextKey = KeyCode.LeftArrow;\n\t\t\t\tthis.domNode.className += ' reverse';\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL:\n\t\t\t\tpreviousKey = KeyCode.UpArrow;\n\t\t\t\tnextKey = KeyCode.DownArrow;\n\t\t\t\tthis.domNode.className += ' vertical';\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL_REVERSE:\n\t\t\t\tpreviousKey = KeyCode.DownArrow;\n\t\t\t\tnextKey = KeyCode.UpArrow;\n\t\t\t\tthis.domNode.className += ' vertical reverse';\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\n\t\t\tif (event.equals(previousKey)) {\n\t\t\t\tthis.focusPrevious();\n\t\t\t} else if (event.equals(nextKey)) {\n\t\t\t\tthis.focusNext();\n\t\t\t} else if (event.equals(KeyCode.Escape)) {\n\t\t\t\tthis.cancel();\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.options.triggerKeys && this.options.triggerKeys.keyDown) {\n\t\t\t\t\tthis.doTrigger(event);\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.options.triggerKeys && !this.options.triggerKeys.keyDown) {\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 (document.activeElement === this.domNode || !DOM.isAncestor(document.activeElement, this.domNode)) {\n\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\tthis.focusedItem = undefined;\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 isTriggerKeyEvent(event: StandardKeyboardEvent): boolean {\n\t\tlet ret = false;\n\t\tif (this.options.triggerKeys) {\n\t\t\tthis.options.triggerKeys.keys.forEach(keyCode => {\n\t\t\t\tret = ret || event.equals(keyCode);\n\t\t\t});\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(document.activeElement, 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(): any {\n\t\treturn this._context;\n\t}\n\n\tset context(context: any) {\n\t\tthis._context = context;\n\t\tthis.items.forEach(i => i.setActionContext(context));\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tpush(arg: IAction | IAction[], options: IActionOptions = {}): void {\n\t\tconst actions: IAction[] = asArray(arg);\n\n\t\tlet index = types.isNumber(options.index) ? options.index : null;\n\n\t\tactions.forEach((action: IAction) => {\n\t\t\tconst actionItemElement = document.createElement('li');\n\t\t\tactionItemElement.className = 'action-item';\n\t\t\tactionItemElement.setAttribute('role', 'presentation');\n\n\t\t\t// Prevent native context menu on actions\n\t\t\tthis._register(DOM.addDisposableListener(actionItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t}));\n\n\t\t\tlet item: IActionItem | undefined;\n\n\t\t\tif (this.options.actionItemProvider) {\n\t\t\t\titem = this.options.actionItemProvider(action);\n\t\t\t}\n\n\t\t\tif (!item) {\n\t\t\t\titem = new ActionItem(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(actionItemElement);\n\n\t\t\tif (index === null || index < 0 || index >= this.actionsList.children.length) {\n\t\t\t\tthis.actionsList.appendChild(actionItemElement);\n\t\t\t\tthis.items.push(item);\n\t\t\t} else {\n\t\t\t\tthis.actionsList.insertBefore(actionItemElement, this.actionsList.children[index]);\n\t\t\t\tthis.items.splice(index, 0, item);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\t}\n\n\tclear(): void {\n\t\tthis.items = dispose(this.items);\n\t\tDOM.clearNode(this.actionsList);\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.items.length === 0;\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\t// Focus the first enabled item\n\t\t\tthis.focusedItem = this.items.length - 1;\n\t\t\tthis.focusNext();\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();\n\t\t}\n\t}\n\n\tprotected focusNext(): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = this.items.length - 1;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = (this.focusedItem + 1) % this.items.length;\n\t\t\titem = this.items[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && !item.isEnabled());\n\n\t\tif (this.focusedItem === startIndex && !item.isEnabled()) {\n\t\t\tthis.focusedItem = undefined;\n\t\t}\n\n\t\tthis.updateFocus();\n\t}\n\n\tprotected focusPrevious(): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = 0;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = this.focusedItem - 1;\n\n\t\t\tif (this.focusedItem < 0) {\n\t\t\t\tthis.focusedItem = this.items.length - 1;\n\t\t\t}\n\n\t\t\titem = this.items[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && !item.isEnabled());\n\n\t\tif (this.focusedItem === startIndex && !item.isEnabled()) {\n\t\t\tthis.focusedItem = undefined;\n\t\t}\n\n\t\tthis.updateFocus(true);\n\t}\n\n\tprotected updateFocus(fromRight?: boolean): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.actionsList.focus();\n\t\t}\n\n\t\tfor (let i = 0; i < this.items.length; i++) {\n\t\t\tconst item = this.items[i];\n\t\t\tconst actionItem = item;\n\n\t\t\tif (i === this.focusedItem) {\n\t\t\t\tif (types.isFunction(actionItem.isEnabled)) {\n\t\t\t\t\tif (actionItem.isEnabled() && types.isFunction(actionItem.focus)) {\n\t\t\t\t\t\tactionItem.focus(fromRight);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.actionsList.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (types.isFunction(actionItem.blur)) {\n\t\t\t\t\tactionItem.blur();\n\t\t\t\t}\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 actionItem = this.items[this.focusedItem];\n\t\tif (actionItem instanceof BaseActionItem) {\n\t\t\tconst context = (actionItem._context === null || actionItem._context === undefined) ? event : actionItem._context;\n\t\t\tthis.run(actionItem._action, context);\n\t\t}\n\t}\n\n\tprivate cancel(): void {\n\t\tif (document.activeElement instanceof HTMLElement) {\n\t\t\t(<HTMLElement>document.activeElement).blur(); // remove focus from focused action\n\t\t}\n\n\t\tthis._onDidCancel.fire();\n\t}\n\n\trun(action: IAction, context?: any): Promise<void> {\n\t\treturn this._actionRunner.run(action, context);\n\t}\n\n\tdispose(): void {\n\t\tdispose(this.items);\n\t\tthis.items = [];\n\n\t\tDOM.removeNode(this.getContainer());\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 'vs/css!./aria';\nimport * as nls from 'vs/nls';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport * as dom from 'vs/base/browser/dom';\n\nlet ariaContainer: HTMLElement;\nlet alertContainer: HTMLElement;\nlet statusContainer: HTMLElement;\nexport function setARIAContainer(parent: HTMLElement) {\n\tariaContainer = document.createElement('div');\n\tariaContainer.className = 'monaco-aria-container';\n\n\talertContainer = document.createElement('div');\n\talertContainer.className = 'monaco-alert';\n\talertContainer.setAttribute('role', 'alert');\n\talertContainer.setAttribute('aria-atomic', 'true');\n\tariaContainer.appendChild(alertContainer);\n\n\tstatusContainer = document.createElement('div');\n\tstatusContainer.className = 'monaco-status';\n\tstatusContainer.setAttribute('role', 'status');\n\tstatusContainer.setAttribute('aria-atomic', 'true');\n\tariaContainer.appendChild(statusContainer);\n\n\tparent.appendChild(ariaContainer);\n}\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, disableRepeat?: boolean): void {\n\tinsertMessage(alertContainer, msg, disableRepeat);\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, disableRepeat?: boolean): void {\n\tif (isMacintosh) {\n\t\talert(msg, disableRepeat); // VoiceOver does not seem to support status role\n\t} else {\n\t\tinsertMessage(statusContainer, msg, disableRepeat);\n\t}\n}\n\nlet repeatedTimes = 0;\nlet prevText: string | undefined = undefined;\nfunction insertMessage(target: HTMLElement, msg: string, disableRepeat?: boolean): void {\n\tif (!ariaContainer) {\n\t\treturn;\n\t}\n\n\t// If the same message should be inserted that is already present, a screen reader would\n\t// not announce this message because it matches the previous one. As a workaround, we\n\t// alter the message with the number of occurences unless this is explicitly disabled\n\t// via the disableRepeat flag.\n\tif (!disableRepeat) {\n\t\tif (prevText === msg) {\n\t\t\trepeatedTimes++;\n\t\t} else {\n\t\t\tprevText = msg;\n\t\t\trepeatedTimes = 0;\n\t\t}\n\n\t\tswitch (repeatedTimes) {\n\t\t\tcase 0: break;\n\t\t\tcase 1: msg = nls.localize('repeated', \"{0} (occurred again)\", msg); break;\n\t\t\tdefault: msg = nls.localize('repeatedNtimes', \"{0} (occurred {1} times)\", msg, repeatedTimes); break;\n\t\t}\n\t}\n\n\tdom.clearNode(target);\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 * Copyright (c) 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 { Color } from 'vs/base/common/color';\nimport 'vs/css!./findInputCheckboxes';\nimport * as nls from 'vs/nls';\n\nexport interface IFindInputCheckboxOpts {\n\treadonly appendTitle: string;\n\treadonly isChecked: boolean;\n\treadonly inputActiveOptionBorder?: 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\tactionClassName: 'monaco-case-sensitive',\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});\n\t}\n}\n\nexport class WholeWordsCheckbox extends Checkbox {\n\tconstructor(opts: IFindInputCheckboxOpts) {\n\t\tsuper({\n\t\t\tactionClassName: 'monaco-whole-word',\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});\n\t}\n}\n\nexport class RegexCheckbox extends Checkbox {\n\tconstructor(opts: IFindInputCheckboxOpts) {\n\t\tsuper({\n\t\t\tactionClassName: 'monaco-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});\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./inputBox';\n\nimport * as nls from 'vs/nls';\nimport * as Bal from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { RenderOptions, renderFormattedText, renderText } from 'vs/base/browser/htmlContentRenderer';\nimport * as aria from 'vs/base/browser/ui/aria/aria';\nimport { IAction } from 'vs/base/common/actions';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { IContextViewProvider, AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\nimport { HistoryNavigator } from 'vs/base/common/history';\nimport { IHistoryNavigationWidget } from 'vs/base/browser/history';\n\nconst $ = dom.$;\n\nexport interface IInputOptions extends IInputBoxStyles {\n\treadonly placeholder?: string;\n\treadonly ariaLabel?: string;\n\treadonly type?: string;\n\treadonly validationOptions?: IInputValidationOptions;\n\treadonly flexibleHeight?: boolean;\n\treadonly actions?: 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\tprivate input: HTMLInputElement;\n\tprivate mirror: HTMLElement;\n\tprivate actionbar?: ActionBar;\n\tprivate options: IInputOptions;\n\tprivate message: IMessage | null;\n\tprivate placeholder: string;\n\tprivate ariaLabel: string;\n\tprivate validation?: IInputValidator;\n\tprivate state: string | null = 'idle';\n\tprivate cachedHeight: number | null;\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\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.cachedHeight = null;\n\t\tthis.placeholder = this.options.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, $('.wrapper'));\n\t\tthis.input = <HTMLInputElement>dom.append(wrapper, $(tagName + '.input'));\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, () => dom.addClass(this.element, 'synthetic-focus'));\n\t\tthis.onblur(this.input, () => dom.removeClass(this.element, 'synthetic-focus'));\n\n\t\tif (this.options.flexibleHeight) {\n\t\t\tthis.mirror = dom.append(wrapper, $('div.mirror'));\n\t\t\tthis.mirror.innerHTML = ' ';\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) {\n\t\t\tthis.setPlaceHolder(this.placeholder);\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\t// Add placeholder shim for IE because IE decides to hide the placeholder on focus (we dont want that!)\n\t\tif (this.placeholder && Bal.isIE) {\n\t\t\tthis.onclick(this.input, (e) => {\n\t\t\t\tdom.EventHelper.stop(e, true);\n\t\t\t\tthis.input.focus();\n\t\t\t});\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tif (!this.input) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.updateMirror();\n\t\t}, 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}\n\n\tprivate onFocus(): void {\n\t\tthis._showMessage();\n\t}\n\n\tpublic setPlaceHolder(placeHolder: string): void {\n\t\tif (this.input) {\n\t\t\tthis.input.setAttribute('placeholder', placeHolder);\n\t\t\tthis.input.title = placeHolder;\n\t\t}\n\t}\n\n\tpublic setAriaLabel(label: string): void {\n\t\tthis.ariaLabel = label;\n\n\t\tif (this.input) {\n\t\t\tif (label) {\n\t\t\t\tthis.input.setAttribute('aria-label', this.ariaLabel);\n\t\t\t} else {\n\t\t\t\tthis.input.removeAttribute('aria-label');\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get mirrorElement(): HTMLElement {\n\t\treturn this.mirror;\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 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}\n\t}\n\n\tpublic enable(): void {\n\t\tthis.input.removeAttribute('disabled');\n\t}\n\n\tpublic disable(): void {\n\t\tthis.input.disabled = true;\n\t\tthis._hideMessage();\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 get width(): number {\n\t\treturn dom.getTotalWidth(this.input);\n\t}\n\n\tpublic set width(width: number) {\n\t\tthis.input.style.width = width + 'px';\n\t\tif (this.mirror) {\n\t\t\tthis.mirror.style.width = width + 'px';\n\t\t}\n\t}\n\n\tpublic showMessage(message: IMessage, force?: boolean): void {\n\t\tthis.message = message;\n\n\t\tdom.removeClass(this.element, 'idle');\n\t\tdom.removeClass(this.element, 'info');\n\t\tdom.removeClass(this.element, 'warning');\n\t\tdom.removeClass(this.element, 'error');\n\t\tdom.addClass(this.element, 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}` : null;\n\n\t\t// ARIA Support\n\t\tlet alertText: string;\n\t\tif (message.type === MessageType.ERROR) {\n\t\t\talertText = nls.localize('alertErrorMessage', \"Error: {0}\", message.content);\n\t\t} else if (message.type === MessageType.WARNING) {\n\t\t\talertText = nls.localize('alertWarningMessage', \"Warning: {0}\", message.content);\n\t\t} else {\n\t\t\talertText = nls.localize('alertInfoMessage', \"Info: {0}\", message.content);\n\t\t}\n\n\t\taria.alert(alertText);\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\tdom.removeClass(this.element, 'info');\n\t\tdom.removeClass(this.element, 'warning');\n\t\tdom.removeClass(this.element, 'error');\n\t\tdom.addClass(this.element, 'idle');\n\n\t\tthis._hideMessage();\n\t\tthis.applyStyles();\n\t}\n\n\tpublic validate(): boolean {\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;\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.state = 'open';\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: RenderOptions = {\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\tdom.addClass(spanElement, 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() : null;\n\t\t\t\tspanElement.style.color = styles.foreground ? styles.foreground.toString() : null;\n\t\t\t\tspanElement.style.border = styles.border ? `1px solid ${styles.border}` : null;\n\n\t\t\t\tdom.append(div, spanElement);\n\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\tlayout: layout\n\t\t});\n\t}\n\n\tprivate _hideMessage(): void {\n\t\tif (!this.contextViewProvider || this.state !== 'open') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.state = 'idle';\n\n\t\tthis.contextViewProvider.hideContextView();\n\t}\n\n\tprivate onValueChange(): void {\n\t\tthis._onDidChange.fire(this.value);\n\n\t\tthis.validate();\n\t\tthis.updateMirror();\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 || this.placeholder;\n\t\tconst lastCharCode = value.charCodeAt(value.length - 1);\n\t\tconst suffix = lastCharCode === 10 ? ' ' : '';\n\t\tconst mirrorTextContent = value + suffix;\n\n\t\tif (mirrorTextContent) {\n\t\t\tthis.mirror.textContent = value + suffix;\n\t\t} else {\n\t\t\tthis.mirror.innerHTML = ' ';\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\tif (this.element) {\n\t\t\tconst background = this.inputBackground ? this.inputBackground.toString() : null;\n\t\t\tconst foreground = this.inputForeground ? this.inputForeground.toString() : null;\n\t\t\tconst border = this.inputBorder ? this.inputBorder.toString() : null;\n\n\t\t\tthis.element.style.backgroundColor = background;\n\t\t\tthis.element.style.color = foreground;\n\t\t\tthis.input.style.backgroundColor = background;\n\t\t\tthis.input.style.color = foreground;\n\n\t\t\tthis.element.style.borderWidth = border ? '1px' : null;\n\t\t\tthis.element.style.borderStyle = border ? 'solid' : null;\n\t\t\tthis.element.style.borderColor = border;\n\t\t}\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.cachedHeight;\n\t\tthis.cachedHeight = dom.getTotalHeight(this.mirror);\n\n\t\tif (previousHeight !== this.cachedHeight) {\n\t\t\tthis.input.style.height = this.cachedHeight + 'px';\n\t\t\tthis._onDidHeightChange.fire(this.cachedHeight);\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._hideMessage();\n\n\t\tthis.element = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.input = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.contextViewProvider = undefined;\n\t\tthis.message = null;\n\t\tthis.validation = undefined;\n\t\tthis.state = null;\n\t\tthis.actionbar = undefined;\n\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IHistoryInputOptions extends IInputOptions {\n\thistory: string[];\n}\n\nexport class HistoryInputBox extends InputBox implements IHistoryNavigationWidget {\n\n\tprivate readonly history: HistoryNavigator<string>;\n\n\tconstructor(container: HTMLElement, contextViewProvider: IContextViewProvider | undefined, options: IHistoryInputOptions) {\n\t\tsuper(container, contextViewProvider, options);\n\t\tthis.history = new HistoryNavigator<string>(options.history, 100);\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 'vs/css!./findInput';\n\nimport * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { IInputValidator, IInputBoxStyles, HistoryInputBox } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { Widget } from 'vs/base/browser/ui/widget';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { CaseSensitiveCheckbox, WholeWordsCheckbox, RegexCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes';\nimport { Color } from 'vs/base/common/color';\nimport { ICheckboxStyles } from 'vs/base/browser/ui/checkbox/checkbox';\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\n\treadonly appendCaseSensitiveLabel?: string;\n\treadonly appendWholeWordsLabel?: string;\n\treadonly appendRegexLabel?: string;\n\treadonly history?: string[];\n}\n\nexport interface IFindInputStyles extends IInputBoxStyles {\n\tinputActiveOptionBorder?: 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\n\tprivate inputActiveOptionBorder?: 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 regex: RegexCheckbox;\n\tprivate wholeWords: WholeWordsCheckbox;\n\tprivate 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\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.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\tthis.buildDomNode(options.appendCaseSensitiveLabel || '', options.appendWholeWordsLabel || '', options.appendRegexLabel || '', options.history || [], !!options.flexibleHeight);\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\tdom.removeClass(this.domNode, '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\tdom.addClass(this.domNode, '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.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};\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\tdom.removeClass(this.domNode, 'highlight-' + (this._lastHighlightFindOptions));\n\t\tthis._lastHighlightFindOptions = 1 - this._lastHighlightFindOptions;\n\t\tdom.addClass(this.domNode, 'highlight-' + (this._lastHighlightFindOptions));\n\t}\n\n\tprivate buildDomNode(appendCaseSensitiveLabel: string, appendWholeWordsLabel: string, appendRegexLabel: string, history: string[], flexibleHeight: boolean): void {\n\t\tthis.domNode = document.createElement('div');\n\t\tdom.addClass(this.domNode, '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\tflexibleHeight\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}));\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}));\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}));\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\tconst paddingRight = (this.caseSensitive.width() + this.wholeWords.width() + this.regex.width()) + 'px';\n\t\t\tthis.inputBox.inputElement.style.paddingRight = paddingRight;\n\t\t\tif (this.inputBox.mirrorElement) {\n\t\t\t\tthis.inputBox.mirrorElement.style.paddingRight = paddingRight;\n\t\t\t}\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} 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.caseSensitive.domNode);\n\t\tcontrols.appendChild(this.wholeWords.domNode);\n\t\tcontrols.appendChild(this.regex.domNode);\n\n\t\tthis.domNode.appendChild(controls);\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 clearMessage(): void {\n\t\tif (this.inputBox) {\n\t\t\tthis.inputBox.hideMessage();\n\t\t}\n\t}\n\n\tpublic 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 'vs/css!./list';\nimport { localize } from 'vs/nls';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { isNumber } from 'vs/base/common/types';\nimport { range, firstIndex, binarySearch } from 'vs/base/common/arrays';\nimport { memoize } from 'vs/base/common/decorators';\nimport * as DOM from 'vs/base/browser/dom';\nimport * as platform from 'vs/base/common/platform';\nimport { Gesture } from 'vs/base/browser/touch';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { Event, Emitter, EventBufferer } from 'vs/base/common/event';\nimport { domEvent } from 'vs/base/browser/event';\nimport { IListVirtualDelegate, IListRenderer, IListEvent, IListContextMenuEvent, IListMouseEvent, IListTouchEvent, IListGestureEvent, IIdentityProvider, IKeyboardNavigationLabelProvider, IListDragAndDrop, IListDragOverReaction, ListAriaRootRole } from './list';\nimport { ListView, IListViewOptions, IListViewDragAndDrop, IAriaSetProvider } from './listView';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { CombinedSpliceable } from 'vs/base/browser/ui/list/splice';\nimport { clamp } from 'vs/base/common/numbers';\nimport { matchesPrefix } from 'vs/base/common/filters';\nimport { IDragAndDropData } from 'vs/base/browser/dnd';\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.trait}`;\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 = firstIndex(this.renderedElements, 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 = firstIndex(this.renderedElements, 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 indexes: number[] = [];\n\tprivate sortedIndexes: number[] = [];\n\n\tprivate _onChange = new Emitter<ITraitChangeEvent>();\n\tget onChange(): Event<ITraitChangeEvent> { return this._onChange.event; }\n\n\tget trait(): 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\tconst diff = elements.length - deleteCount;\n\t\tconst end = start + deleteCount;\n\t\tconst indexes = [\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\tthis.renderer.splice(start, deleteCount, elements.length);\n\t\tthis._set(indexes, indexes);\n\t}\n\n\trenderIndex(index: number, container: HTMLElement): void {\n\t\tDOM.toggleClass(container, this._trait, this.contains(index));\n\t}\n\n\tunrender(container: HTMLElement): void {\n\t\tDOM.removeClass(container, 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\tthis._onChange = dispose(this._onChange);\n\t}\n}\n\nclass FocusTrait<T> extends Trait<T> {\n\n\tconstructor() {\n\t\tsuper('focused');\n\t}\n\n\trenderIndex(index: number, container: HTMLElement): void {\n\t\tsuper.renderIndex(index, container);\n\n\t\tif (this.contains(index)) {\n\t\t\tcontainer.setAttribute('aria-selected', 'true');\n\t\t} else {\n\t\t\tcontainer.removeAttribute('aria-selected');\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\nfunction isInputElement(e: HTMLElement): boolean {\n\treturn e.tagName === 'INPUT' || e.tagName === 'TEXTAREA';\n}\n\nclass KeyboardController<T> implements IDisposable {\n\n\tprivate disposables: IDisposable[];\n\tprivate openController: IOpenController;\n\n\tconstructor(\n\t\tprivate list: List<T>,\n\t\tprivate view: ListView<T>,\n\t\toptions: IListOptions<T>\n\t) {\n\t\tconst multipleSelectionSupport = !(options.multipleSelectionSupport === false);\n\t\tthis.disposables = [];\n\n\t\tthis.openController = options.openController || DefaultOpenController;\n\n\t\tconst onKeyDown = Event.chain(domEvent(view.domNode, 'keydown'))\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.Enter).on(this.onEnter, this, this.disposables);\n\t\tonKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this, this.disposables);\n\t\tonKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this, this.disposables);\n\t\tonKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUpArrow, this, this.disposables);\n\t\tonKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDownArrow, this, this.disposables);\n\t\tonKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(this.onEscape, this, this.disposables);\n\n\t\tif (multipleSelectionSupport) {\n\t\t\tonKeyDown.filter(e => (platform.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KEY_A).on(this.onCtrlA, this, this.disposables);\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\n\t\tif (this.openController.shouldOpen(e.browserEvent)) {\n\t\t\tthis.list.open(this.list.getFocus(), e.browserEvent);\n\t\t}\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\tthis.list.reveal(this.list.getFocus()[0]);\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\tthis.list.reveal(this.list.getFocus()[0]);\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\tthis.list.reveal(this.list.getFocus()[0]);\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\tthis.list.reveal(this.list.getFocus()[0]);\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.view.domNode.focus();\n\t}\n\n\tprivate onEscape(e: StandardKeyboardEvent): void {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis.list.setSelection([], e.browserEvent);\n\t\tthis.view.domNode.focus();\n\t}\n\n\tdispose() {\n\t\tthis.disposables = dispose(this.disposables);\n\t}\n}\n\nenum TypeLabelControllerState {\n\tIdle,\n\tTyping\n}\n\nexport function mightProducePrintableCharacter(event: IKeyboardEvent): boolean {\n\tif (event.ctrlKey || event.metaKey || event.altKey) {\n\t\treturn false;\n\t}\n\n\treturn (event.keyCode >= KeyCode.KEY_A && event.keyCode <= KeyCode.KEY_Z)\n\t\t|| (event.keyCode >= KeyCode.KEY_0 && event.keyCode <= KeyCode.KEY_9)\n\t\t|| (event.keyCode >= KeyCode.US_SEMICOLON && event.keyCode <= KeyCode.US_QUOTE);\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\n\tprivate enabledDisposables: IDisposable[] = [];\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\tprivate list: List<T>,\n\t\tprivate view: ListView<T>,\n\t\tprivate keyboardNavigationLabelProvider: IKeyboardNavigationLabelProvider<T>\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(domEvent(this.view.domNode, 'keydown'))\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(this.keyboardNavigationLabelProvider.mightProducePrintableCharacter ? e => this.keyboardNavigationLabelProvider.mightProducePrintableCharacter!(e) : e => mightProducePrintableCharacter(e))\n\t\t\t.forEach(e => { e.stopPropagation(); 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\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 = dispose(this.enabledDisposables);\n\t\tthis.enabled = false;\n\t\tthis.triggered = false;\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.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.disposables = dispose(this.disposables);\n\t}\n}\n\nclass DOMFocusController<T> implements IDisposable {\n\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\tprivate list: List<T>,\n\t\tprivate view: ListView<T>\n\t) {\n\t\tthis.disposables = [];\n\n\t\tconst onKeyDown = Event.chain(domEvent(view.domNode, 'keydown'))\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(this.disposables);\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\nconst DefaultOpenController: IOpenController = {\n\tshouldOpen: (event: UIEvent) => {\n\t\tif (event instanceof MouseEvent) {\n\t\t\treturn !isMouseRightClick(event);\n\t\t}\n\n\t\treturn true;\n\t}\n};\n\nexport class MouseController<T> implements IDisposable {\n\n\tprivate multipleSelectionSupport: boolean;\n\treadonly multipleSelectionController: IMultipleSelectionController<T>;\n\tprivate openController: IOpenController;\n\tprivate mouseSupport: boolean;\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(protected list: List<T>) {\n\t\tthis.multipleSelectionSupport = !(list.options.multipleSelectionSupport === false);\n\n\t\tif (this.multipleSelectionSupport) {\n\t\t\tthis.multipleSelectionController = list.options.multipleSelectionController || DefaultMultipleSelectionController;\n\t\t}\n\n\t\tthis.openController = list.options.openController || DefaultOpenController;\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\tGesture.addTarget(list.getHTMLElement());\n\t\t}\n\n\t\tlist.onMouseClick(this.onPointer, this, this.disposables);\n\t\tlist.onMouseMiddleClick(this.onPointer, this, this.disposables);\n\t\tlist.onTap(this.onPointer, this, this.disposables);\n\t}\n\n\tprotected isSelectionSingleChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\t\tif (this.multipleSelectionController) {\n\t\t\treturn this.multipleSelectionController.isSelectionSingleChangeEvent(event);\n\t\t}\n\n\t\treturn platform.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey;\n\t}\n\n\tprotected isSelectionRangeChangeEvent(event: IListMouseEvent<any> | IListTouchEvent<any>): boolean {\n\t\tif (this.multipleSelectionController) {\n\t\t\treturn this.multipleSelectionController.isSelectionRangeChangeEvent(event);\n\t\t}\n\n\t\treturn event.browserEvent.shiftKey;\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 (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\tconst focus = typeof e.index === 'undefined' ? [] : [e.index];\n\t\tthis.list.setFocus(focus, e.browserEvent);\n\t}\n\n\tprotected onPointer(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)) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet reference = this.list.getFocus()[0];\n\t\tconst selection = this.list.getSelection();\n\t\treference = reference === undefined ? selection[0] : reference;\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\treturn;\n\t\t}\n\n\t\tif (this.multipleSelectionSupport && this.isSelectionRangeChangeEvent(e)) {\n\t\t\treturn this.changeSelection(e, reference);\n\t\t}\n\n\t\tif (this.multipleSelectionSupport && this.isSelectionChangeEvent(e)) {\n\t\t\treturn this.changeSelection(e, reference);\n\t\t}\n\n\t\tthis.list.setFocus([focus], e.browserEvent);\n\n\t\tif (!isMouseRightClick(e.browserEvent)) {\n\t\t\tthis.list.setSelection([focus], e.browserEvent);\n\n\t\t\tif (this.openController.shouldOpen(e.browserEvent)) {\n\t\t\t\tthis.list.open([focus], e.browserEvent);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onDoubleClick(e: IListMouseEvent<T>): void {\n\t\tif (isInputElement(e.browserEvent.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.multipleSelectionSupport && 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\tthis.list.pin(focus);\n\t}\n\n\tprivate changeSelection(e: IListMouseEvent<T> | IListTouchEvent<T>, reference: number | undefined): void {\n\t\tconst focus = e.index!;\n\n\t\tif (this.isSelectionRangeChangeEvent(e) && reference !== undefined) {\n\t\t\tconst min = Math.min(reference, focus);\n\t\t\tconst max = Math.max(reference, 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, [reference]), reference);\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\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\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(this.disposables);\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 IOpenController {\n\tshouldOpen(event: UIEvent): boolean;\n}\n\nexport interface IStyleController {\n\tstyle(styles: IListStyles): void;\n}\n\nexport interface IAccessibilityProvider<T> {\n\n\t/**\n\t * Given an element in the tree, return the ARIA label that should be associated with the\n\t * item. This helps screen readers to provide a meaningful label for the currently focused\n\t * tree element.\n\t *\n\t * Returning null will not disable ARIA for the element. Instead it is up to the screen reader\n\t * to compute a meaningful label based on the contents of the element in the DOM\n\t *\n\t * See also: https://www.w3.org/TR/wai-aria/#aria-label\n\t */\n\tgetAriaLabel(element: T): string | null;\n\n\t/**\n\t * https://www.w3.org/TR/wai-aria/#aria-level\n\t */\n\tgetAriaLevel?(element: T): number | 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.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.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.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`);\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-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\tconst newStyles = content.join('\\n');\n\t\tif (newStyles !== this.styleElement.innerHTML) {\n\t\t\tthis.styleElement.innerHTML = newStyles;\n\t\t}\n\t}\n}\n\nexport interface IListOptions<T> extends IListStyles {\n\treadonly identityProvider?: IIdentityProvider<T>;\n\treadonly dnd?: IListDragAndDrop<T>;\n\treadonly enableKeyboardNavigation?: boolean;\n\treadonly automaticKeyboardNavigation?: boolean;\n\treadonly keyboardNavigationLabelProvider?: IKeyboardNavigationLabelProvider<T>;\n\treadonly ariaRole?: ListAriaRootRole;\n\treadonly ariaLabel?: string;\n\treadonly keyboardSupport?: boolean;\n\treadonly multipleSelectionSupport?: boolean;\n\treadonly multipleSelectionController?: IMultipleSelectionController<T>;\n\treadonly openController?: IOpenController;\n\treadonly styleController?: IStyleController;\n\treadonly accessibilityProvider?: IAccessibilityProvider<T>;\n\n\t// list view options\n\treadonly useShadows?: boolean;\n\treadonly mouseSupport?: boolean;\n\treadonly horizontalScrolling?: boolean;\n\treadonly ariaSetProvider?: IAriaSetProvider<T>;\n}\n\nexport interface IListStyles {\n\tlistFocusBackground?: Color;\n\tlistFocusForeground?: Color;\n\tlistActiveSelectionBackground?: Color;\n\tlistActiveSelectionForeground?: Color;\n\tlistFocusAndSelectionBackground?: Color;\n\tlistFocusAndSelectionForeground?: Color;\n\tlistInactiveSelectionBackground?: Color;\n\tlistInactiveSelectionForeground?: 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}\n\nconst defaultStyles: IListStyles = {\n\tlistFocusBackground: Color.fromHex('#073655'),\n\tlistActiveSelectionBackground: Color.fromHex('#0E639C'),\n\tlistActiveSelectionForeground: Color.fromHex('#FFFFFF'),\n\tlistFocusAndSelectionBackground: Color.fromHex('#094771'),\n\tlistFocusAndSelectionForeground: Color.fromHex('#FFFFFF'),\n\tlistInactiveSelectionBackground: Color.fromHex('#3F3F46'),\n\tlistHoverBackground: Color.fromHex('#2A2D2E'),\n\tlistDropBackground: Color.fromHex('#383B3D')\n};\n\nconst DefaultOptions = {\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\tariaRootRole: ListAriaRootRole.TREE\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[], dynamicHeightProbing?: boolean): void {\n\t\tlet i = 0;\n\n\t\tfor (const renderer of this.renderers) {\n\t\t\trenderer.renderElement(element, index, templateData[i++], dynamicHeightProbing);\n\t\t}\n\t}\n\n\tdisposeElement(element: T, index: number, templateData: any[], dynamicHeightProbing?: boolean): 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], dynamicHeightProbing);\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: IAccessibilityProvider<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[]): string | undefined {\n\t\tif (this.dnd.getDragLabel) {\n\t\t\treturn this.dnd.getDragLabel(elements);\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\tdrop(data: IDragAndDropData, targetElement: T, targetIndex: number, originalEvent: DragEvent): void {\n\t\tthis.dnd.drop(data, targetElement, targetIndex, originalEvent);\n\t}\n}\n\nexport interface IListOptionsUpdate {\n\treadonly enableKeyboardNavigation?: boolean;\n\treadonly automaticKeyboardNavigation?: boolean;\n}\n\nexport class List<T> implements ISpliceable<T>, IDisposable {\n\n\tprivate focus: Trait<T>;\n\tprivate selection: Trait<T>;\n\tprivate eventBufferer = new EventBufferer();\n\tprivate view: ListView<T>;\n\tprivate spliceable: ISpliceable<T>;\n\tprivate styleElement: HTMLStyleElement;\n\tprivate styleController: IStyleController;\n\tprivate typeLabelController?: TypeLabelController<T>;\n\n\tprotected disposables: IDisposable[];\n\n\t@memoize get onFocusChange(): 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 onSelectionChange(): Event<IListEvent<T>> {\n\t\treturn Event.map(this.eventBufferer.wrapEvent(this.selection.onChange), e => this.toListEvent(e));\n\t}\n\n\tprivate _onDidOpen = new Emitter<IListEvent<T>>();\n\treadonly onDidOpen: Event<IListEvent<T>> = this._onDidOpen.event;\n\n\tprivate _onPin = new Emitter<number[]>();\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 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\tprivate didJustPressContextMenuKey: boolean = false;\n\t@memoize get onContextMenu(): Event<IListContextMenuEvent<T>> {\n\t\tconst fromKeydown = Event.chain(domEvent(this.view.domNode, 'keydown'))\n\t\t\t.map(e => new StandardKeyboardEvent(e))\n\t\t\t.filter(e => this.didJustPressContextMenuKey = e.keyCode === KeyCode.ContextMenu || (e.shiftKey && e.keyCode === KeyCode.F10))\n\t\t\t.filter(e => { e.preventDefault(); e.stopPropagation(); return false; })\n\t\t\t.event as Event<any>;\n\n\t\tconst fromKeyup = Event.chain(domEvent(this.view.domNode, 'keyup'))\n\t\t\t.filter(() => {\n\t\t\t\tconst didJustPressContextMenuKey = this.didJustPressContextMenuKey;\n\t\t\t\tthis.didJustPressContextMenuKey = false;\n\t\t\t\treturn didJustPressContextMenuKey;\n\t\t\t})\n\t\t\t.filter(() => this.getFocus().length > 0 && !!this.view.domElement(this.getFocus()[0]))\n\t\t\t.map(browserEvent => {\n\t\t\t\tconst index = this.getFocus()[0];\n\t\t\t\tconst element = this.view.element(index);\n\t\t\t\tconst anchor = this.view.domElement(index) as HTMLElement;\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(() => !this.didJustPressContextMenuKey)\n\t\t\t.map(({ element, index, browserEvent }) => ({ element, index, anchor: { x: browserEvent.clientX + 1, y: browserEvent.clientY }, browserEvent }))\n\t\t\t.event;\n\n\t\treturn Event.any<IListContextMenuEvent<T>>(fromKeydown, fromKeyup, fromMouse);\n\t}\n\n\tget onKeyDown(): Event<KeyboardEvent> { return domEvent(this.view.domNode, 'keydown'); }\n\n\treadonly onDidFocus: Event<void>;\n\treadonly onDidBlur: Event<void>;\n\n\tprivate _onDidDispose = new Emitter<void>();\n\tget onDidDispose(): Event<void> { return this._onDidDispose.event; }\n\n\tconstructor(\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\tthis.focus = new FocusTrait();\n\t\tthis.selection = new Trait('selected');\n\n\t\tmixin(_options, defaultStyles, false);\n\n\t\tconst baseRenderers: IListRenderer<T, ITraitTemplateData>[] = [this.focus.renderer, this.selection.renderer];\n\n\t\tif (_options.accessibilityProvider) {\n\t\t\tbaseRenderers.push(new AccessibiltyRenderer<T>(_options.accessibilityProvider));\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\n\t\tif (typeof _options.ariaRole !== 'string') {\n\t\t\tthis.view.domNode.setAttribute('role', ListAriaRootRole.TREE);\n\t\t} else {\n\t\t\tthis.view.domNode.setAttribute('role', _options.ariaRole);\n\t\t}\n\n\t\tthis.styleElement = DOM.createStyleSheet(this.view.domNode);\n\n\t\tthis.styleController = _options.styleController || new DefaultStyleController(this.styleElement, this.view.domId);\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\tthis.view\n\t\t]);\n\n\t\tthis.disposables = [this.focus, this.selection, this.view, this._onDidDispose];\n\n\t\tthis.onDidFocus = Event.map(domEvent(this.view.domNode, 'focus', true), () => null!);\n\t\tthis.onDidBlur = Event.map(domEvent(this.view.domNode, 'blur', true), () => null!);\n\n\t\tthis.disposables.push(new DOMFocusController(this, this.view));\n\n\t\tif (typeof _options.keyboardSupport !== 'boolean' || _options.keyboardSupport) {\n\t\t\tconst controller = new KeyboardController(this, this.view, _options);\n\t\t\tthis.disposables.push(controller);\n\t\t}\n\n\t\tif (_options.keyboardNavigationLabelProvider) {\n\t\t\tthis.typeLabelController = new TypeLabelController(this, this.view, _options.keyboardNavigationLabelProvider);\n\t\t\tthis.disposables.push(this.typeLabelController);\n\t\t}\n\n\t\tthis.disposables.push(this.createMouseController(_options));\n\n\t\tthis.onFocusChange(this._onFocusChange, this, this.disposables);\n\t\tthis.onSelectionChange(this._onSelectionChange, this, this.disposables);\n\n\t\tif (_options.ariaLabel) {\n\t\t\tthis.view.domNode.setAttribute('aria-label', localize('aria list', \"{0}. Use the navigation keys to navigate.\", _options.ariaLabel));\n\t\t}\n\n\t\tthis.style(_options);\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\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 Error(`Invalid start index: ${start}`);\n\t\t}\n\n\t\tif (deleteCount < 0) {\n\t\t\tthrow new Error(`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\tdomFocus(): void {\n\t\tthis.view.domNode.focus();\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 Error(`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\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 Error(`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\tfocusNextPage(browserEvent?: UIEvent, filter?: (element: T) => boolean): 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\t// Let the scroll event listener run\n\t\t\t\tsetTimeout(() => this.focusNextPage(browserEvent, filter), 0);\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusPreviousPage(browserEvent?: UIEvent, filter?: (element: T) => boolean): 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\t// Let the scroll event listener run\n\t\t\t\tsetTimeout(() => this.focusPreviousPage(browserEvent, filter), 0);\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\tif (this.length === 0) { return; }\n\n\t\tconst index = this.findNextIndex(0, 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 Error(`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 wrapperBottom = scrollTop + this.view.renderHeight;\n\n\t\t\tif (elementTop < scrollTop) {\n\t\t\t\tthis.view.setScrollTop(elementTop);\n\t\t\t} else if (viewItemBottom >= wrapperBottom) {\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 Error(`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\topen(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 Error(`Invalid index ${index}`);\n\t\t\t}\n\t\t}\n\n\t\tthis._onDidOpen.fire({ indexes, elements: indexes.map(i => this.view.element(i)), browserEvent });\n\t}\n\n\tpin(indexes: number[]): void {\n\t\tfor (const index of indexes) {\n\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\tthrow new Error(`Invalid index ${index}`);\n\t\t\t}\n\t\t}\n\n\t\tthis._onPin.fire(indexes);\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\n\t\tif (focus.length > 0) {\n\t\t\tthis.view.domNode.setAttribute('aria-activedescendant', this.view.getElementDomId(focus[0]));\n\t\t} else {\n\t\t\tthis.view.domNode.removeAttribute('aria-activedescendant');\n\t\t}\n\n\t\tthis.view.domNode.setAttribute('role', 'tree');\n\t\tDOM.toggleClass(this.view.domNode, 'element-focused', focus.length > 0);\n\t}\n\n\tprivate _onSelectionChange(): void {\n\t\tconst selection = this.selection.get();\n\n\t\tDOM.toggleClass(this.view.domNode, 'selection-none', selection.length === 0);\n\t\tDOM.toggleClass(this.view.domNode, 'selection-single', selection.length === 1);\n\t\tDOM.toggleClass(this.view.domNode, 'selection-multiple', selection.length > 1);\n\t}\n\n\tdispose(): void {\n\t\tthis._onDidDispose.fire();\n\t\tthis.disposables = dispose(this.disposables);\n\n\t\tthis._onDidOpen.dispose();\n\t\tthis._onPin.dispose();\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 'vs/css!./menu';\nimport * as nls from 'vs/nls';\nimport * as strings from 'vs/base/common/strings';\nimport { IActionRunner, IAction, Action } from 'vs/base/common/actions';\nimport { ActionBar, IActionItemProvider, ActionsOrientation, Separator, ActionItem, IActionItemOptions, BaseActionItem } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes';\nimport { addClass, EventType, EventHelper, EventLike, removeTabIndexAndUpdateFocus, isAncestor, hasClass, addDisposableListener, removeClass, append, $, addClasses, removeClasses } from 'vs/base/browser/dom';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { Color } from 'vs/base/common/color';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { isLinux } from 'vs/base/common/platform';\n\nfunction createMenuMnemonicRegExp() {\n\ttry {\n\t\treturn new RegExp('\\\\(&([^\\\\s&])\\\\)|(?<!&)&([^\\\\s&])');\n\t} catch (err) {\n\t\treturn new RegExp('\\uFFFF'); // never match please\n\t}\n}\nexport const MENU_MNEMONIC_REGEX = createMenuMnemonicRegExp();\nfunction createMenuEscapedMnemonicRegExp() {\n\ttry {\n\t\treturn new RegExp('(?<!&)(?:&)([^\\\\s&])');\n\t} catch (err) {\n\t\treturn new RegExp('\\uFFFF'); // never match please\n\t}\n}\nexport const MENU_ESCAPED_MNEMONIC_REGEX: RegExp = createMenuEscapedMnemonicRegExp();\n\nexport interface IMenuOptions {\n\tcontext?: any;\n\tactionItemProvider?: IActionItemProvider;\n\tactionRunner?: IActionRunner;\n\tgetKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;\n\tariaLabel?: string;\n\tenableMnemonics?: boolean;\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}\n\nexport class SubmenuAction extends Action {\n\tconstructor(label: string, public entries: Array<SubmenuAction | IAction>, cssClass?: string) {\n\t\tsuper(!!cssClass ? cssClass : 'submenu', label, '', true);\n\t}\n}\n\ninterface ISubMenuData {\n\tparent: Menu;\n\tsubmenu?: Menu;\n}\n\nexport class Menu extends ActionBar {\n\tprivate mnemonics: Map<string, Array<MenuActionItem>>;\n\tprivate menuDisposables: IDisposable[];\n\tprivate scrollableElement: DomScrollableElement;\n\tprivate menuElement: HTMLElement;\n\tprivate scrollTopHold: number | undefined;\n\n\tprivate readonly _onScroll: Emitter<void>;\n\n\tconstructor(container: HTMLElement, actions: IAction[], options: IMenuOptions = {}) {\n\n\t\taddClass(container, 'monaco-menu-container');\n\t\tcontainer.setAttribute('role', 'presentation');\n\t\tconst menuElement = document.createElement('div');\n\t\taddClass(menuElement, 'monaco-menu');\n\t\tmenuElement.setAttribute('role', 'presentation');\n\n\t\tsuper(menuElement, {\n\t\t\torientation: ActionsOrientation.VERTICAL,\n\t\t\tactionItemProvider: action => this.doGetActionItem(action, options, parentData),\n\t\t\tcontext: options.context,\n\t\t\tactionRunner: options.actionRunner,\n\t\t\tariaLabel: options.ariaLabel,\n\t\t\ttriggerKeys: { keys: [KeyCode.Enter], keyDown: true }\n\t\t});\n\n\t\tthis.menuElement = menuElement;\n\n\t\tthis._onScroll = this._register(new Emitter<void>());\n\n\t\tthis.actionsList.setAttribute('role', 'menu');\n\n\t\tthis.actionsList.tabIndex = 0;\n\n\t\tthis.menuDisposables = [];\n\n\t\tif (options.enableMnemonics) {\n\t\t\tthis.menuDisposables.push(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 SubmenuActionItem) {\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) {\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.items.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.scrollTopHold = this.menuElement.scrollTop;\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.domNode, EventType.MOUSE_UP, e => {\n\t\t\t// Absorb clicks in menu dead space https://github.com/Microsoft/vscode/issues/63575\n\t\t\tEventHelper.stop(e, true);\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 (hasClass(target, 'action-item')) {\n\t\t\t\tconst lastFocusedItem = this.focusedItem;\n\t\t\t\tthis.scrollTopHold = this.menuElement.scrollTop;\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\tlet parentData: ISubMenuData = {\n\t\t\tparent: this\n\t\t};\n\n\t\tthis.mnemonics = new Map<string, Array<MenuActionItem>>();\n\n\t\tthis.push(actions, { icon: true, label: true, isMenu: true });\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 = null;\n\n\t\tmenuElement.style.maxHeight = `${Math.max(10, window.innerHeight - container.getBoundingClientRect().top - 30)}px`;\n\n\t\tthis.scrollableElement.onScroll(() => {\n\t\t\tthis._onScroll.fire();\n\t\t}, this, this.menuDisposables);\n\n\t\tthis._register(addDisposableListener(this.menuElement, EventType.SCROLL, (e: ScrollEvent) => {\n\t\t\tif (this.scrollTopHold !== undefined) {\n\t\t\t\tthis.menuElement.scrollTop = this.scrollTopHold;\n\t\t\t\tthis.scrollTopHold = undefined;\n\t\t\t}\n\t\t\tthis.scrollableElement.scanDomNode();\n\t\t}));\n\n\t\tcontainer.appendChild(this.scrollableElement.getDomNode());\n\t\tthis.scrollableElement.scanDomNode();\n\n\t\tthis.items.filter(item => !(item instanceof MenuSeparatorActionItem)).forEach((item: MenuActionItem, index: number, array: any[]) => {\n\t\t\titem.updatePositionInSet(index + 1, array.length);\n\t\t});\n\t}\n\n\tstyle(style: IMenuStyles): void {\n\t\tconst container = this.getContainer();\n\n\t\tconst fgColor = style.foregroundColor ? `${style.foregroundColor}` : null;\n\t\tconst bgColor = style.backgroundColor ? `${style.backgroundColor}` : null;\n\t\tconst border = style.borderColor ? `2px solid ${style.borderColor}` : null;\n\t\tconst shadow = style.shadowColor ? `0 2px 4px ${style.shadowColor}` : null;\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.items) {\n\t\t\tthis.items.forEach(item => {\n\t\t\t\tif (item instanceof MenuActionItem || item instanceof MenuSeparatorActionItem) {\n\t\t\t\t\titem.style(style);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.scrollableElement.getDomNode();\n\t}\n\n\tget onScroll(): Event<void> {\n\t\treturn this._onScroll.event;\n\t}\n\n\tget scrollOffset(): number {\n\t\treturn this.menuElement.scrollTop;\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\tprivate doGetActionItem(action: IAction, options: IMenuOptions, parentData: ISubMenuData): BaseActionItem {\n\t\tif (action instanceof Separator) {\n\t\t\treturn new MenuSeparatorActionItem(options.context, action, { icon: true });\n\t\t} else if (action instanceof SubmenuAction) {\n\t\t\tconst menuActionItem = new SubmenuActionItem(action, action.entries, parentData, options);\n\n\t\t\tif (options.enableMnemonics) {\n\t\t\t\tconst mnemonic = menuActionItem.getMnemonic();\n\t\t\t\tif (mnemonic && menuActionItem.isEnabled()) {\n\t\t\t\t\tlet actionItems: MenuActionItem[] = [];\n\t\t\t\t\tif (this.mnemonics.has(mnemonic)) {\n\t\t\t\t\t\tactionItems = this.mnemonics.get(mnemonic)!;\n\t\t\t\t\t}\n\n\t\t\t\t\tactionItems.push(menuActionItem);\n\n\t\t\t\t\tthis.mnemonics.set(mnemonic, actionItems);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn menuActionItem;\n\t\t} else {\n\t\t\tconst menuItemOptions: IMenuItemOptions = { enableMnemonics: options.enableMnemonics };\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 menuActionItem = new MenuActionItem(options.context, action, menuItemOptions);\n\n\t\t\tif (options.enableMnemonics) {\n\t\t\t\tconst mnemonic = menuActionItem.getMnemonic();\n\t\t\t\tif (mnemonic && menuActionItem.isEnabled()) {\n\t\t\t\t\tlet actionItems: MenuActionItem[] = [];\n\t\t\t\t\tif (this.mnemonics.has(mnemonic)) {\n\t\t\t\t\t\tactionItems = this.mnemonics.get(mnemonic)!;\n\t\t\t\t\t}\n\n\t\t\t\t\tactionItems.push(menuActionItem);\n\n\t\t\t\t\tthis.mnemonics.set(mnemonic, actionItems);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn menuActionItem;\n\t\t}\n\t}\n}\n\ninterface IMenuItemOptions extends IActionItemOptions {\n\tenableMnemonics?: boolean;\n}\n\nclass MenuActionItem extends BaseActionItem {\n\n\tpublic container: HTMLElement;\n\n\tprotected options: IMenuItemOptions;\n\tprotected item: HTMLElement;\n\n\tprivate label: HTMLElement;\n\tprivate check: HTMLElement;\n\tprivate mnemonic: string;\n\tprivate cssClass: string;\n\tprotected menuStyle: IMenuStyles;\n\n\tconstructor(ctx: any, 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[2]).toLocaleLowerCase();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\trender(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'));\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\tthis._register(addDisposableListener(this.element, EventType.MOUSE_UP, e => {\n\t\t\tEventHelper.stop(e, true);\n\t\t\tthis.onClick(e);\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\tblur(): void {\n\t\tsuper.blur();\n\t\tthis.applyStyle();\n\t}\n\n\tfocus(): void {\n\t\tsuper.focus();\n\t\tthis.item.focus();\n\t\tthis.applyStyle();\n\t}\n\n\tupdatePositionInSet(pos: number, setSize: number): void {\n\t\tthis.item.setAttribute('aria-posinset', `${pos}`);\n\t\tthis.item.setAttribute('aria-setsize', `${setSize}`);\n\t}\n\n\tupdateLabel(): void {\n\t\tif (this.options.label) {\n\t\t\tlet label = 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).replace(MENU_ESCAPED_MNEMONIC_REGEX, '<u aria-hidden=\"true\">$1</u>');\n\t\t\t\t\tlabel = label.replace(/&&/g, '&');\n\t\t\t\t\tthis.item.setAttribute('aria-keyshortcuts', (!!matches[1] ? matches[1] : matches[2]).toLocaleLowerCase());\n\t\t\t\t} else {\n\t\t\t\t\tlabel = label.replace(/&&/g, '&');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.label.innerHTML = label.trim();\n\t\t}\n\t}\n\n\tupdateTooltip(): 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) {\n\t\t\tthis.item.title = title;\n\t\t}\n\t}\n\n\tupdateClass(): void {\n\t\tif (this.cssClass) {\n\t\t\tremoveClasses(this.item, this.cssClass);\n\t\t}\n\t\tif (this.options.icon) {\n\t\t\tthis.cssClass = this.getAction().class || '';\n\t\t\taddClass(this.label, 'icon');\n\t\t\tif (this.cssClass) {\n\t\t\t\taddClasses(this.label, this.cssClass);\n\t\t\t}\n\t\t\tthis.updateEnabled();\n\t\t} else {\n\t\t\tremoveClass(this.label, 'icon');\n\t\t}\n\t}\n\n\tupdateEnabled(): void {\n\t\tif (this.getAction().enabled) {\n\t\t\tif (this.element) {\n\t\t\t\tremoveClass(this.element, 'disabled');\n\t\t\t}\n\n\t\t\tremoveClass(this.item, 'disabled');\n\t\t\tthis.item.tabIndex = 0;\n\t\t} else {\n\t\t\tif (this.element) {\n\t\t\t\taddClass(this.element, 'disabled');\n\t\t\t}\n\n\t\t\taddClass(this.item, 'disabled');\n\t\t\tremoveTabIndexAndUpdateFocus(this.item);\n\t\t}\n\t}\n\n\tupdateChecked(): void {\n\t\tif (this.getAction().checked) {\n\t\t\taddClass(this.item, 'checked');\n\t\t\tthis.item.setAttribute('role', 'menuitemcheckbox');\n\t\t\tthis.item.setAttribute('aria-checked', 'true');\n\t\t} else {\n\t\t\tremoveClass(this.item, 'checked');\n\t\t\tthis.item.setAttribute('role', 'menuitem');\n\t\t\tthis.item.setAttribute('aria-checked', 'false');\n\t\t}\n\t}\n\n\tgetMnemonic(): string {\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 && hasClass(this.element, '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 : this.menuStyle.backgroundColor;\n\t\tconst border = isSelected && this.menuStyle.selectionBorderColor ? `1px solid ${this.menuStyle.selectionBorderColor}` : null;\n\n\t\tthis.item.style.color = fgColor ? `${fgColor}` : null;\n\t\tthis.check.style.backgroundColor = fgColor ? `${fgColor}` : null;\n\t\tthis.item.style.backgroundColor = bgColor ? `${bgColor}` : null;\n\t\tthis.container.style.border = border;\n\t}\n\n\tstyle(style: IMenuStyles): void {\n\t\tthis.menuStyle = style;\n\t\tthis.applyStyle();\n\t}\n}\n\nclass SubmenuActionItem extends MenuActionItem {\n\tprivate mysubmenu: Menu | null;\n\tprivate submenuContainer: HTMLElement | undefined;\n\tprivate submenuIndicator: HTMLElement;\n\tprivate submenuDisposables: IDisposable[] = [];\n\tprivate mouseOver: boolean;\n\tprivate showScheduler: RunOnceScheduler;\n\tprivate hideScheduler: RunOnceScheduler;\n\n\tconstructor(\n\t\taction: IAction,\n\t\tprivate submenuActions: IAction[],\n\t\tprivate parentData: ISubMenuData,\n\t\tprivate submenuOptions?: IMenuOptions\n\t) {\n\t\tsuper(action, action, submenuOptions);\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(document.activeElement, 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\trender(container: HTMLElement): void {\n\t\tsuper.render(container);\n\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\taddClass(this.item, 'monaco-submenu-item');\n\t\tthis.item.setAttribute('aria-haspopup', 'true');\n\n\t\tthis.submenuIndicator = append(this.item, $('span.submenu-indicator'));\n\t\tthis.submenuIndicator.setAttribute('aria-hidden', 'true');\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\t\t\tif (event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Enter)) {\n\t\t\t\tEventHelper.stop(e, 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.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(document.activeElement, 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\tonClick(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(false);\n\t}\n\n\tprivate cleanupExistingSubmenu(force: boolean): void {\n\t\tif (this.parentData.submenu && (force || (this.parentData.submenu !== this.mysubmenu))) {\n\t\t\tthis.parentData.submenu.dispose();\n\t\t\tthis.parentData.submenu = undefined;\n\n\t\t\tif (this.submenuContainer) {\n\t\t\t\tthis.submenuDisposables = dispose(this.submenuDisposables);\n\t\t\t\tthis.submenuContainer = undefined;\n\t\t\t}\n\t\t}\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.submenuContainer = append(this.element, $('div.monaco-submenu'));\n\t\t\taddClasses(this.submenuContainer, 'menubar-menu-items-holder', 'context-view');\n\n\t\t\tthis.parentData.submenu = new Menu(this.submenuContainer, this.submenuActions, 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\tconst boundingRect = this.element.getBoundingClientRect();\n\t\t\tconst childBoundingRect = this.submenuContainer.getBoundingClientRect();\n\t\t\tconst computedStyles = getComputedStyle(this.parentData.parent.domNode);\n\t\t\tconst paddingTop = parseFloat(computedStyles.paddingTop || '0') || 0;\n\n\t\t\tif (window.innerWidth <= boundingRect.right + childBoundingRect.width) {\n\t\t\t\tthis.submenuContainer.style.left = '10px';\n\t\t\t\tthis.submenuContainer.style.top = `${this.element.offsetTop - this.parentData.parent.scrollOffset + boundingRect.height}px`;\n\t\t\t} else {\n\t\t\t\tthis.submenuContainer.style.left = `${this.element.offsetWidth}px`;\n\t\t\t\tthis.submenuContainer.style.top = `${this.element.offsetTop - this.parentData.parent.scrollOffset - paddingTop}px`;\n\t\t\t}\n\n\t\t\tthis.submenuDisposables.push(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\tif (this.parentData.submenu) {\n\t\t\t\t\t\tthis.parentData.submenu.dispose();\n\t\t\t\t\t\tthis.parentData.submenu = undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.submenuDisposables = dispose(this.submenuDisposables);\n\t\t\t\t\tthis.submenuContainer = undefined;\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\tthis.submenuDisposables.push(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.push(this.parentData.submenu.onDidCancel(() => {\n\t\t\t\tthis.parentData.parent.focus();\n\n\t\t\t\tif (this.parentData.submenu) {\n\t\t\t\t\tthis.parentData.submenu.dispose();\n\t\t\t\t\tthis.parentData.submenu = undefined;\n\t\t\t\t}\n\n\t\t\t\tthis.submenuDisposables = dispose(this.submenuDisposables);\n\t\t\t\tthis.submenuContainer = undefined;\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\tprotected 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 && hasClass(this.element, 'focused');\n\t\tconst fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor;\n\n\t\tthis.submenuIndicator.style.backgroundColor = fgColor ? `${fgColor}` : null;\n\n\t\tif (this.parentData.submenu) {\n\t\t\tthis.parentData.submenu.style(this.menuStyle);\n\t\t}\n\t}\n\n\tdispose(): 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.submenuDisposables = dispose(this.submenuDisposables);\n\t\t\tthis.submenuContainer = undefined;\n\t\t}\n\t}\n}\n\nclass MenuSeparatorActionItem extends ActionItem {\n\tstyle(style: IMenuStyles): void {\n\t\tthis.label.style.borderBottomColor = style.separatorColor ? `${style.separatorColor}` : null;\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[0].charAt(0) === '&';\n\n\treturn label.replace(regex, mnemonicInText ? '$2' : '').trim();\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/tree';\nimport { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { IListOptions, List, IListStyles, mightProducePrintableCharacter, MouseController } from 'vs/base/browser/ui/list/listWidget';\nimport { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider, IIdentityProvider } from 'vs/base/browser/ui/list/list';\nimport { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass, hasClass } from 'vs/base/browser/dom';\nimport { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event';\nimport { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { ITreeModel, ITreeNode, ITreeRenderer, ITreeEvent, ITreeFilter, ICollapseStateChangeEvent, ITreeDragAndDrop, TreeDragOverBubble, TreeVisibility, TreeFilterResult, ITreeModelSpliceEvent } from 'vs/base/browser/ui/tree/tree';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { IDragAndDropData, StaticDND, DragAndDropData } from 'vs/base/browser/dnd';\nimport { range, equals, distinctES6 } from 'vs/base/common/arrays';\nimport { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView';\nimport { domEvent } from 'vs/base/browser/event';\nimport { fuzzyScore, FuzzyScore } from 'vs/base/common/filters';\nimport { getVisibleState, isFilterResult } from 'vs/base/browser/ui/tree/indexTreeModel';\nimport { localize } from 'vs/nls';\nimport { disposableTimeout } from 'vs/base/common/async';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport { values } from 'vs/base/common/map';\nimport { clamp } from 'vs/base/common/numbers';\n\nfunction asTreeDragAndDropData<T, TFilterData>(data: IDragAndDropData): IDragAndDropData {\n\tif (data instanceof ElementsDragAndDropData) {\n\t\tconst nodes = (data as ElementsDragAndDropData<ITreeNode<T, TFilterData>>).elements;\n\t\treturn new ElementsDragAndDropData(nodes.map(node => node.element));\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>[]): string | undefined {\n\t\tif (this.dnd.getDragLabel) {\n\t\t\treturn this.dnd.getDragLabel(nodes.map(node => node.element));\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') {\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 parentNode = targetNode.parent;\n\t\t\tconst model = this.modelProvider();\n\t\t\tconst parentIndex = parentNode && model.getListIndex(model.getNodeLocation(parentNode));\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\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\tgetAriaLabel(e) {\n\t\t\t\treturn options.accessibilityProvider!.getAriaLabel(e.element);\n\t\t\t},\n\t\t\tgetAriaLevel(node) {\n\t\t\t\treturn node.depth;\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\tariaSetProvider: {\n\t\t\tgetSetSize(node) {\n\t\t\t\treturn node.parent!.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}\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 twistie: HTMLElement;\n\treadonly templateData: T;\n}\n\ninterface ITreeRendererOptions {\n\treadonly indent?: number;\n}\n\nclass TreeRenderer<T, TFilterData, TTemplateData> implements IListRenderer<ITreeNode<T, TFilterData>, ITreeListTemplateData<TTemplateData>> {\n\n\tprivate static DefaultIndent = 8;\n\n\treadonly templateId: string;\n\tprivate renderedElements = new Map<T, ITreeNode<T, TFilterData>>();\n\tprivate renderedNodes = new Map<ITreeNode<T, TFilterData>, ITreeListTemplateData<TTemplateData>>();\n\tprivate indent: number = TreeRenderer.DefaultIndent;\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\tprivate renderer: ITreeRenderer<T, TFilterData, TTemplateData>,\n\t\tonDidChangeCollapseState: Event<ICollapseStateChangeEvent<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\tthis.renderedNodes.forEach((templateData, node) => {\n\t\t\ttemplateData.twistie.style.marginLeft = `${node.depth * this.indent}px`;\n\t\t});\n\t}\n\n\trenderTemplate(container: HTMLElement): ITreeListTemplateData<TTemplateData> {\n\t\tconst el = append(container, $('.monaco-tl-row'));\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, twistie, templateData };\n\t}\n\n\trenderElement(node: ITreeNode<T, TFilterData>, index: number, templateData: ITreeListTemplateData<TTemplateData>, dynamicHeightProbing?: boolean): void {\n\t\tif (!dynamicHeightProbing) {\n\t\t\tthis.renderedNodes.set(node, templateData);\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.marginLeft = `${indent}px`;\n\t\tthis.update(node, templateData);\n\n\t\tthis.renderer.renderElement(node, index, templateData.templateData, dynamicHeightProbing);\n\t}\n\n\tdisposeElement(node: ITreeNode<T, TFilterData>, index: number, templateData: ITreeListTemplateData<TTemplateData>, dynamicHeightProbing?: boolean): void {\n\t\tif (this.renderer.disposeElement) {\n\t\t\tthis.renderer.disposeElement(node, index, templateData.templateData, dynamicHeightProbing);\n\t\t}\n\n\t\tif (!dynamicHeightProbing) {\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 templateData = this.renderedNodes.get(node);\n\n\t\tif (!templateData) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.update(node, templateData);\n\t}\n\n\tprivate update(node: ITreeNode<T, TFilterData>, templateData: ITreeListTemplateData<TTemplateData>) {\n\t\tif (this.renderer.renderTwistie) {\n\t\t\tthis.renderer.renderTwistie(node.element, templateData.twistie);\n\t\t}\n\n\t\ttoggleClass(templateData.twistie, 'collapsible', node.collapsible);\n\t\ttoggleClass(templateData.twistie, 'collapsed', node.collapsible && node.collapsed);\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\tdispose(): void {\n\t\tthis.renderedNodes.clear();\n\t\tthis.renderedElements.clear();\n\t\tthis.disposables = dispose(this.disposables);\n\t}\n}\n\nclass TypeFilter<T> implements ITreeFilter<T, FuzzyScore>, IDisposable {\n\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 disposables: IDisposable[] = [];\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> {\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 labelStr = label && label.toString();\n\n\t\tif (typeof labelStr === 'undefined') {\n\t\t\treturn { data: FuzzyScore.Default, visibility: true };\n\t\t}\n\n\t\tconst score = fuzzyScore(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, true);\n\n\t\tif (!score) {\n\t\t\tif (this.tree.options.filterOnType) {\n\t\t\t\treturn TreeVisibility.Recurse;\n\t\t\t} else {\n\t\t\t\treturn { data: FuzzyScore.Default, visibility: true };\n\t\t\t}\n\n\t\t\t// DEMO: smarter filter ?\n\t\t\t// return parentVisibility === TreeVisibility.Visible ? true : TreeVisibility.Recurse;\n\t\t}\n\n\t\tthis._matchCount++;\n\t\treturn { data: score, visibility: true };\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\tthis.disposables = dispose(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;\n\n\tprivate _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 _onDidChangePattern = new Emitter<string>();\n\n\tprivate enabledDisposables: IDisposable[] = [];\n\tprivate disposables: IDisposable[] = [];\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 keyboardNavigationLabelProvider: IKeyboardNavigationLabelProvider<T>\n\t) {\n\t\tthis.domNode = $(`.monaco-list-type-filter.${this.positionClassName}`);\n\t\tthis.domNode.draggable = true;\n\t\tdomEvent(this.domNode, 'dragstart')(this.onDragStart, this, this.disposables);\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.updateFilterOnTypeTitle();\n\t\tdomEvent(this.filterOnTypeDomNode, 'input')(this.onDidChangeFilterOnType, this, this.disposables);\n\n\t\tthis.clearDomNode = append(controls, $<HTMLInputElement>('button.clear'));\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}\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 isPrintableCharEvent = this.keyboardNavigationLabelProvider.mightProducePrintableCharacter ? (e: IKeyboardEvent) => this.keyboardNavigationLabelProvider.mightProducePrintableCharacter!(e) : (e: IKeyboardEvent) => mightProducePrintableCharacter(e);\n\t\tconst onKeyDown = Event.chain(domEvent(this.view.getHTMLElement(), 'keydown'))\n\t\t\t.filter(e => !isInputElement(e.target as HTMLElement) || e.target === this.filterOnTypeDomNode)\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 => isPrintableCharEvent(e) || ((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 onClear = domEvent(this.clearDomNode, 'click');\n\n\t\tEvent.chain(Event.any<MouseEvent | StandardKeyboardEvent>(onKeyDown, onClear))\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 = dispose(this.enabledDisposables);\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: IDisposable[] = [];\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.screenX - 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 = null;\n\t\t\tthis.domNode.style.left = null;\n\n\t\t\tdispose(disposables);\n\t\t};\n\n\t\tupdatePosition();\n\t\tremoveClass(this.domNode, positionClassName);\n\n\t\taddClass(this.domNode, 'dragging');\n\t\tdisposables.push(toDisposable(() => removeClass(this.domNode, 'dragging')));\n\n\t\tdomEvent(document, 'dragover')(onDragOver, null, disposables);\n\t\tdomEvent(this.domNode, 'dragend')(onDragEnd, null, disposables);\n\n\t\tStaticDND.CurrentDragAndDropData = new DragAndDropData('vscode-ui');\n\t\tdisposables.push(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.updateFilterOnTypeTitle();\n\t}\n\n\tprivate updateFilterOnTypeTitle(): void {\n\t\tif (this.filterOnType) {\n\t\t\tthis.filterOnTypeDomNode.title = localize('disable filter on type', \"Disable Filter on Type\");\n\t\t} else {\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.innerHTML = '';\n\t\t\tthis._empty = false;\n\t\t}\n\n\t\ttoggleClass(this.domNode, '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\tthis.disable();\n\t\tthis._onDidChangePattern.dispose();\n\t\tthis.disposables = dispose(this.disposables);\n\t}\n}\n\nfunction isInputElement(e: HTMLElement): boolean {\n\treturn e.tagName === 'INPUT' || e.tagName === 'TEXTAREA';\n}\n\nfunction asTreeEvent<T>(event: IListEvent<ITreeNode<T, any>>): ITreeEvent<T> {\n\treturn {\n\t\telements: event.elements.map(node => node.element),\n\t\tbrowserEvent: event.browserEvent\n\t};\n}\n\nexport interface IKeyboardNavigationEventFilter {\n\t(e: StandardKeyboardEvent): boolean;\n}\n\nexport interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions {\n\treadonly automaticKeyboardNavigation?: boolean;\n\treadonly simpleKeyboardNavigation?: boolean;\n\treadonly filterOnType?: boolean;\n\treadonly openOnSingleClick?: boolean;\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 expandOnlyOnTwistieClick?: boolean | ((e: T) => boolean);\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 _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(private identityProvider?: IIdentityProvider<T>) { }\n\n\tset(nodes: ITreeNode<T, any>[], browserEvent?: UIEvent): void {\n\t\tif (equals(this.nodes, nodes)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.nodes = [...nodes];\n\t\tthis.elements = undefined;\n\t\tthis._nodeSet = undefined;\n\n\t\tconst that = this;\n\t\tthis._onDidChange.fire({ get elements() { return that.get(); }, browserEvent });\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\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(values(set));\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\tthis.set(nodes);\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 onPointer(e: IListMouseEvent<ITreeNode<T, TFilterData>>): void {\n\t\tif (isInputElement(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.onPointer(e);\n\t\t}\n\n\t\tif (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e)) {\n\t\t\treturn super.onPointer(e);\n\t\t}\n\n\t\tconst onTwistie = hasClass(e.browserEvent.target as HTMLElement, 'monaco-tl-twistie');\n\n\t\tif (!this.tree.openOnSingleClick && e.browserEvent.detail !== 2 && !onTwistie) {\n\t\t\treturn super.onPointer(e);\n\t\t}\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) {\n\t\t\treturn super.onPointer(e);\n\t\t}\n\n\t\tconst model = ((this.tree as any).model as ITreeModel<T, TFilterData, TRef>); // internal\n\t\tconst location = model.getNodeLocation(node);\n\t\tconst recursive = e.browserEvent.altKey;\n\t\tmodel.setCollapsed(location, undefined, recursive);\n\n\t\tif (expandOnlyOnTwistieClick && onTwistie) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.onPointer(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\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\toptions: ITreeNodeListOptions<T, TFilterData, TRef>\n\t) {\n\t\tsuper(container, virtualDelegate, renderers, options);\n\t}\n\n\tprotected createMouseController(options: ITreeNodeListOptions<T, TFilterData, TRef>): MouseController<ITreeNode<T, TFilterData>> {\n\t\treturn new TreeNodeListMouseController(this, options.tree);\n\t}\n\n\tsplice(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\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\t\t});\n\n\t\tif (additionalFocus.length > 0) {\n\t\t\tsuper.setFocus(distinctES6([...super.getFocus(), ...additionalFocus]));\n\t\t}\n\n\t\tif (additionalSelection.length > 0) {\n\t\t\tsuper.setSelection(distinctES6([...super.getSelection(), ...additionalSelection]));\n\t\t}\n\t}\n\n\tsetFocus(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\tsetSelection(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\nexport abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable {\n\n\tprotected view: TreeNodeList<T, TFilterData, TRef>;\n\tprivate renderers: TreeRenderer<T, TFilterData, any>[];\n\tprotected model: ITreeModel<T, TFilterData, TRef>;\n\tprivate focus: Trait<T>;\n\tprivate selection: Trait<T>;\n\tprivate eventBufferer = new EventBufferer();\n\tprivate typeFilterController?: TypeFilterController<T, TFilterData>;\n\tprivate focusNavigationFilter: ((node: ITreeNode<T, TFilterData>) => boolean) | undefined;\n\tprotected disposables: IDisposable[] = [];\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 onDidOpen(): Event<ITreeEvent<T>> { return Event.map(this.view.onDidOpen, asTreeEvent); }\n\n\tget onDidFocus(): Event<void> { return this.view.onDidFocus; }\n\n\tget onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<T, TFilterData>> { return this.model.onDidChangeCollapseState; }\n\n\tprivate _onWillRefilter = new Emitter<void>();\n\treadonly onWillRefilter: Event<void> = this._onWillRefilter.event;\n\n\t// Options TODO@joao expose options only, not Optional<>\n\tget openOnSingleClick(): boolean { return typeof this._options.openOnSingleClick === 'undefined' ? true : this._options.openOnSingleClick; }\n\tget expandOnlyOnTwistieClick(): boolean | ((e: T) => boolean) { return typeof this._options.expandOnlyOnTwistieClick === 'undefined' ? false : this._options.expandOnlyOnTwistieClick; }\n\n\tprivate _onDidUpdateOptions = new Emitter<IAbstractTreeOptions<T, TFilterData>>();\n\n\tget onDidDispose(): Event<void> { return this.view.onDidDispose; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, 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\tthis.renderers = renderers.map(r => new TreeRenderer<T, TFilterData, any>(r, onDidChangeCollapseStateRelay.event, _options));\n\t\tthis.disposables.push(...this.renderers);\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.push(filter);\n\t\t}\n\n\t\tthis.focus = new Trait(_options.identityProvider);\n\t\tthis.selection = new Trait(_options.identityProvider);\n\t\tthis.view = new TreeNodeList(container, treeDelegate, this.renderers, this.focus, this.selection, { ...asListOptions(() => this.model, _options), tree: this });\n\n\t\tthis.model = this.createModel(this.view, _options);\n\t\tonDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState;\n\n\t\tthis.model.onDidSplice(e => {\n\t\t\tthis.focus.onDidModelSplice(e);\n\t\t\tthis.selection.onDidModelSplice(e);\n\t\t}, null, this.disposables);\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\tthis.typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, _options.keyboardNavigationLabelProvider);\n\t\t\tthis.focusNavigationFilter = node => this.typeFilterController!.shouldAllowFocus(node);\n\t\t\tthis.disposables.push(this.typeFilterController!);\n\t\t}\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\tenableKeyboardNavigation: this._options.simpleKeyboardNavigation,\n\t\t\tautomaticKeyboardNavigation: this._options.automaticKeyboardNavigation\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\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\tthis.view.style(styles);\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\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 === null) {\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(view: ISpliceable<ITreeNode<T, TFilterData>>, options: IAbstractTreeOptions<T, TFilterData>): ITreeModel<T, TFilterData, TRef>;\n\n\tdispose(): void {\n\t\tthis.disposables = dispose(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 { AbstractTree, IAbstractTreeOptions } from 'vs/base/browser/ui/tree/abstractTree';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { ITreeNode, ITreeModel, ITreeRenderer, IDataSource } from 'vs/base/browser/ui/tree/tree';\nimport { ObjectTreeModel } from 'vs/base/browser/ui/tree/objectTreeModel';\nimport { IListVirtualDelegate, IIdentityProvider } from 'vs/base/browser/ui/list/list';\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\tprivate identityProvider: IIdentityProvider<T> | undefined;\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, TFilterData, any>[],\n\t\tprivate dataSource: IDataSource<TInput, T>,\n\t\toptions: IDataTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tsuper(container, delegate, renderers, options);\n\t\tthis.identityProvider = options.identityProvider;\n\t}\n\n\tprotected createModel(view: ISpliceable<ITreeNode<T, TFilterData>>, options: IDataTreeOptions<T, TFilterData>): ITreeModel<T | null, TFilterData, T | null> {\n\t\treturn new ObjectTreeModel(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 { Iterator, ISequence } from 'vs/base/common/iterator';\nimport { AbstractTree, IAbstractTreeOptions } from 'vs/base/browser/ui/tree/abstractTree';\nimport { ISpliceable } from 'vs/base/common/sequence';\nimport { ITreeNode, ITreeModel, ITreeElement, ITreeRenderer, ITreeSorter } from 'vs/base/browser/ui/tree/tree';\nimport { ObjectTreeModel } from 'vs/base/browser/ui/tree/objectTreeModel';\nimport { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\n\nexport interface IObjectTreeOptions<T, TFilterData = void> extends IAbstractTreeOptions<T, TFilterData> {\n\tsorter?: ITreeSorter<T>;\n}\n\nexport class ObjectTree<T extends NonNullable<any>, TFilterData = void> extends AbstractTree<T | null, TFilterData, T | null> {\n\n\tprotected model: ObjectTreeModel<T, TFilterData>;\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, TFilterData, any>[],\n\t\toptions: IObjectTreeOptions<T, TFilterData> = {}\n\t) {\n\t\tsuper(container, delegate, renderers, options);\n\t}\n\n\tsetChildren(\n\t\telement: T | null,\n\t\tchildren?: ISequence<ITreeElement<T>>,\n\t\tonDidCreateNode?: (node: ITreeNode<T, TFilterData>) => void,\n\t\tonDidDeleteNode?: (node: ITreeNode<T, TFilterData>) => void\n\t): Iterator<ITreeElement<T | null>> {\n\t\treturn this.model.setChildren(element, children, onDidCreateNode, onDidDeleteNode);\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\tprotected createModel(view: ISpliceable<ITreeNode<T, TFilterData>>, options: IObjectTreeOptions<T, TFilterData>): ITreeModel<T | null, TFilterData, T | null> {\n\t\treturn new ObjectTreeModel(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 { ComposedTreeDelegate, IAbstractTreeOptions, IAbstractTreeOptionsUpdate } from 'vs/base/browser/ui/tree/abstractTree';\nimport { ObjectTree, IObjectTreeOptions } from 'vs/base/browser/ui/tree/objectTree';\nimport { IListVirtualDelegate, IIdentityProvider, IListDragAndDrop, IListDragOverReaction } from 'vs/base/browser/ui/list/list';\nimport { ITreeElement, ITreeNode, ITreeRenderer, ITreeEvent, ITreeSorter, ICollapseStateChangeEvent, IAsyncDataSource, ITreeDragAndDrop } from 'vs/base/browser/ui/tree/tree';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { timeout, CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\nimport { IListStyles } from 'vs/base/browser/ui/list/listWidget';\nimport { Iterator } from 'vs/base/common/iterator';\nimport { IDragAndDropData } from 'vs/base/browser/dnd';\nimport { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView';\nimport { isPromiseCanceledError, onUnexpectedError } from 'vs/base/common/errors';\nimport { toggleClass } from 'vs/base/browser/dom';\nimport { values } from 'vs/base/common/map';\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\tloading: boolean;\n\thasChildren: boolean;\n\tstale: boolean;\n\tslow: boolean;\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\tloading: false,\n\t\tstale: true,\n\t\tslow: false\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\nclass AsyncDataTreeNodeWrapper<TInput, T, TFilterData> implements ITreeNode<TInput | T, TFilterData> {\n\n\tget element(): T { return this.node.element!.element as T; }\n\tget parent(): ITreeNode<T, TFilterData> | undefined { return this.node.parent && new AsyncDataTreeNodeWrapper(this.node.parent); }\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 DataTreeRenderer<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\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\tprivate renderer: ITreeRenderer<T, TFilterData, TTemplateData>,\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>, dynamicHeightProbing?: boolean): void {\n\t\tthis.renderer.renderElement(new AsyncDataTreeNodeWrapper(node), index, templateData.templateData, dynamicHeightProbing);\n\t}\n\n\trenderTwistie(element: IAsyncDataTreeNode<TInput, T>, twistieElement: HTMLElement): boolean {\n\t\ttoggleClass(twistieElement, 'loading', element.slow);\n\t\treturn false;\n\t}\n\n\tdisposeElement(node: ITreeNode<IAsyncDataTreeNode<TInput, T>, TFilterData>, index: number, templateData: IDataTreeListTemplateData<TTemplateData>, dynamicHeightProbing?: boolean): void {\n\t\tif (this.renderer.disposeElement) {\n\t\t\tthis.renderer.disposeElement(new AsyncDataTreeNodeWrapper(node), index, templateData.templateData, dynamicHeightProbing);\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\nfunction asTreeEvent<TInput, T>(e: ITreeEvent<IAsyncDataTreeNode<TInput, T>>): ITreeEvent<T> {\n\treturn {\n\t\tbrowserEvent: e.browserEvent,\n\t\telements: e.elements.map(e => e.element as T)\n\t};\n}\n\nexport enum ChildrenResolutionReason {\n\tRefresh,\n\tExpand\n}\n\nfunction asAsyncDataTreeDragAndDropData<TInput, T>(data: IDragAndDropData): IDragAndDropData {\n\tif (data instanceof ElementsDragAndDropData) {\n\t\tconst nodes = (data as ElementsDragAndDropData<IAsyncDataTreeNode<TInput, T>>).elements;\n\t\treturn new ElementsDragAndDropData(nodes.map(node => node.element));\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>[]): string | undefined {\n\t\tif (this.dnd.getDragLabel) {\n\t\t\treturn this.dnd.getDragLabel(nodes.map(node => node.element as T));\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\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\tgetAriaLabel(e) {\n\t\t\t\treturn options.accessibilityProvider!.getAriaLabel(e.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\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\tariaSetProvider: undefined\n\t};\n}\n\nfunction asTreeElement<TInput, T>(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): ITreeElement<IAsyncDataTreeNode<TInput, T>> {\n\tlet collapsed: boolean | undefined;\n\n\tif (viewStateContext && viewStateContext.viewState.expanded && node.id) {\n\t\tcollapsed = viewStateContext.viewState.expanded.indexOf(node.id) === -1;\n\t}\n\n\treturn {\n\t\telement: node,\n\t\tchildren: node.hasChildren ? Iterator.map(Iterator.fromArray(node.children), child => asTreeElement(child, viewStateContext)) : [],\n\t\tcollapsible: node.hasChildren,\n\t\tcollapsed\n\t};\n}\n\nexport interface IAsyncDataTreeOptionsUpdate extends IAbstractTreeOptionsUpdate { }\n\nexport interface IAsyncDataTreeOptions<T, TFilterData = void> extends IAsyncDataTreeOptionsUpdate, IAbstractTreeOptions<T, TFilterData> {\n\tidentityProvider?: IIdentityProvider<T>;\n\tsorter?: ITreeSorter<T>;\n\tautoExpandSingleChildren?: 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 {\n\n\tprivate readonly tree: ObjectTree<IAsyncDataTreeNode<TInput, T>, TFilterData>;\n\tprivate readonly root: IAsyncDataTreeNode<TInput, T>;\n\tprivate readonly nodes = new Map<null | T, IAsyncDataTreeNode<TInput, T>>();\n\tprivate readonly sorter?: ITreeSorter<T>;\n\n\tprivate readonly subTreeRefreshPromises = new Map<IAsyncDataTreeNode<TInput, T>, Promise<void>>();\n\tprivate readonly refreshPromises = new Map<IAsyncDataTreeNode<TInput, T>, CancelablePromise<T[]>>();\n\n\tprivate readonly identityProvider?: IIdentityProvider<T>;\n\tprivate readonly autoExpandSingleChildren: boolean;\n\n\tprivate readonly _onDidRender = new Emitter<void>();\n\tprivate readonly _onDidChangeNodeSlowState = new Emitter<IAsyncDataTreeNode<TInput, T>>();\n\n\tprotected readonly disposables: IDisposable[] = [];\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 onDidOpen(): Event<ITreeEvent<T>> { return Event.map(this.tree.onDidOpen, asTreeEvent); }\n\tget onDidFocus(): Event<void> { return this.tree.onDidFocus; }\n\n\tget onDidDispose(): Event<void> { return this.tree.onDidDispose; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, 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\n\t\tconst objectTreeDelegate = new ComposedTreeDelegate<TInput | T, IAsyncDataTreeNode<TInput, T>>(delegate);\n\t\tconst objectTreeRenderers = renderers.map(r => new DataTreeRenderer(r, this._onDidChangeNodeSlowState.event));\n\t\tconst objectTreeOptions = asObjectTreeOptions<TInput, T, TFilterData>(options) || {};\n\n\t\tthis.tree = new ObjectTree(container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions);\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\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, 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\tasync updateChildren(element: TInput | T = this.root.element, recursive = true, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): Promise<void> {\n\t\tif (typeof this.root.element === 'undefined') {\n\t\t\tthrow new Error('Tree input not set');\n\t\t}\n\n\t\tif (this.root.loading) {\n\t\t\tawait this.subTreeRefreshPromises.get(this.root)!;\n\t\t\tawait Event.toPromise(this._onDidRender.event);\n\t\t}\n\n\t\tawait this.refreshAndRenderNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh, viewStateContext);\n\t}\n\n\t// View\n\n\trerender(element?: T): void {\n\t\tif (element === undefined) {\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\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 Error('Tree input not set');\n\t\t}\n\n\t\tif (this.root.loading) {\n\t\t\tawait this.subTreeRefreshPromises.get(this.root)!;\n\t\t\tawait Event.toPromise(this._onDidRender.event);\n\t\t}\n\n\t\tconst node = this.getDataNode(element);\n\n\t\tif (node !== this.root && !node.loading && !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.loading) {\n\t\t\tawait this.subTreeRefreshPromises.get(node)!;\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// 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 Error(`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, reason: ChildrenResolutionReason, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): Promise<void> {\n\t\tawait this.refreshNode(node, recursive, viewStateContext);\n\t\tthis.render(node, viewStateContext);\n\n\t\tif (node !== this.root && this.autoExpandSingleChildren && reason === ChildrenResolutionReason.Expand) {\n\t\t\tconst treeNode = this.tree.getNode(node);\n\t\t\tconst visibleChildren = treeNode.children.filter(node => node.visible);\n\n\t\t\tif (visibleChildren.length === 1) {\n\t\t\t\tawait this.tree.expand(visibleChildren[0].element, false);\n\t\t\t}\n\t\t}\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\tresult = this.doRefreshSubTree(node, recursive, viewStateContext);\n\t\tthis.subTreeRefreshPromises.set(node, result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} finally {\n\t\t\tthis.subTreeRefreshPromises.delete(node);\n\t\t}\n\t}\n\n\tprivate async doRefreshSubTree(node: IAsyncDataTreeNode<TInput, T>, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): Promise<void> {\n\t\tnode.loading = true;\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 Promise.all(childrenToRefresh.map(child => this.doRefreshSubTree(child, recursive, viewStateContext)));\n\t\t} finally {\n\t\t\tnode.loading = false;\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<T[]>;\n\n\t\tif (!node.hasChildren) {\n\t\t\tchildrenPromise = Promise.resolve([]);\n\t\t} else {\n\t\t\tconst slowTimeout = timeout(800);\n\n\t\t\tslowTimeout.then(() => {\n\t\t\t\tnode.slow = true;\n\t\t\t\tthis._onDidChangeNodeSlowState.fire(node);\n\t\t\t}, _ => null);\n\n\t\t\tchildrenPromise = this.doGetChildren(node)\n\t\t\t\t.finally(() => slowTimeout.cancel());\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) {\n\t\t\t\tthis.tree.collapse(node === this.root ? null : node);\n\t\t\t}\n\n\t\t\tif (isPromiseCanceledError(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<T[]> {\n\t\tlet result = this.refreshPromises.get(node);\n\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = createCancelablePromise(async () => {\n\t\t\tconst children = await this.dataSource.getChildren(node.element!);\n\n\t\t\tif (this.sorter) {\n\t\t\t\tchildren.sort(this.sorter.compare.bind(this.sorter));\n\t\t\t}\n\n\t\t\treturn children;\n\t\t});\n\n\t\tthis.refreshPromises.set(node, result);\n\n\t\treturn result.finally(() => this.refreshPromises.delete(node));\n\t}\n\n\tprivate _onDidChangeCollapseState({ node, deep }: ICollapseStateChangeEvent<IAsyncDataTreeNode<TInput, T>, any>): void {\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, ChildrenResolutionReason.Expand)\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>, childrenElements: T[], recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): IAsyncDataTreeNode<TInput, T>[] {\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, ITreeNode<IAsyncDataTreeNode<TInput, T> | null, TFilterData>>();\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\tchildrenTreeNodesById.set(child.id!, this.tree.getNode(child));\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\tif (!this.identityProvider) {\n\t\t\t\treturn createAsyncDataTreeNode({\n\t\t\t\t\telement,\n\t\t\t\t\tparent: node,\n\t\t\t\t\thasChildren: !!this.dataSource.hasChildren(element)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst id = this.identityProvider.getId(element).toString();\n\t\t\tconst childNode = childrenTreeNodesById.get(id);\n\n\t\t\tif (childNode) {\n\t\t\t\tconst asyncDataTreeNode = childNode.element!;\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 = !!this.dataSource.hasChildren(element);\n\n\t\t\t\tif (recursive) {\n\t\t\t\t\tif (childNode.collapsed) {\n\t\t\t\t\t\tdfs(asyncDataTreeNode, node => node.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}\n\n\t\t\t\treturn asyncDataTreeNode;\n\t\t\t}\n\n\t\t\tconst childAsyncDataTreeNode = createAsyncDataTreeNode({\n\t\t\t\telement,\n\t\t\t\tparent: node,\n\t\t\t\tid,\n\t\t\t\thasChildren: !!this.dataSource.hasChildren(element)\n\t\t\t});\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}\n\n\t\t\treturn childAsyncDataTreeNode;\n\t\t});\n\n\t\tfor (const node of values(nodesToForget)) {\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\treturn childrenToRefresh;\n\t}\n\n\tprivate render(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>): void {\n\t\tconst children = node.children.map(c => asTreeElement(c, viewStateContext));\n\t\tthis.tree.setChildren(node === this.root ? null : node, children);\n\t\tthis._onDidRender.fire();\n\t}\n\n\tdispose(): void {\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 * as nls from 'vs/nls';\nimport { OperatingSystem } from 'vs/base/common/platform';\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 Modifiers {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\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: '⌃',\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: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, \"Alt\"),\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\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\tresult.push(key);\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 'vs/css!./keybindingLabel';\nimport { equals } from 'vs/base/common/objects';\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes';\nimport { UILabelProvider } from 'vs/base/common/keybindingLabels';\nimport * as dom from 'vs/base/browser/dom';\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 {\n\trenderUnboundKeybindings: boolean;\n}\n\nexport class KeybindingLabel {\n\n\tprivate domNode: HTMLElement;\n\tprivate keybinding: ResolvedKeybinding | undefined;\n\tprivate matches: Matches | undefined;\n\tprivate didEverRender: boolean;\n\n\tconstructor(container: HTMLElement, private os: OperatingSystem, private options?: KeybindingLabelOptions) {\n\t\tthis.domNode = dom.append(container, $('.monaco-keybinding'));\n\t\tthis.didEverRender = false;\n\t\tcontainer.appendChild(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\tdom.clearNode(this.domNode);\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.didEverRender = true;\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 && match.ctrlKey), modifierLabels.separator);\n\t\t}\n\t\tif (part.shiftKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.shiftKey, Boolean(match && match.shiftKey), modifierLabels.separator);\n\t\t}\n\t\tif (part.altKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.altKey, Boolean(match && match.altKey), modifierLabels.separator);\n\t\t}\n\t\tif (part.metaKey) {\n\t\t\tthis.renderKey(parent, modifierLabels.metaKey, Boolean(match && 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 && 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, $('span.monaco-keybinding-key' + (highlight ? '.highlight' : ''), undefined, label));\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, $('span.monaco-keybinding-key', undefined, localize('unbound', \"Unbound\")));\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 nls from 'vs/nls';\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\n\tconst _displayStrings: { [value: number]: string; } = Object.create(null);\n\t_displayStrings[Severity.Error] = nls.localize('sev.error', \"Error\");\n\t_displayStrings[Severity.Warning] = nls.localize('sev.warning', \"Warning\");\n\t_displayStrings[Severity.Info] = nls.localize('sev.info', \"Info\");\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\nexport default Severity;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 types from 'vs/base/common/types';\nimport { ITree, IActionProvider } from 'vs/base/parts/tree/browser/tree';\nimport { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';\nimport { IModel, IDataSource, IFilter, IAccessiblityProvider, IRenderer, IRunner, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { IAction, IActionRunner } from 'vs/base/common/actions';\nimport { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';\nimport * as DOM from 'vs/base/browser/dom';\nimport { IQuickOpenStyles } from 'vs/base/parts/quickopen/browser/quickOpenWidget';\nimport { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel';\nimport { OS } from 'vs/base/common/platform';\nimport { ResolvedKeybinding } from 'vs/base/common/keyCodes';\nimport { coalesce } from 'vs/base/common/arrays';\n\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n}\n\nlet IDS = 0;\n\nexport class QuickOpenEntry {\n\tprivate id: string;\n\tprivate labelHighlights: IHighlight[];\n\tprivate descriptionHighlights?: IHighlight[];\n\tprivate detailHighlights?: IHighlight[];\n\tprivate hidden: boolean;\n\n\tconstructor(highlights: IHighlight[] = []) {\n\t\tthis.id = (IDS++).toString();\n\t\tthis.labelHighlights = highlights;\n\t\tthis.descriptionHighlights = [];\n\t}\n\n\t/**\n\t * A unique identifier for the entry\n\t */\n\tgetId(): string {\n\t\treturn this.id;\n\t}\n\n\t/**\n\t * The label of the entry to identify it from others in the list\n\t */\n\tgetLabel(): string | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * The options for the label to use for this entry\n\t */\n\tgetLabelOptions(): IIconLabelValueOptions | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * The label of the entry to use when a screen reader wants to read about the entry\n\t */\n\tgetAriaLabel(): string {\n\t\treturn coalesce([this.getLabel(), this.getDescription(), this.getDetail()])\n\t\t\t.join(', ');\n\t}\n\n\t/**\n\t * Detail information about the entry that is optional and can be shown below the label\n\t */\n\tgetDetail(): string | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * The icon of the entry to identify it from others in the list\n\t */\n\tgetIcon(): string | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * A secondary description that is optional and can be shown right to the label\n\t */\n\tgetDescription(): string | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * A tooltip to show when hovering over the entry.\n\t */\n\tgetTooltip(): string | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * A tooltip to show when hovering over the description portion of the entry.\n\t */\n\tgetDescriptionTooltip(): string | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * An optional keybinding to show for an entry.\n\t */\n\tgetKeybinding(): ResolvedKeybinding | null {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Allows to reuse the same model while filtering. Hidden entries will not show up in the viewer.\n\t */\n\tisHidden(): boolean {\n\t\treturn this.hidden;\n\t}\n\n\t/**\n\t * Allows to set highlight ranges that should show up for the entry label and optionally description if set.\n\t */\n\tsetHighlights(labelHighlights: IHighlight[], descriptionHighlights?: IHighlight[], detailHighlights?: IHighlight[]): void {\n\t\tthis.labelHighlights = labelHighlights;\n\t\tthis.descriptionHighlights = descriptionHighlights;\n\t\tthis.detailHighlights = detailHighlights;\n\t}\n\n\t/**\n\t * Allows to return highlight ranges that should show up for the entry label and description.\n\t */\n\tgetHighlights(): [IHighlight[] /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] {\n\t\treturn [this.labelHighlights, this.descriptionHighlights, this.detailHighlights];\n\t}\n\n\t/**\n\t * Called when the entry is selected for opening. Returns a boolean value indicating if an action was performed or not.\n\t * The mode parameter gives an indication if the element is previewed (using arrow keys) or opened.\n\t *\n\t * The context parameter provides additional context information how the run was triggered.\n\t */\n\trun(mode: Mode, context: IEntryRunContext): boolean {\n\t\treturn false;\n\t}\n}\n\nexport class QuickOpenEntryGroup extends QuickOpenEntry {\n\tprivate entry?: QuickOpenEntry;\n\tprivate groupLabel?: string;\n\tprivate withBorder?: boolean;\n\n\tconstructor(entry?: QuickOpenEntry, groupLabel?: string, withBorder?: boolean) {\n\t\tsuper();\n\n\t\tthis.entry = entry;\n\t\tthis.groupLabel = groupLabel;\n\t\tthis.withBorder = withBorder;\n\t}\n\n\t/**\n\t * The label of the group or null if none.\n\t */\n\tgetGroupLabel(): string | undefined {\n\t\treturn this.groupLabel;\n\t}\n\n\tsetGroupLabel(groupLabel: string | undefined): void {\n\t\tthis.groupLabel = groupLabel;\n\t}\n\n\t/**\n\t * Whether to show a border on top of the group entry or not.\n\t */\n\tshowBorder(): boolean {\n\t\treturn !!this.withBorder;\n\t}\n\n\tsetShowBorder(showBorder: boolean): void {\n\t\tthis.withBorder = showBorder;\n\t}\n\n\tgetLabel(): string | null {\n\t\treturn this.entry ? this.entry.getLabel() : super.getLabel();\n\t}\n\n\tgetLabelOptions(): IIconLabelValueOptions | null {\n\t\treturn this.entry ? this.entry.getLabelOptions() : super.getLabelOptions();\n\t}\n\n\tgetAriaLabel(): string {\n\t\treturn this.entry ? this.entry.getAriaLabel() : super.getAriaLabel();\n\t}\n\n\tgetDetail(): string | null {\n\t\treturn this.entry ? this.entry.getDetail() : super.getDetail();\n\t}\n\n\tgetIcon(): string | null {\n\t\treturn this.entry ? this.entry.getIcon() : super.getIcon();\n\t}\n\n\tgetDescription(): string | null {\n\t\treturn this.entry ? this.entry.getDescription() : super.getDescription();\n\t}\n\n\tgetHighlights(): [IHighlight[], IHighlight[] | undefined, IHighlight[] | undefined] {\n\t\treturn this.entry ? this.entry.getHighlights() : super.getHighlights();\n\t}\n\n\tisHidden(): boolean {\n\t\treturn this.entry ? this.entry.isHidden() : super.isHidden();\n\t}\n\n\tsetHighlights(labelHighlights: IHighlight[], descriptionHighlights?: IHighlight[], detailHighlights?: IHighlight[]): void {\n\t\tthis.entry ? this.entry.setHighlights(labelHighlights, descriptionHighlights, detailHighlights) : super.setHighlights(labelHighlights, descriptionHighlights, detailHighlights);\n\t}\n\n\trun(mode: Mode, context: IEntryRunContext): boolean {\n\t\treturn this.entry ? this.entry.run(mode, context) : super.run(mode, context);\n\t}\n}\n\nclass NoActionProvider implements IActionProvider {\n\n\thasActions(tree: ITree, element: any): boolean {\n\t\treturn false;\n\t}\n\n\tgetActions(tree: ITree, element: any): IAction[] | null {\n\t\treturn null;\n\t}\n}\n\nexport interface IQuickOpenEntryTemplateData {\n\tcontainer: HTMLElement;\n\tentry: HTMLElement;\n\ticon: HTMLSpanElement;\n\tlabel: IconLabel;\n\tdetail: HighlightedLabel;\n\tkeybinding: KeybindingLabel;\n\tactionBar: ActionBar;\n}\n\nexport interface IQuickOpenEntryGroupTemplateData extends IQuickOpenEntryTemplateData {\n\tgroup?: HTMLDivElement;\n}\n\nconst templateEntry = 'quickOpenEntry';\nconst templateEntryGroup = 'quickOpenEntryGroup';\n\nclass Renderer implements IRenderer<QuickOpenEntry> {\n\n\tprivate actionProvider: IActionProvider;\n\tprivate actionRunner?: IActionRunner;\n\n\tconstructor(actionProvider: IActionProvider = new NoActionProvider(), actionRunner?: IActionRunner) {\n\t\tthis.actionProvider = actionProvider;\n\t\tthis.actionRunner = actionRunner;\n\t}\n\n\tgetHeight(entry: QuickOpenEntry): number {\n\t\tif (entry.getDetail()) {\n\t\t\treturn 44;\n\t\t}\n\n\t\treturn 22;\n\t}\n\n\tgetTemplateId(entry: QuickOpenEntry): string {\n\t\tif (entry instanceof QuickOpenEntryGroup) {\n\t\t\treturn templateEntryGroup;\n\t\t}\n\n\t\treturn templateEntry;\n\t}\n\n\trenderTemplate(templateId: string, container: HTMLElement, styles: IQuickOpenStyles): IQuickOpenEntryGroupTemplateData {\n\t\tconst entryContainer = document.createElement('div');\n\t\tDOM.addClass(entryContainer, 'sub-content');\n\t\tcontainer.appendChild(entryContainer);\n\n\t\t// Entry\n\t\tconst row1 = DOM.$('.quick-open-row');\n\t\tconst row2 = DOM.$('.quick-open-row');\n\t\tconst entry = DOM.$('.quick-open-entry', undefined, row1, row2);\n\t\tentryContainer.appendChild(entry);\n\n\t\t// Icon\n\t\tconst icon = document.createElement('span');\n\t\trow1.appendChild(icon);\n\n\t\t// Label\n\t\tconst label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true });\n\n\t\t// Keybinding\n\t\tconst keybindingContainer = document.createElement('span');\n\t\trow1.appendChild(keybindingContainer);\n\t\tDOM.addClass(keybindingContainer, 'quick-open-entry-keybinding');\n\t\tconst keybinding = new KeybindingLabel(keybindingContainer, OS);\n\n\t\t// Detail\n\t\tconst detailContainer = document.createElement('div');\n\t\trow2.appendChild(detailContainer);\n\t\tDOM.addClass(detailContainer, 'quick-open-entry-meta');\n\t\tconst detail = new HighlightedLabel(detailContainer, true);\n\n\t\t// Entry Group\n\t\tlet group: HTMLDivElement | undefined;\n\t\tif (templateId === templateEntryGroup) {\n\t\t\tgroup = document.createElement('div');\n\t\t\tDOM.addClass(group, 'results-group');\n\t\t\tcontainer.appendChild(group);\n\t\t}\n\n\t\t// Actions\n\t\tDOM.addClass(container, 'actions');\n\n\t\tconst actionBarContainer = document.createElement('div');\n\t\tDOM.addClass(actionBarContainer, 'primary-action-bar');\n\t\tcontainer.appendChild(actionBarContainer);\n\n\t\tconst actionBar = new ActionBar(actionBarContainer, {\n\t\t\tactionRunner: this.actionRunner\n\t\t});\n\n\t\treturn {\n\t\t\tcontainer,\n\t\t\tentry,\n\t\t\ticon,\n\t\t\tlabel,\n\t\t\tdetail,\n\t\t\tkeybinding,\n\t\t\tgroup,\n\t\t\tactionBar\n\t\t};\n\t}\n\n\trenderElement(entry: QuickOpenEntry, templateId: string, data: IQuickOpenEntryGroupTemplateData, styles: IQuickOpenStyles): void {\n\n\t\t// Action Bar\n\t\tif (this.actionProvider.hasActions(null, entry)) {\n\t\t\tDOM.addClass(data.container, 'has-actions');\n\t\t} else {\n\t\t\tDOM.removeClass(data.container, 'has-actions');\n\t\t}\n\n\t\tdata.actionBar.context = entry; // make sure the context is the current element\n\n\t\tconst actions = this.actionProvider.getActions(null, entry);\n\t\tif (data.actionBar.isEmpty() && actions && actions.length > 0) {\n\t\t\tdata.actionBar.push(actions, { icon: true, label: false });\n\t\t} else if (!data.actionBar.isEmpty() && (!actions || actions.length === 0)) {\n\t\t\tdata.actionBar.clear();\n\t\t}\n\n\t\t// Entry group class\n\t\tif (entry instanceof QuickOpenEntryGroup && entry.getGroupLabel()) {\n\t\t\tDOM.addClass(data.container, 'has-group-label');\n\t\t} else {\n\t\t\tDOM.removeClass(data.container, 'has-group-label');\n\t\t}\n\n\t\t// Entry group\n\t\tif (entry instanceof QuickOpenEntryGroup) {\n\t\t\tconst group = <QuickOpenEntryGroup>entry;\n\t\t\tconst groupData = data;\n\n\t\t\t// Border\n\t\t\tif (group.showBorder()) {\n\t\t\t\tDOM.addClass(groupData.container, 'results-group-separator');\n\t\t\t\tif (styles.pickerGroupBorder) {\n\t\t\t\t\tgroupData.container.style.borderTopColor = styles.pickerGroupBorder.toString();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tDOM.removeClass(groupData.container, 'results-group-separator');\n\t\t\t\tgroupData.container.style.borderTopColor = null;\n\t\t\t}\n\n\t\t\t// Group Label\n\t\t\tconst groupLabel = group.getGroupLabel() || '';\n\t\t\tif (groupData.group) {\n\t\t\t\tgroupData.group.textContent = groupLabel;\n\t\t\t\tif (styles.pickerGroupForeground) {\n\t\t\t\t\tgroupData.group.style.color = styles.pickerGroupForeground.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Normal Entry\n\t\tif (entry instanceof QuickOpenEntry) {\n\t\t\tconst [labelHighlights, descriptionHighlights, detailHighlights] = entry.getHighlights();\n\n\t\t\t// Icon\n\t\t\tconst iconClass = entry.getIcon() ? ('quick-open-entry-icon ' + entry.getIcon()) : '';\n\t\t\tdata.icon.className = iconClass;\n\n\t\t\t// Label\n\t\t\tconst options: IIconLabelValueOptions = entry.getLabelOptions() || Object.create(null);\n\t\t\toptions.matches = labelHighlights || [];\n\t\t\toptions.title = types.withNullAsUndefined(entry.getTooltip());\n\t\t\toptions.descriptionTitle = entry.getDescriptionTooltip() || types.withNullAsUndefined(entry.getDescription()); // tooltip over description because it could overflow\n\t\t\toptions.descriptionMatches = descriptionHighlights || [];\n\t\t\tdata.label.setLabel(types.withNullAsUndefined(entry.getLabel()), types.withNullAsUndefined(entry.getDescription()), options);\n\n\t\t\t// Meta\n\t\t\tdata.detail.set(types.withNullAsUndefined(entry.getDetail()), detailHighlights);\n\n\t\t\t// Keybinding\n\t\t\tdata.keybinding.set(entry.getKeybinding()!);\n\t\t}\n\t}\n\n\tdisposeTemplate(templateId: string, templateData: IQuickOpenEntryGroupTemplateData): void {\n\t\ttemplateData.actionBar.dispose();\n\t\ttemplateData.actionBar = null!;\n\t\ttemplateData.container = null!;\n\t\ttemplateData.entry = null!;\n\t\ttemplateData.keybinding = null!;\n\t\ttemplateData.detail = null!;\n\t\ttemplateData.group = null!;\n\t\ttemplateData.icon = null!;\n\t\ttemplateData.label.dispose();\n\t\ttemplateData.label = null!;\n\t}\n}\n\nexport class QuickOpenModel implements\n\tIModel<QuickOpenEntry>,\n\tIDataSource<QuickOpenEntry>,\n\tIFilter<QuickOpenEntry>,\n\tIRunner<QuickOpenEntry>,\n\tIAccessiblityProvider<QuickOpenEntry>\n{\n\tprivate _entries: QuickOpenEntry[];\n\tprivate _dataSource: IDataSource<QuickOpenEntry>;\n\tprivate _renderer: IRenderer<QuickOpenEntry>;\n\tprivate _filter: IFilter<QuickOpenEntry>;\n\tprivate _runner: IRunner<QuickOpenEntry>;\n\tprivate _accessibilityProvider: IAccessiblityProvider<QuickOpenEntry>;\n\n\tconstructor(entries: QuickOpenEntry[] = [], actionProvider: IActionProvider = new NoActionProvider()) {\n\t\tthis._entries = entries;\n\t\tthis._dataSource = this;\n\t\tthis._renderer = new Renderer(actionProvider);\n\t\tthis._filter = this;\n\t\tthis._runner = this;\n\t\tthis._accessibilityProvider = this;\n\t}\n\n\tget entries() { return this._entries; }\n\tget dataSource() { return this._dataSource; }\n\tget renderer() { return this._renderer; }\n\tget filter() { return this._filter; }\n\tget runner() { return this._runner; }\n\tget accessibilityProvider() { return this._accessibilityProvider; }\n\n\tset entries(entries: QuickOpenEntry[]) {\n\t\tthis._entries = entries;\n\t}\n\n\tgetId(entry: QuickOpenEntry): string {\n\t\treturn entry.getId();\n\t}\n\n\tgetLabel(entry: QuickOpenEntry): string | null {\n\t\treturn entry.getLabel();\n\t}\n\n\tgetAriaLabel(entry: QuickOpenEntry): string {\n\t\tconst ariaLabel = entry.getAriaLabel();\n\t\tif (ariaLabel) {\n\t\t\treturn nls.localize('quickOpenAriaLabelEntry', \"{0}, picker\", entry.getAriaLabel());\n\t\t}\n\n\t\treturn nls.localize('quickOpenAriaLabel', \"picker\");\n\t}\n\n\tisVisible(entry: QuickOpenEntry): boolean {\n\t\treturn !entry.isHidden();\n\t}\n\n\trun(entry: QuickOpenEntry, mode: Mode, context: IEntryRunContext): boolean {\n\t\treturn entry.run(mode, 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 'vs/css!./quickopen';\nimport * as nls from 'vs/nls';\nimport * as platform from 'vs/base/common/platform';\nimport * as types from 'vs/base/common/types';\nimport { IQuickNavigateConfiguration, IAutoFocus, IEntryRunContext, IModel, Mode, IKeyMods } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { Filter, Renderer, DataSource, IModelProvider, AccessibilityProvider } from 'vs/base/parts/quickopen/browser/quickOpenViewer';\nimport { ITree, ContextMenuEvent, ITreeStyles, ITreeOptions, ITreeConfiguration } from 'vs/base/parts/tree/browser/tree';\nimport { InputBox, IInputBoxStyles, IRange } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { Tree } from 'vs/base/parts/tree/browser/treeImpl';\nimport { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';\nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { DefaultController, ClickBehavior } from 'vs/base/parts/tree/browser/treeDefaults';\nimport * as DOM from 'vs/base/browser/dom';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\n\nexport interface IQuickOpenCallbacks {\n\tonOk: () => void;\n\tonCancel: () => void;\n\tonType: (value: string) => void;\n\tonShow?: () => void;\n\tonHide?: (reason: HideReason) => void;\n\tonFocusLost?: () => boolean /* veto close */;\n}\n\nexport interface IQuickOpenOptions extends IQuickOpenStyles {\n\tminItemsToShow?: number;\n\tmaxItemsToShow?: number;\n\tinputPlaceHolder?: string;\n\tinputAriaLabel?: string;\n\tkeyboardSupport?: boolean;\n\ttreeCreator?: (container: HTMLElement, configuration: ITreeConfiguration, options?: ITreeOptions) => ITree;\n}\n\nexport interface IQuickOpenStyles extends IInputBoxStyles, ITreeStyles {\n\tbackground?: Color;\n\tforeground?: Color;\n\tborderColor?: Color;\n\tpickerGroupForeground?: Color;\n\tpickerGroupBorder?: Color;\n\twidgetShadow?: Color;\n\tprogressBarBackground?: Color;\n}\n\nexport interface IShowOptions {\n\tquickNavigateConfiguration?: IQuickNavigateConfiguration;\n\tautoFocus?: IAutoFocus;\n\tinputSelection?: IRange;\n\tvalue?: string;\n}\n\nexport class QuickOpenController extends DefaultController {\n\n\tonContextMenu(tree: ITree, element: any, event: ContextMenuEvent): boolean {\n\t\tif (platform.isMacintosh) {\n\t\t\treturn this.onLeftClick(tree, element, event); // https://github.com/Microsoft/vscode/issues/1011\n\t\t}\n\n\t\treturn super.onContextMenu(tree, element, event);\n\t}\n}\n\nexport const enum HideReason {\n\tELEMENT_SELECTED,\n\tFOCUS_LOST,\n\tCANCELED\n}\n\nconst defaultStyles = {\n\tbackground: Color.fromHex('#1E1E1E'),\n\tforeground: Color.fromHex('#CCCCCC'),\n\tpickerGroupForeground: Color.fromHex('#0097FB'),\n\tpickerGroupBorder: Color.fromHex('#3F3F46'),\n\twidgetShadow: Color.fromHex('#000000'),\n\tprogressBarBackground: Color.fromHex('#0E70C0')\n};\n\nconst DEFAULT_INPUT_ARIA_LABEL = nls.localize('quickOpenAriaLabel', \"Quick picker. Type to narrow down results.\");\n\nexport class QuickOpenWidget extends Disposable implements IModelProvider {\n\n\tprivate static readonly MAX_WIDTH = 600;\t\t\t// Max total width of quick open widget\n\tprivate static readonly MAX_ITEMS_HEIGHT = 20 * 22;\t// Max height of item list below input field\n\n\tprivate isDisposed: boolean;\n\tprivate options: IQuickOpenOptions;\n\tprivate element: HTMLElement;\n\tprivate tree: ITree;\n\tprivate inputBox: InputBox;\n\tprivate inputContainer: HTMLElement;\n\tprivate helpText: HTMLElement;\n\tprivate resultCount: HTMLElement;\n\tprivate treeContainer: HTMLElement;\n\tprivate progressBar: ProgressBar;\n\tprivate visible: boolean;\n\tprivate isLoosingFocus: boolean;\n\tprivate callbacks: IQuickOpenCallbacks;\n\tprivate quickNavigateConfiguration: IQuickNavigateConfiguration | undefined;\n\tprivate container: HTMLElement;\n\tprivate treeElement: HTMLElement;\n\tprivate inputElement: HTMLElement;\n\tprivate layoutDimensions: DOM.Dimension;\n\tprivate model: IModel<any> | null;\n\tprivate inputChangingTimeoutHandle: any;\n\tprivate styles: IQuickOpenStyles;\n\tprivate renderer: Renderer;\n\n\tconstructor(container: HTMLElement, callbacks: IQuickOpenCallbacks, options: IQuickOpenOptions) {\n\t\tsuper();\n\n\t\tthis.isDisposed = false;\n\t\tthis.container = container;\n\t\tthis.callbacks = callbacks;\n\t\tthis.options = options;\n\t\tthis.styles = options || Object.create(null);\n\t\tmixin(this.styles, defaultStyles, false);\n\t\tthis.model = null;\n\t}\n\n\tgetModel(): IModel<any> {\n\t\treturn this.model!;\n\t}\n\n\tcreate(): HTMLElement {\n\n\t\t// Container\n\t\tthis.element = document.createElement('div');\n\t\tDOM.addClass(this.element, 'monaco-quick-open-widget');\n\t\tthis.container.appendChild(this.element);\n\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.CONTEXT_MENU, e => DOM.EventHelper.stop(e, true))); // Do this to fix an issue on Mac where the menu goes into the way\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.FOCUS, e => this.gainingFocus(), true));\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.BLUR, e => this.loosingFocus(e), true));\n\t\tthis._register(DOM.addDisposableListener(this.element, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);\n\t\t\tif (keyboardEvent.keyCode === KeyCode.Escape) {\n\t\t\t\tDOM.EventHelper.stop(e, true);\n\n\t\t\t\tthis.hide(HideReason.CANCELED);\n\t\t\t} else if (keyboardEvent.keyCode === KeyCode.Tab && !keyboardEvent.altKey && !keyboardEvent.ctrlKey && !keyboardEvent.metaKey) {\n\t\t\t\tconst stops = (e.currentTarget as HTMLElement).querySelectorAll('input, .monaco-tree, .monaco-tree-row.focused .action-label.icon') as NodeListOf<HTMLElement>;\n\t\t\t\tif (keyboardEvent.shiftKey && keyboardEvent.target === stops[0]) {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t\tstops[stops.length - 1].focus();\n\t\t\t\t} else if (!keyboardEvent.shiftKey && keyboardEvent.target === stops[stops.length - 1]) {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t\tstops[0].focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// Progress Bar\n\t\tthis.progressBar = this._register(new ProgressBar(this.element, { progressBarBackground: this.styles.progressBarBackground }));\n\t\tthis.progressBar.hide();\n\n\t\t// Input Field\n\t\tthis.inputContainer = document.createElement('div');\n\t\tDOM.addClass(this.inputContainer, 'quick-open-input');\n\t\tthis.element.appendChild(this.inputContainer);\n\n\t\tthis.inputBox = this._register(new InputBox(this.inputContainer, undefined, {\n\t\t\tplaceholder: this.options.inputPlaceHolder || '',\n\t\t\tariaLabel: DEFAULT_INPUT_ARIA_LABEL,\n\t\t\tinputBackground: this.styles.inputBackground,\n\t\t\tinputForeground: this.styles.inputForeground,\n\t\t\tinputBorder: this.styles.inputBorder,\n\t\t\tinputValidationInfoBackground: this.styles.inputValidationInfoBackground,\n\t\t\tinputValidationInfoForeground: this.styles.inputValidationInfoForeground,\n\t\t\tinputValidationInfoBorder: this.styles.inputValidationInfoBorder,\n\t\t\tinputValidationWarningBackground: this.styles.inputValidationWarningBackground,\n\t\t\tinputValidationWarningForeground: this.styles.inputValidationWarningForeground,\n\t\t\tinputValidationWarningBorder: this.styles.inputValidationWarningBorder,\n\t\t\tinputValidationErrorBackground: this.styles.inputValidationErrorBackground,\n\t\t\tinputValidationErrorForeground: this.styles.inputValidationErrorForeground,\n\t\t\tinputValidationErrorBorder: this.styles.inputValidationErrorBorder\n\t\t}));\n\n\t\tthis.inputElement = this.inputBox.inputElement;\n\t\tthis.inputElement.setAttribute('role', 'combobox');\n\t\tthis.inputElement.setAttribute('aria-haspopup', 'false');\n\t\tthis.inputElement.setAttribute('aria-autocomplete', 'list');\n\n\t\tthis._register(DOM.addDisposableListener(this.inputBox.inputElement, DOM.EventType.INPUT, (e: Event) => this.onType()));\n\t\tthis._register(DOM.addDisposableListener(this.inputBox.inputElement, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\tconst keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);\n\t\t\tconst shouldOpenInBackground = this.shouldOpenInBackground(keyboardEvent);\n\n\t\t\t// Do not handle Tab: It is used to navigate between elements without mouse\n\t\t\tif (keyboardEvent.keyCode === KeyCode.Tab) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Pass tree navigation keys to the tree but leave focus in input field\n\t\t\telse if (keyboardEvent.keyCode === KeyCode.DownArrow || keyboardEvent.keyCode === KeyCode.UpArrow || keyboardEvent.keyCode === KeyCode.PageDown || keyboardEvent.keyCode === KeyCode.PageUp) {\n\t\t\t\tDOM.EventHelper.stop(e, true);\n\n\t\t\t\tthis.navigateInTree(keyboardEvent.keyCode, keyboardEvent.shiftKey);\n\n\t\t\t\t// Position cursor at the end of input to allow right arrow (open in background)\n\t\t\t\t// to function immediately unless the user has made a selection\n\t\t\t\tif (this.inputBox.inputElement.selectionStart === this.inputBox.inputElement.selectionEnd) {\n\t\t\t\t\tthis.inputBox.inputElement.selectionStart = this.inputBox.value.length;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select element on Enter or on Arrow-Right if we are at the end of the input\n\t\t\telse if (keyboardEvent.keyCode === KeyCode.Enter || shouldOpenInBackground) {\n\t\t\t\tDOM.EventHelper.stop(e, true);\n\n\t\t\t\tconst focus = this.tree.getFocus();\n\t\t\t\tif (focus) {\n\t\t\t\t\tthis.elementSelected(focus, e, shouldOpenInBackground ? Mode.OPEN_IN_BACKGROUND : Mode.OPEN);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// Result count for screen readers\n\t\tthis.resultCount = document.createElement('div');\n\t\tDOM.addClass(this.resultCount, 'quick-open-result-count');\n\t\tthis.resultCount.setAttribute('aria-live', 'polite');\n\t\tthis.resultCount.setAttribute('aria-atomic', 'true');\n\t\tthis.element.appendChild(this.resultCount);\n\n\t\t// Tree\n\t\tthis.treeContainer = document.createElement('div');\n\t\tDOM.addClass(this.treeContainer, 'quick-open-tree');\n\t\tthis.element.appendChild(this.treeContainer);\n\n\t\tconst createTree = this.options.treeCreator || ((container, config, opts) => new Tree(container, config, opts));\n\n\t\tthis.tree = this._register(createTree(this.treeContainer, {\n\t\t\tdataSource: new DataSource(this),\n\t\t\tcontroller: new QuickOpenController({ clickBehavior: ClickBehavior.ON_MOUSE_UP, keyboardSupport: this.options.keyboardSupport }),\n\t\t\trenderer: (this.renderer = new Renderer(this, this.styles)),\n\t\t\tfilter: new Filter(this),\n\t\t\taccessibilityProvider: new AccessibilityProvider(this)\n\t\t}, {\n\t\t\t\ttwistiePixels: 11,\n\t\t\t\tindentPixels: 0,\n\t\t\t\talwaysFocused: true,\n\t\t\t\tverticalScrollMode: ScrollbarVisibility.Visible,\n\t\t\t\thorizontalScrollMode: ScrollbarVisibility.Hidden,\n\t\t\t\tariaLabel: nls.localize('treeAriaLabel', \"Quick Picker\"),\n\t\t\t\tkeyboardSupport: this.options.keyboardSupport,\n\t\t\t\tpreventRootFocus: false\n\t\t\t}));\n\n\t\tthis.treeElement = this.tree.getHTMLElement();\n\n\t\t// Handle Focus and Selection event\n\t\tthis._register(this.tree.onDidChangeFocus(event => {\n\t\t\tthis.elementFocused(event.focus, event);\n\t\t}));\n\n\t\tthis._register(this.tree.onDidChangeSelection(event => {\n\t\t\tif (event.selection && event.selection.length > 0) {\n\t\t\t\tconst mouseEvent: StandardMouseEvent = event.payload && event.payload.originalEvent instanceof StandardMouseEvent ? event.payload.originalEvent : undefined;\n\t\t\t\tconst shouldOpenInBackground = mouseEvent ? this.shouldOpenInBackground(mouseEvent) : false;\n\n\t\t\t\tthis.elementSelected(event.selection[0], event, shouldOpenInBackground ? Mode.OPEN_IN_BACKGROUND : Mode.OPEN);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.treeContainer, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);\n\n\t\t\t// Only handle when in quick navigation mode\n\t\t\tif (!this.quickNavigateConfiguration) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Support keyboard navigation in quick navigation mode\n\t\t\tif (keyboardEvent.keyCode === KeyCode.DownArrow || keyboardEvent.keyCode === KeyCode.UpArrow || keyboardEvent.keyCode === KeyCode.PageDown || keyboardEvent.keyCode === KeyCode.PageUp) {\n\t\t\t\tDOM.EventHelper.stop(e, true);\n\n\t\t\t\tthis.navigateInTree(keyboardEvent.keyCode);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.treeContainer, DOM.EventType.KEY_UP, e => {\n\t\t\tconst keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);\n\t\t\tconst keyCode = keyboardEvent.keyCode;\n\n\t\t\t// Only handle when in quick navigation mode\n\t\t\tif (!this.quickNavigateConfiguration) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Select element when keys are pressed that signal it\n\t\t\tconst quickNavKeys = this.quickNavigateConfiguration.keybindings;\n\t\t\tconst wasTriggerKeyPressed = keyCode === KeyCode.Enter || 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 open\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\tconst focus = this.tree.getFocus();\n\t\t\t\tif (focus) {\n\t\t\t\t\tthis.elementSelected(focus, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// Support layout\n\t\tif (this.layoutDimensions) {\n\t\t\tthis.layout(this.layoutDimensions);\n\t\t}\n\n\t\tthis.applyStyles();\n\n\t\t// Allows focus to switch to next/previous entry after tab into an actionbar item\n\t\tthis._register(DOM.addDisposableListener(this.treeContainer, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\tconst keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);\n\t\t\t// Only handle when not in quick navigation mode\n\t\t\tif (this.quickNavigateConfiguration) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (keyboardEvent.keyCode === KeyCode.DownArrow || keyboardEvent.keyCode === KeyCode.UpArrow || keyboardEvent.keyCode === KeyCode.PageDown || keyboardEvent.keyCode === KeyCode.PageUp) {\n\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\tthis.navigateInTree(keyboardEvent.keyCode, keyboardEvent.shiftKey);\n\t\t\t\tthis.treeElement.focus();\n\t\t\t}\n\t\t}));\n\n\t\treturn this.element;\n\t}\n\n\tstyle(styles: IQuickOpenStyles): void {\n\t\tthis.styles = styles;\n\n\t\tthis.applyStyles();\n\t}\n\n\tprotected applyStyles(): void {\n\t\tif (this.element) {\n\t\t\tconst foreground = this.styles.foreground ? this.styles.foreground.toString() : null;\n\t\t\tconst background = this.styles.background ? this.styles.background.toString() : null;\n\t\t\tconst borderColor = this.styles.borderColor ? this.styles.borderColor.toString() : null;\n\t\t\tconst widgetShadow = this.styles.widgetShadow ? this.styles.widgetShadow.toString() : null;\n\n\t\t\tthis.element.style.color = foreground;\n\t\t\tthis.element.style.backgroundColor = background;\n\t\t\tthis.element.style.borderColor = borderColor;\n\t\t\tthis.element.style.borderWidth = borderColor ? '1px' : null;\n\t\t\tthis.element.style.borderStyle = borderColor ? 'solid' : null;\n\t\t\tthis.element.style.boxShadow = widgetShadow ? `0 5px 8px ${widgetShadow}` : null;\n\t\t}\n\n\t\tif (this.progressBar) {\n\t\t\tthis.progressBar.style({\n\t\t\t\tprogressBarBackground: this.styles.progressBarBackground\n\t\t\t});\n\t\t}\n\n\t\tif (this.inputBox) {\n\t\t\tthis.inputBox.style({\n\t\t\t\tinputBackground: this.styles.inputBackground,\n\t\t\t\tinputForeground: this.styles.inputForeground,\n\t\t\t\tinputBorder: this.styles.inputBorder,\n\t\t\t\tinputValidationInfoBackground: this.styles.inputValidationInfoBackground,\n\t\t\t\tinputValidationInfoForeground: this.styles.inputValidationInfoForeground,\n\t\t\t\tinputValidationInfoBorder: this.styles.inputValidationInfoBorder,\n\t\t\t\tinputValidationWarningBackground: this.styles.inputValidationWarningBackground,\n\t\t\t\tinputValidationWarningForeground: this.styles.inputValidationWarningForeground,\n\t\t\t\tinputValidationWarningBorder: this.styles.inputValidationWarningBorder,\n\t\t\t\tinputValidationErrorBackground: this.styles.inputValidationErrorBackground,\n\t\t\t\tinputValidationErrorForeground: this.styles.inputValidationErrorForeground,\n\t\t\t\tinputValidationErrorBorder: this.styles.inputValidationErrorBorder\n\t\t\t});\n\t\t}\n\n\t\tif (this.tree && !this.options.treeCreator) {\n\t\t\tthis.tree.style(this.styles);\n\t\t}\n\n\t\tif (this.renderer) {\n\t\t\tthis.renderer.updateStyles(this.styles);\n\t\t}\n\t}\n\n\tprivate shouldOpenInBackground(e: StandardKeyboardEvent | StandardMouseEvent): boolean {\n\n\t\t// Keyboard\n\t\tif (e instanceof StandardKeyboardEvent) {\n\t\t\tif (e.keyCode !== KeyCode.RightArrow) {\n\t\t\t\treturn false; // only for right arrow\n\t\t\t}\n\n\t\t\tif (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {\n\t\t\t\treturn false; // no modifiers allowed\n\t\t\t}\n\n\t\t\t// validate the cursor is at the end of the input and there is no selection,\n\t\t\t// and if not prevent opening in the background such as the selection can be changed\n\t\t\tconst element = this.inputBox.inputElement;\n\t\t\treturn element.selectionEnd === this.inputBox.value.length && element.selectionStart === element.selectionEnd;\n\t\t}\n\n\t\t// Mouse\n\t\treturn e.middleButton;\n\t}\n\n\tprivate onType(): void {\n\t\tconst value = this.inputBox.value;\n\n\t\t// Adjust help text as needed if present\n\t\tif (this.helpText) {\n\t\t\tif (value) {\n\t\t\t\tDOM.hide(this.helpText);\n\t\t\t} else {\n\t\t\t\tDOM.show(this.helpText);\n\t\t\t}\n\t\t}\n\n\t\t// Send to callbacks\n\t\tthis.callbacks.onType(value);\n\t}\n\n\tprivate navigateInTree(keyCode: KeyCode, isShift?: boolean): void {\n\t\tconst model: IModel<any> = this.tree.getInput();\n\t\tconst entries = model ? model.entries : [];\n\t\tconst oldFocus = this.tree.getFocus();\n\n\t\t// Normal Navigation\n\t\tswitch (keyCode) {\n\t\t\tcase KeyCode.DownArrow:\n\t\t\t\tthis.tree.focusNext();\n\t\t\t\tbreak;\n\n\t\t\tcase KeyCode.UpArrow:\n\t\t\t\tthis.tree.focusPrevious();\n\t\t\t\tbreak;\n\n\t\t\tcase KeyCode.PageDown:\n\t\t\t\tthis.tree.focusNextPage();\n\t\t\t\tbreak;\n\n\t\t\tcase KeyCode.PageUp:\n\t\t\t\tthis.tree.focusPreviousPage();\n\t\t\t\tbreak;\n\n\t\t\tcase KeyCode.Tab:\n\t\t\t\tif (isShift) {\n\t\t\t\t\tthis.tree.focusPrevious();\n\t\t\t\t} else {\n\t\t\t\t\tthis.tree.focusNext();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tlet newFocus = this.tree.getFocus();\n\n\t\t// Support cycle-through navigation if focus did not change\n\t\tif (entries.length > 1 && oldFocus === newFocus) {\n\n\t\t\t// Up from no entry or first entry goes down to last\n\t\t\tif (keyCode === KeyCode.UpArrow || (keyCode === KeyCode.Tab && isShift)) {\n\t\t\t\tthis.tree.focusLast();\n\t\t\t}\n\n\t\t\t// Down from last entry goes to up to first\n\t\t\telse if (keyCode === KeyCode.DownArrow || keyCode === KeyCode.Tab && !isShift) {\n\t\t\t\tthis.tree.focusFirst();\n\t\t\t}\n\t\t}\n\n\t\t// Reveal\n\t\tnewFocus = this.tree.getFocus();\n\t\tif (newFocus) {\n\t\t\tthis.tree.reveal(newFocus);\n\t\t}\n\t}\n\n\tprivate elementFocused(value: any, event?: any): void {\n\t\tif (!value || !this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// ARIA\n\t\tconst arivaActiveDescendant = this.treeElement.getAttribute('aria-activedescendant');\n\t\tif (arivaActiveDescendant) {\n\t\t\tthis.inputElement.setAttribute('aria-activedescendant', arivaActiveDescendant);\n\t\t} else {\n\t\t\tthis.inputElement.removeAttribute('aria-activedescendant');\n\t\t}\n\n\t\tconst context: IEntryRunContext = { event: event, keymods: this.extractKeyMods(event), quickNavigateConfiguration: this.quickNavigateConfiguration };\n\t\tthis.model!.runner.run(value, Mode.PREVIEW, context);\n\t}\n\n\tprivate elementSelected(value: any, event?: any, preferredMode?: Mode): void {\n\t\tlet hide = true;\n\n\t\t// Trigger open of element on selection\n\t\tif (this.isVisible()) {\n\t\t\tlet mode = preferredMode || Mode.OPEN;\n\n\t\t\tconst context: IEntryRunContext = { event, keymods: this.extractKeyMods(event), quickNavigateConfiguration: this.quickNavigateConfiguration };\n\n\t\t\thide = this.model!.runner.run(value, mode, context);\n\t\t}\n\n\t\t// Hide if command was run successfully\n\t\tif (hide) {\n\t\t\tthis.hide(HideReason.ELEMENT_SELECTED);\n\t\t}\n\t}\n\n\tprivate extractKeyMods(event: any): IKeyMods {\n\t\treturn {\n\t\t\tctrlCmd: event && (event.ctrlKey || event.metaKey || (event.payload && event.payload.originalEvent && (event.payload.originalEvent.ctrlKey || event.payload.originalEvent.metaKey))),\n\t\t\talt: event && (event.altKey || (event.payload && event.payload.originalEvent && event.payload.originalEvent.altKey))\n\t\t};\n\t}\n\n\tshow(prefix: string, options?: IShowOptions): void;\n\tshow(input: IModel<any>, options?: IShowOptions): void;\n\tshow(param: any, options?: IShowOptions): void {\n\t\tthis.visible = true;\n\t\tthis.isLoosingFocus = false;\n\t\tthis.quickNavigateConfiguration = options ? options.quickNavigateConfiguration : undefined;\n\n\t\t// Adjust UI for quick navigate mode\n\t\tif (this.quickNavigateConfiguration) {\n\t\t\tDOM.hide(this.inputContainer);\n\t\t\tDOM.show(this.element);\n\t\t\tthis.tree.domFocus();\n\t\t}\n\n\t\t// Otherwise use normal UI\n\t\telse {\n\t\t\tDOM.show(this.inputContainer);\n\t\t\tDOM.show(this.element);\n\t\t\tthis.inputBox.focus();\n\t\t}\n\n\t\t// Adjust Help text for IE\n\t\tif (this.helpText) {\n\t\t\tif (this.quickNavigateConfiguration || types.isString(param)) {\n\t\t\t\tDOM.hide(this.helpText);\n\t\t\t} else {\n\t\t\t\tDOM.show(this.helpText);\n\t\t\t}\n\t\t}\n\n\t\t// Show based on param\n\t\tif (types.isString(param)) {\n\t\t\tthis.doShowWithPrefix(param);\n\t\t} else {\n\t\t\tif (options && options.value) {\n\t\t\t\tthis.restoreLastInput(options.value);\n\t\t\t}\n\t\t\tthis.doShowWithInput(param, options && options.autoFocus ? options.autoFocus : {});\n\t\t}\n\n\t\t// Respect selectAll option\n\t\tif (options && options.inputSelection && !this.quickNavigateConfiguration) {\n\t\t\tthis.inputBox.select(options.inputSelection);\n\t\t}\n\n\t\tif (this.callbacks.onShow) {\n\t\t\tthis.callbacks.onShow();\n\t\t}\n\t}\n\n\tprivate restoreLastInput(lastInput: string) {\n\t\tthis.inputBox.value = lastInput;\n\t\tthis.inputBox.select();\n\t\tthis.callbacks.onType(lastInput);\n\t}\n\n\tprivate doShowWithPrefix(prefix: string): void {\n\t\tthis.inputBox.value = prefix;\n\t\tthis.callbacks.onType(prefix);\n\t}\n\n\tprivate doShowWithInput(input: IModel<any>, autoFocus: IAutoFocus): void {\n\t\tthis.setInput(input, autoFocus);\n\t}\n\n\tprivate setInputAndLayout(input: IModel<any>, autoFocus?: IAutoFocus): void {\n\t\tthis.treeContainer.style.height = `${this.getHeight(input)}px`;\n\n\t\tthis.tree.setInput(null).then(() => {\n\t\t\tthis.model = input;\n\n\t\t\t// ARIA\n\t\t\tthis.inputElement.setAttribute('aria-haspopup', String(input && input.entries && input.entries.length > 0));\n\n\t\t\treturn this.tree.setInput(input);\n\t\t}).then(() => {\n\n\t\t\t// Indicate entries to tree\n\t\t\tthis.tree.layout();\n\n\t\t\tconst entries = input ? input.entries.filter(e => this.isElementVisible(input, e)) : [];\n\t\t\tthis.updateResultCount(entries.length);\n\n\t\t\t// Handle auto focus\n\t\t\tif (entries.length) {\n\t\t\t\tthis.autoFocus(input, entries, autoFocus);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate isElementVisible<T>(input: IModel<T>, e: T): boolean {\n\t\tif (!input.filter) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn input.filter.isVisible(e);\n\t}\n\n\tprivate autoFocus(input: IModel<any>, entries: any[], autoFocus: IAutoFocus = {}): void {\n\n\t\t// First check for auto focus of prefix matches\n\t\tif (autoFocus.autoFocusPrefixMatch) {\n\t\t\tlet caseSensitiveMatch: any;\n\t\t\tlet caseInsensitiveMatch: any;\n\t\t\tconst prefix = autoFocus.autoFocusPrefixMatch;\n\t\t\tconst lowerCasePrefix = prefix.toLowerCase();\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst label = input.dataSource.getLabel(entry) || '';\n\n\t\t\t\tif (!caseSensitiveMatch && label.indexOf(prefix) === 0) {\n\t\t\t\t\tcaseSensitiveMatch = entry;\n\t\t\t\t} else if (!caseInsensitiveMatch && label.toLowerCase().indexOf(lowerCasePrefix) === 0) {\n\t\t\t\t\tcaseInsensitiveMatch = entry;\n\t\t\t\t}\n\n\t\t\t\tif (caseSensitiveMatch && caseInsensitiveMatch) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst entryToFocus = caseSensitiveMatch || caseInsensitiveMatch;\n\t\t\tif (entryToFocus) {\n\t\t\t\tthis.tree.setFocus(entryToFocus);\n\t\t\t\tthis.tree.reveal(entryToFocus, 0.5);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Second check for auto focus of first entry\n\t\tif (autoFocus.autoFocusFirstEntry) {\n\t\t\tthis.tree.focusFirst();\n\t\t\tthis.tree.reveal(this.tree.getFocus());\n\t\t}\n\n\t\t// Third check for specific index option\n\t\telse if (typeof autoFocus.autoFocusIndex === 'number') {\n\t\t\tif (entries.length > autoFocus.autoFocusIndex) {\n\t\t\t\tthis.tree.focusNth(autoFocus.autoFocusIndex);\n\t\t\t\tthis.tree.reveal(this.tree.getFocus());\n\t\t\t}\n\t\t}\n\n\t\t// Check for auto focus of second entry\n\t\telse if (autoFocus.autoFocusSecondEntry) {\n\t\t\tif (entries.length > 1) {\n\t\t\t\tthis.tree.focusNth(1);\n\t\t\t}\n\t\t}\n\n\t\t// Finally check for auto focus of last entry\n\t\telse if (autoFocus.autoFocusLastEntry) {\n\t\t\tif (entries.length > 1) {\n\t\t\t\tthis.tree.focusLast();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getHeight(input: IModel<any>): number {\n\t\tconst renderer = input.renderer;\n\n\t\tif (!input) {\n\t\t\tconst itemHeight = renderer.getHeight(null);\n\n\t\t\treturn this.options.minItemsToShow ? this.options.minItemsToShow * itemHeight : 0;\n\t\t}\n\n\t\tlet height = 0;\n\n\t\tlet preferredItemsHeight: number | undefined;\n\t\tif (this.layoutDimensions && this.layoutDimensions.height) {\n\t\t\tpreferredItemsHeight = (this.layoutDimensions.height - 50 /* subtract height of input field (30px) and some spacing (drop shadow) to fit */) * 0.4 /* max 40% of screen */;\n\t\t}\n\n\t\tif (!preferredItemsHeight || preferredItemsHeight > QuickOpenWidget.MAX_ITEMS_HEIGHT) {\n\t\t\tpreferredItemsHeight = QuickOpenWidget.MAX_ITEMS_HEIGHT;\n\t\t}\n\n\t\tconst entries = input.entries.filter(e => this.isElementVisible(input, e));\n\t\tconst maxEntries = this.options.maxItemsToShow || entries.length;\n\t\tfor (let i = 0; i < maxEntries && i < entries.length; i++) {\n\t\t\tconst entryHeight = renderer.getHeight(entries[i]);\n\t\t\tif (height + entryHeight <= preferredItemsHeight) {\n\t\t\t\theight += entryHeight;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn height;\n\t}\n\n\tupdateResultCount(count: number) {\n\t\tthis.resultCount.textContent = nls.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\", count);\n\t}\n\n\thide(reason?: HideReason): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.visible = false;\n\t\tDOM.hide(this.element);\n\t\tthis.element.blur();\n\n\t\t// Clear input field and clear tree\n\t\tthis.inputBox.value = '';\n\t\tthis.tree.setInput(null);\n\n\t\t// ARIA\n\t\tthis.inputElement.setAttribute('aria-haspopup', 'false');\n\n\t\t// Reset Tree Height\n\t\tthis.treeContainer.style.height = `${this.options.minItemsToShow ? this.options.minItemsToShow * 22 : 0}px`;\n\n\t\t// Clear any running Progress\n\t\tthis.progressBar.stop().hide();\n\n\t\t// Clear Focus\n\t\tif (this.tree.isDOMFocused()) {\n\t\t\tthis.tree.domBlur();\n\t\t} else if (this.inputBox.hasFocus()) {\n\t\t\tthis.inputBox.blur();\n\t\t}\n\n\t\t// Callbacks\n\t\tif (reason === HideReason.ELEMENT_SELECTED) {\n\t\t\tthis.callbacks.onOk();\n\t\t} else {\n\t\t\tthis.callbacks.onCancel();\n\t\t}\n\n\t\tif (this.callbacks.onHide) {\n\t\t\tthis.callbacks.onHide(reason!);\n\t\t}\n\t}\n\n\tsetInput(input: IModel<any>, autoFocus?: IAutoFocus, ariaLabel?: string): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the input changes, indicate this to the tree\n\t\tif (!!this.getInput()) {\n\t\t\tthis.onInputChanging();\n\t\t}\n\n\t\t// Adapt tree height to entries and apply input\n\t\tthis.setInputAndLayout(input, autoFocus);\n\n\t\t// Apply ARIA\n\t\tif (this.inputBox) {\n\t\t\tthis.inputBox.setAriaLabel(ariaLabel || DEFAULT_INPUT_ARIA_LABEL);\n\t\t}\n\t}\n\n\tprivate onInputChanging(): void {\n\t\tif (this.inputChangingTimeoutHandle) {\n\t\t\tclearTimeout(this.inputChangingTimeoutHandle);\n\t\t\tthis.inputChangingTimeoutHandle = null;\n\t\t}\n\n\t\t// when the input is changing in quick open, we indicate this as CSS class to the widget\n\t\t// for a certain timeout. this helps reducing some hectic UI updates when input changes quickly\n\t\tDOM.addClass(this.element, 'content-changing');\n\t\tthis.inputChangingTimeoutHandle = setTimeout(() => {\n\t\t\tDOM.removeClass(this.element, 'content-changing');\n\t\t}, 500);\n\t}\n\n\tgetInput(): IModel<any> {\n\t\treturn this.tree.getInput();\n\t}\n\n\tisVisible(): boolean {\n\t\treturn this.visible;\n\t}\n\n\tlayout(dimension: DOM.Dimension): void {\n\t\tthis.layoutDimensions = dimension;\n\n\t\t// Apply to quick open width (height is dynamic by number of items to show)\n\t\tconst quickOpenWidth = Math.min(this.layoutDimensions.width * 0.62 /* golden cut */, QuickOpenWidget.MAX_WIDTH);\n\t\tif (this.element) {\n\n\t\t\t// quick open\n\t\t\tthis.element.style.width = `${quickOpenWidth}px`;\n\t\t\tthis.element.style.marginLeft = `-${quickOpenWidth / 2}px`;\n\n\t\t\t// input field\n\t\t\tthis.inputContainer.style.width = `${quickOpenWidth - 12}px`;\n\t\t}\n\t}\n\n\tprivate gainingFocus(): void {\n\t\tthis.isLoosingFocus = false;\n\t}\n\n\tprivate loosingFocus(e: FocusEvent): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relatedTarget = e.relatedTarget as HTMLElement;\n\t\tif (!this.quickNavigateConfiguration && DOM.isAncestor(relatedTarget, this.element)) {\n\t\t\treturn; // user clicked somewhere into quick open widget, do not close thereby\n\t\t}\n\n\t\tthis.isLoosingFocus = true;\n\t\tsetTimeout(() => {\n\t\t\tif (!this.isLoosingFocus || this.isDisposed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst veto = this.callbacks.onFocusLost && this.callbacks.onFocusLost();\n\t\t\tif (!veto) {\n\t\t\t\tthis.hide(HideReason.FOCUS_LOST);\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tdispose(): void {\n\t\tsuper.dispose();\n\n\t\tthis.isDisposed = 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 * as nls from 'vs/nls';\nimport * as arrays from 'vs/base/common/arrays';\nimport * as objects from 'vs/base/common/objects';\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/editor/common/core/uint';\nimport { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { isObject } from 'vs/base/common/types';\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 */\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 */\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 */\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 */\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 * 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 */\n\tverticalSliderSize?: number;\n\t/**\n\t * Height in pixels for the horizontal slider.\n\t * Defaults to `horizontalScrollbarSize`.\n\t */\n\thorizontalSliderSize?: number;\n}\n\n/**\n * Configuration options for editor find widget\n */\nexport interface IEditorFindOptions {\n\t/**\n\t * Controls if we seed search string in the Find Widget with editor selection.\n\t */\n\tseedSearchStringFromSelection?: boolean;\n\t/**\n\t * Controls if Find in Selection flag is turned on when multiple lines of text are selected in the editor.\n\t */\n\tautoFindInSelection: boolean;\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}\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 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 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}\n\n/**\n * Configuration options for editor minimap\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 * 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}\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\nexport interface ISuggestOptions {\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 * Favours 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 * Max suggestions to show in suggestions. Defaults to 12.\n\t */\n\tmaxVisibleSuggestions?: boolean;\n\t/**\n\t * Names of suggestion types to filter.\n\t */\n\tfilteredTypes?: Record<string, boolean>;\n}\n\nexport interface IGotoLocationOptions {\n\t/**\n\t * Control how goto-command work when having multiple results.\n\t */\n\tmultiple?: 'peek' | 'gotoAndPeek' | 'goto';\n}\n\n/**\n * Configuration map for codeActionsOnSave\n */\nexport interface ICodeActionsOnSaveOptions {\n\t[kind: string]: boolean;\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 * @internal\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 * Render vertical lines at the specified columns.\n\t * Defaults to empty array.\n\t */\n\trulers?: number[];\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 truey, 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 true.\n\t */\n\tlineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);\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 * 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.\n\t * Defaults to false.\n\t */\n\treadOnly?: boolean;\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 2.\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?: string;\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 * @internal\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?: string;\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;\n\t/**\n\t * Disable the use of `will-change` for the editor margin and lines layers.\n\t * The usage of `will-change` 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 * 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 * Force word wrapping when the text appears to be of a minified/generated file.\n\t * Defaults to true.\n\t */\n\twordWrapMinified?: boolean;\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?: string;\n\t/**\n\t * Configure word wrapping characters. A break will be introduced before these characters.\n\t * Defaults to '{([+'.\n\t */\n\twordWrapBreakBeforeCharacters?: string;\n\t/**\n\t * Configure word wrapping characters. A break will be introduced after these characters.\n\t * Defaults to ' \\t})]?|&,;'.\n\t */\n\twordWrapBreakAfterCharacters?: string;\n\t/**\n\t * Configure word wrapping characters. A break will be introduced after these characters only if no `wordWrapBreakBeforeCharacters` or `wordWrapBreakAfterCharacters` were found.\n\t * Defaults to '.'.\n\t */\n\twordWrapBreakObtrusiveCharacters?: string;\n\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 * 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 * 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 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 * Suggest options.\n\t */\n\tsuggest?: ISuggestOptions;\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 | { other: boolean, comments: boolean, strings: boolean };\n\t/**\n\t * Quick suggestions show delay (in ms)\n\t * Defaults to 500 (ms)\n\t */\n\tquickSuggestionsDelay?: number;\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 auto surrounding.\n\t * Defaults to always allowing auto surrounding.\n\t */\n\tautoSurround?: EditorAutoSurroundStrategy;\n\t/**\n\t * Enable auto indentation adjustment.\n\t * Defaults to false.\n\t */\n\tautoIndent?: 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?: boolean | '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 * Enable word based suggestions. Defaults to 'true'\n\t */\n\twordBasedSuggestions?: 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?: boolean | '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 * Control the behavior and rendering of the code action lightbulb.\n\t */\n\tlightbulb?: IEditorLightbulbOptions;\n\t/**\n\t * Code action kinds to be run on save.\n\t */\n\tcodeActionsOnSave?: ICodeActionsOnSaveOptions;\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 * 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 * Enable highlighting of matching brackets.\n\t * Defaults to true.\n\t */\n\tmatchBrackets?: boolean;\n\t/**\n\t * Enable rendering of whitespace.\n\t * Defaults to none.\n\t */\n\trenderWhitespace?: 'none' | 'boundary' | 'all';\n\t/**\n\t * Enable rendering of control characters.\n\t * Defaults to false.\n\t */\n\trenderControlCharacters?: boolean;\n\t/**\n\t * Enable rendering of indent guides.\n\t * Defaults to true.\n\t */\n\trenderIndentGuides?: boolean;\n\t/**\n\t * Enable highlighting of the active indent guide.\n\t * Defaults to true.\n\t */\n\thighlightActiveIndentGuide?: 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 * 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?: 'normal' | 'bold' | 'bolder' | 'lighter' | 'initial' | 'inherit' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';\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}\n\n/**\n * Configuration options for the diff editor.\n */\nexport interface IDiffEditorOptions extends IEditorOptions {\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 * 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}\n\nexport const enum RenderMinimap {\n\tNone = 0,\n\tSmall = 1,\n\tLarge = 2,\n\tSmallBlocks = 3,\n\tLargeBlocks = 4,\n}\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\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/**\n * @internal\n */\nexport function blinkingStyleToString(blinkingStyle: TextEditorCursorBlinkingStyle): string {\n\tif (blinkingStyle === TextEditorCursorBlinkingStyle.Blink) {\n\t\treturn 'blink';\n\t} else if (blinkingStyle === TextEditorCursorBlinkingStyle.Expand) {\n\t\treturn 'expand';\n\t} else if (blinkingStyle === TextEditorCursorBlinkingStyle.Phase) {\n\t\treturn 'phase';\n\t} else if (blinkingStyle === TextEditorCursorBlinkingStyle.Smooth) {\n\t\treturn 'smooth';\n\t} else if (blinkingStyle === TextEditorCursorBlinkingStyle.Solid) {\n\t\treturn 'solid';\n\t} else {\n\t\tthrow new Error('blinkingStyleToString: Unknown blinkingStyle');\n\t}\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 * @internal\n */\nexport function cursorStyleToString(cursorStyle: TextEditorCursorStyle): string {\n\tif (cursorStyle === TextEditorCursorStyle.Line) {\n\t\treturn 'line';\n\t} else if (cursorStyle === TextEditorCursorStyle.Block) {\n\t\treturn 'block';\n\t} else if (cursorStyle === TextEditorCursorStyle.Underline) {\n\t\treturn 'underline';\n\t} else if (cursorStyle === TextEditorCursorStyle.LineThin) {\n\t\treturn 'line-thin';\n\t} else if (cursorStyle === TextEditorCursorStyle.BlockOutline) {\n\t\treturn 'block-outline';\n\t} else if (cursorStyle === TextEditorCursorStyle.UnderlineThin) {\n\t\treturn 'underline-thin';\n\t} else {\n\t\tthrow new Error('cursorStyleToString: Unknown cursorStyle');\n\t}\n}\n\nfunction _cursorStyleFromString(cursorStyle: string | undefined, defaultValue: TextEditorCursorStyle): TextEditorCursorStyle {\n\tif (typeof cursorStyle !== 'string') {\n\t\treturn defaultValue;\n\t}\n\tif (cursorStyle === 'line') {\n\t\treturn TextEditorCursorStyle.Line;\n\t} else if (cursorStyle === 'block') {\n\t\treturn TextEditorCursorStyle.Block;\n\t} else if (cursorStyle === 'underline') {\n\t\treturn TextEditorCursorStyle.Underline;\n\t} else if (cursorStyle === 'line-thin') {\n\t\treturn TextEditorCursorStyle.LineThin;\n\t} else if (cursorStyle === 'block-outline') {\n\t\treturn TextEditorCursorStyle.BlockOutline;\n\t} else if (cursorStyle === 'underline-thin') {\n\t\treturn TextEditorCursorStyle.UnderlineThin;\n\t}\n\treturn TextEditorCursorStyle.Line;\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 horizontalScrollbarSize: number;\n\treadonly horizontalSliderSize: number;\n\treadonly verticalScrollbarSize: number;\n\treadonly verticalSliderSize: number;\n\treadonly mouseWheelScrollSensitivity: number;\n\treadonly fastScrollSensitivity: number;\n}\n\nexport interface InternalEditorMinimapOptions {\n\treadonly enabled: boolean;\n\treadonly side: 'right' | 'left';\n\treadonly showSlider: 'always' | 'mouseover';\n\treadonly renderCharacters: boolean;\n\treadonly maxColumn: number;\n}\n\nexport interface InternalEditorFindOptions {\n\treadonly seedSearchStringFromSelection: boolean;\n\treadonly autoFindInSelection: boolean;\n\treadonly addExtraSpaceOnTop: boolean;\n\t/**\n\t * @internal\n\t */\n\treadonly globalFindClipboard: boolean;\n}\n\nexport interface InternalEditorHoverOptions {\n\treadonly enabled: boolean;\n\treadonly delay: number;\n\treadonly sticky: boolean;\n}\n\nexport interface InternalGoToLocationOptions {\n\treadonly multiple: 'peek' | 'gotoAndPeek' | 'goto';\n}\n\nexport interface InternalSuggestOptions {\n\treadonly filterGraceful: boolean;\n\treadonly snippets: 'top' | 'bottom' | 'inline' | 'none';\n\treadonly snippetsPreventQuickSuggestions: boolean;\n\treadonly localityBonus: boolean;\n\treadonly shareSuggestSelections: boolean;\n\treadonly showIcons: boolean;\n\treadonly maxVisibleSuggestions: number;\n\treadonly filteredTypes: Record<string, boolean>;\n}\n\nexport interface InternalParameterHintOptions {\n\treadonly enabled: boolean;\n\treadonly cycle: boolean;\n}\n\nexport interface EditorWrappingInfo {\n\treadonly inDiffEditor: boolean;\n\treadonly isDominatedByLongLines: boolean;\n\treadonly isWordWrapMinified: boolean;\n\treadonly isViewportWrapping: boolean;\n\treadonly wrappingColumn: number;\n\treadonly wrappingIndent: WrappingIndent;\n\treadonly wordWrapBreakBeforeCharacters: string;\n\treadonly wordWrapBreakAfterCharacters: string;\n\treadonly wordWrapBreakObtrusiveCharacters: string;\n}\n\nexport const enum RenderLineNumbersType {\n\tOff = 0,\n\tOn = 1,\n\tRelative = 2,\n\tInterval = 3,\n\tCustom = 4\n}\n\nexport interface InternalEditorViewOptions {\n\treadonly extraEditorClassName: string;\n\treadonly disableMonospaceOptimizations: boolean;\n\treadonly rulers: number[];\n\treadonly ariaLabel: string;\n\treadonly renderLineNumbers: RenderLineNumbersType;\n\treadonly renderCustomLineNumbers: ((lineNumber: number) => string) | null;\n\treadonly renderFinalNewline: boolean;\n\treadonly selectOnLineNumbers: boolean;\n\treadonly glyphMargin: boolean;\n\treadonly revealHorizontalRightPadding: number;\n\treadonly roundedSelection: boolean;\n\treadonly overviewRulerLanes: number;\n\treadonly overviewRulerBorder: boolean;\n\treadonly cursorBlinking: TextEditorCursorBlinkingStyle;\n\treadonly mouseWheelZoom: boolean;\n\treadonly cursorSmoothCaretAnimation: boolean;\n\treadonly cursorStyle: TextEditorCursorStyle;\n\treadonly cursorWidth: number;\n\treadonly hideCursorInOverviewRuler: boolean;\n\treadonly scrollBeyondLastLine: boolean;\n\treadonly scrollBeyondLastColumn: number;\n\treadonly smoothScrolling: boolean;\n\treadonly stopRenderingLineAfter: number;\n\treadonly renderWhitespace: 'none' | 'boundary' | 'all';\n\treadonly renderControlCharacters: boolean;\n\treadonly fontLigatures: boolean;\n\treadonly renderIndentGuides: boolean;\n\treadonly highlightActiveIndentGuide: boolean;\n\treadonly renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';\n\treadonly scrollbar: InternalEditorScrollbarOptions;\n\treadonly minimap: InternalEditorMinimapOptions;\n\treadonly fixedOverflowWidgets: boolean;\n}\n\nexport interface EditorContribOptions {\n\treadonly selectionClipboard: boolean;\n\treadonly hover: InternalEditorHoverOptions;\n\treadonly links: boolean;\n\treadonly contextmenu: boolean;\n\treadonly quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean };\n\treadonly quickSuggestionsDelay: number;\n\treadonly parameterHints: InternalParameterHintOptions;\n\treadonly formatOnType: boolean;\n\treadonly formatOnPaste: boolean;\n\treadonly suggestOnTriggerCharacters: boolean;\n\treadonly acceptSuggestionOnEnter: 'on' | 'smart' | 'off';\n\treadonly acceptSuggestionOnCommitCharacter: boolean;\n\treadonly wordBasedSuggestions: boolean;\n\treadonly suggestSelection: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';\n\treadonly suggestFontSize: number;\n\treadonly suggestLineHeight: number;\n\treadonly tabCompletion: 'on' | 'off' | 'onlySnippets';\n\treadonly suggest: InternalSuggestOptions;\n\treadonly gotoLocation: InternalGoToLocationOptions;\n\treadonly selectionHighlight: boolean;\n\treadonly occurrencesHighlight: boolean;\n\treadonly codeLens: boolean;\n\treadonly folding: boolean;\n\treadonly foldingStrategy: 'auto' | 'indentation';\n\treadonly showFoldingControls: 'always' | 'mouseover';\n\treadonly matchBrackets: boolean;\n\treadonly find: InternalEditorFindOptions;\n\treadonly colorDecorators: boolean;\n\treadonly lightbulbEnabled: boolean;\n\treadonly codeActionsOnSave: ICodeActionsOnSaveOptions;\n\treadonly codeActionsOnSaveTimeout: number;\n}\n\n/**\n * Validated configuration options for the editor.\n * This is a 1 to 1 validated/parsed version of IEditorOptions merged on top of the defaults.\n * @internal\n */\nexport interface IValidatedEditorOptions {\n\treadonly inDiffEditor: boolean;\n\treadonly wordSeparators: string;\n\treadonly lineNumbersMinChars: number;\n\treadonly lineDecorationsWidth: number | string;\n\treadonly readOnly: boolean;\n\treadonly mouseStyle: 'text' | 'default' | 'copy';\n\treadonly disableLayerHinting: boolean;\n\treadonly automaticLayout: boolean;\n\treadonly wordWrap: 'off' | 'on' | 'wordWrapColumn' | 'bounded';\n\treadonly wordWrapColumn: number;\n\treadonly wordWrapMinified: boolean;\n\treadonly wrappingIndent: WrappingIndent;\n\treadonly wordWrapBreakBeforeCharacters: string;\n\treadonly wordWrapBreakAfterCharacters: string;\n\treadonly wordWrapBreakObtrusiveCharacters: string;\n\treadonly autoClosingBrackets: EditorAutoClosingStrategy;\n\treadonly autoClosingQuotes: EditorAutoClosingStrategy;\n\treadonly autoSurround: EditorAutoSurroundStrategy;\n\treadonly autoIndent: boolean;\n\treadonly dragAndDrop: boolean;\n\treadonly emptySelectionClipboard: boolean;\n\treadonly copyWithSyntaxHighlighting: boolean;\n\treadonly useTabStops: boolean;\n\treadonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';\n\treadonly multiCursorMergeOverlapping: boolean;\n\treadonly accessibilitySupport: 'auto' | 'off' | 'on';\n\treadonly showUnused: boolean;\n\n\treadonly viewInfo: InternalEditorViewOptions;\n\treadonly contribInfo: EditorContribOptions;\n}\n\n/**\n * Internal configuration options (transformed or computed) for the editor.\n */\nexport class InternalEditorOptions {\n\treadonly _internalEditorOptionsBrand: void;\n\n\treadonly canUseLayerHinting: boolean;\n\treadonly pixelRatio: number;\n\treadonly editorClassName: string;\n\treadonly lineHeight: number;\n\treadonly readOnly: boolean;\n\t/**\n\t * @internal\n\t */\n\treadonly accessibilitySupport: AccessibilitySupport;\n\treadonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';\n\treadonly multiCursorMergeOverlapping: boolean;\n\treadonly showUnused: boolean;\n\n\t// ---- cursor options\n\treadonly wordSeparators: string;\n\treadonly autoClosingBrackets: EditorAutoClosingStrategy;\n\treadonly autoClosingQuotes: EditorAutoClosingStrategy;\n\treadonly autoSurround: EditorAutoSurroundStrategy;\n\treadonly autoIndent: boolean;\n\treadonly useTabStops: boolean;\n\treadonly tabFocusMode: boolean;\n\treadonly dragAndDrop: boolean;\n\treadonly emptySelectionClipboard: boolean;\n\treadonly copyWithSyntaxHighlighting: boolean;\n\n\t// ---- grouped options\n\treadonly layoutInfo: EditorLayoutInfo;\n\treadonly fontInfo: FontInfo;\n\treadonly viewInfo: InternalEditorViewOptions;\n\treadonly wrappingInfo: EditorWrappingInfo;\n\treadonly contribInfo: EditorContribOptions;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(source: {\n\t\tcanUseLayerHinting: boolean;\n\t\tpixelRatio: number;\n\t\teditorClassName: string;\n\t\tlineHeight: number;\n\t\treadOnly: boolean;\n\t\taccessibilitySupport: AccessibilitySupport;\n\t\tmultiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';\n\t\tmultiCursorMergeOverlapping: boolean;\n\t\twordSeparators: string;\n\t\tautoClosingBrackets: EditorAutoClosingStrategy;\n\t\tautoClosingQuotes: EditorAutoClosingStrategy;\n\t\tautoSurround: EditorAutoSurroundStrategy;\n\t\tautoIndent: boolean;\n\t\tuseTabStops: boolean;\n\t\ttabFocusMode: boolean;\n\t\tdragAndDrop: boolean;\n\t\temptySelectionClipboard: boolean;\n\t\tcopyWithSyntaxHighlighting: boolean;\n\t\tlayoutInfo: EditorLayoutInfo;\n\t\tfontInfo: FontInfo;\n\t\tviewInfo: InternalEditorViewOptions;\n\t\twrappingInfo: EditorWrappingInfo;\n\t\tcontribInfo: EditorContribOptions;\n\t\tshowUnused: boolean;\n\t}) {\n\t\tthis.canUseLayerHinting = source.canUseLayerHinting;\n\t\tthis.pixelRatio = source.pixelRatio;\n\t\tthis.editorClassName = source.editorClassName;\n\t\tthis.lineHeight = source.lineHeight | 0;\n\t\tthis.readOnly = source.readOnly;\n\t\tthis.accessibilitySupport = source.accessibilitySupport;\n\t\tthis.multiCursorModifier = source.multiCursorModifier;\n\t\tthis.multiCursorMergeOverlapping = source.multiCursorMergeOverlapping;\n\t\tthis.wordSeparators = source.wordSeparators;\n\t\tthis.autoClosingBrackets = source.autoClosingBrackets;\n\t\tthis.autoClosingQuotes = source.autoClosingQuotes;\n\t\tthis.autoSurround = source.autoSurround;\n\t\tthis.autoIndent = source.autoIndent;\n\t\tthis.useTabStops = source.useTabStops;\n\t\tthis.tabFocusMode = source.tabFocusMode;\n\t\tthis.dragAndDrop = source.dragAndDrop;\n\t\tthis.emptySelectionClipboard = source.emptySelectionClipboard;\n\t\tthis.copyWithSyntaxHighlighting = source.copyWithSyntaxHighlighting;\n\t\tthis.layoutInfo = source.layoutInfo;\n\t\tthis.fontInfo = source.fontInfo;\n\t\tthis.viewInfo = source.viewInfo;\n\t\tthis.wrappingInfo = source.wrappingInfo;\n\t\tthis.contribInfo = source.contribInfo;\n\t\tthis.showUnused = source.showUnused;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: InternalEditorOptions): boolean {\n\t\treturn (\n\t\t\tthis.canUseLayerHinting === other.canUseLayerHinting\n\t\t\t&& this.pixelRatio === other.pixelRatio\n\t\t\t&& this.editorClassName === other.editorClassName\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.readOnly === other.readOnly\n\t\t\t&& this.accessibilitySupport === other.accessibilitySupport\n\t\t\t&& this.multiCursorModifier === other.multiCursorModifier\n\t\t\t&& this.multiCursorMergeOverlapping === other.multiCursorMergeOverlapping\n\t\t\t&& this.wordSeparators === other.wordSeparators\n\t\t\t&& this.autoClosingBrackets === other.autoClosingBrackets\n\t\t\t&& this.autoClosingQuotes === other.autoClosingQuotes\n\t\t\t&& this.autoSurround === other.autoSurround\n\t\t\t&& this.autoIndent === other.autoIndent\n\t\t\t&& this.useTabStops === other.useTabStops\n\t\t\t&& this.tabFocusMode === other.tabFocusMode\n\t\t\t&& this.dragAndDrop === other.dragAndDrop\n\t\t\t&& this.showUnused === other.showUnused\n\t\t\t&& this.emptySelectionClipboard === other.emptySelectionClipboard\n\t\t\t&& this.copyWithSyntaxHighlighting === other.copyWithSyntaxHighlighting\n\t\t\t&& InternalEditorOptions._equalsLayoutInfo(this.layoutInfo, other.layoutInfo)\n\t\t\t&& this.fontInfo.equals(other.fontInfo)\n\t\t\t&& InternalEditorOptions._equalsViewOptions(this.viewInfo, other.viewInfo)\n\t\t\t&& InternalEditorOptions._equalsWrappingInfo(this.wrappingInfo, other.wrappingInfo)\n\t\t\t&& InternalEditorOptions._equalsContribOptions(this.contribInfo, other.contribInfo)\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic createChangeEvent(newOpts: InternalEditorOptions): IConfigurationChangedEvent {\n\t\treturn {\n\t\t\tcanUseLayerHinting: (this.canUseLayerHinting !== newOpts.canUseLayerHinting),\n\t\t\tpixelRatio: (this.pixelRatio !== newOpts.pixelRatio),\n\t\t\teditorClassName: (this.editorClassName !== newOpts.editorClassName),\n\t\t\tlineHeight: (this.lineHeight !== newOpts.lineHeight),\n\t\t\treadOnly: (this.readOnly !== newOpts.readOnly),\n\t\t\taccessibilitySupport: (this.accessibilitySupport !== newOpts.accessibilitySupport),\n\t\t\tmultiCursorModifier: (this.multiCursorModifier !== newOpts.multiCursorModifier),\n\t\t\tmultiCursorMergeOverlapping: (this.multiCursorMergeOverlapping !== newOpts.multiCursorMergeOverlapping),\n\t\t\twordSeparators: (this.wordSeparators !== newOpts.wordSeparators),\n\t\t\tautoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets),\n\t\t\tautoClosingQuotes: (this.autoClosingQuotes !== newOpts.autoClosingQuotes),\n\t\t\tautoSurround: (this.autoSurround !== newOpts.autoSurround),\n\t\t\tautoIndent: (this.autoIndent !== newOpts.autoIndent),\n\t\t\tuseTabStops: (this.useTabStops !== newOpts.useTabStops),\n\t\t\ttabFocusMode: (this.tabFocusMode !== newOpts.tabFocusMode),\n\t\t\tdragAndDrop: (this.dragAndDrop !== newOpts.dragAndDrop),\n\t\t\temptySelectionClipboard: (this.emptySelectionClipboard !== newOpts.emptySelectionClipboard),\n\t\t\tcopyWithSyntaxHighlighting: (this.copyWithSyntaxHighlighting !== newOpts.copyWithSyntaxHighlighting),\n\t\t\tlayoutInfo: (!InternalEditorOptions._equalsLayoutInfo(this.layoutInfo, newOpts.layoutInfo)),\n\t\t\tfontInfo: (!this.fontInfo.equals(newOpts.fontInfo)),\n\t\t\tviewInfo: (!InternalEditorOptions._equalsViewOptions(this.viewInfo, newOpts.viewInfo)),\n\t\t\twrappingInfo: (!InternalEditorOptions._equalsWrappingInfo(this.wrappingInfo, newOpts.wrappingInfo)),\n\t\t\tcontribInfo: (!InternalEditorOptions._equalsContribOptions(this.contribInfo, newOpts.contribInfo))\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsLayoutInfo(a: EditorLayoutInfo, b: EditorLayoutInfo): boolean {\n\t\treturn (\n\t\t\ta.width === b.width\n\t\t\t&& a.height === b.height\n\t\t\t&& a.glyphMarginLeft === b.glyphMarginLeft\n\t\t\t&& a.glyphMarginWidth === b.glyphMarginWidth\n\t\t\t&& a.glyphMarginHeight === b.glyphMarginHeight\n\t\t\t&& a.lineNumbersLeft === b.lineNumbersLeft\n\t\t\t&& a.lineNumbersWidth === b.lineNumbersWidth\n\t\t\t&& a.lineNumbersHeight === b.lineNumbersHeight\n\t\t\t&& a.decorationsLeft === b.decorationsLeft\n\t\t\t&& a.decorationsWidth === b.decorationsWidth\n\t\t\t&& a.decorationsHeight === b.decorationsHeight\n\t\t\t&& a.contentLeft === b.contentLeft\n\t\t\t&& a.contentWidth === b.contentWidth\n\t\t\t&& a.contentHeight === b.contentHeight\n\t\t\t&& a.renderMinimap === b.renderMinimap\n\t\t\t&& a.minimapLeft === b.minimapLeft\n\t\t\t&& a.minimapWidth === b.minimapWidth\n\t\t\t&& a.viewportColumn === b.viewportColumn\n\t\t\t&& a.verticalScrollbarWidth === b.verticalScrollbarWidth\n\t\t\t&& a.horizontalScrollbarHeight === b.horizontalScrollbarHeight\n\t\t\t&& this._equalsOverviewRuler(a.overviewRuler, b.overviewRuler)\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsOverviewRuler(a: OverviewRulerPosition, b: OverviewRulerPosition): boolean {\n\t\treturn (\n\t\t\ta.width === b.width\n\t\t\t&& a.height === b.height\n\t\t\t&& a.top === b.top\n\t\t\t&& a.right === b.right\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsViewOptions(a: InternalEditorViewOptions, b: InternalEditorViewOptions): boolean {\n\t\treturn (\n\t\t\ta.extraEditorClassName === b.extraEditorClassName\n\t\t\t&& a.disableMonospaceOptimizations === b.disableMonospaceOptimizations\n\t\t\t&& arrays.equals(a.rulers, b.rulers)\n\t\t\t&& a.ariaLabel === b.ariaLabel\n\t\t\t&& a.renderLineNumbers === b.renderLineNumbers\n\t\t\t&& a.renderCustomLineNumbers === b.renderCustomLineNumbers\n\t\t\t&& a.renderFinalNewline === b.renderFinalNewline\n\t\t\t&& a.selectOnLineNumbers === b.selectOnLineNumbers\n\t\t\t&& a.glyphMargin === b.glyphMargin\n\t\t\t&& a.revealHorizontalRightPadding === b.revealHorizontalRightPadding\n\t\t\t&& a.roundedSelection === b.roundedSelection\n\t\t\t&& a.overviewRulerLanes === b.overviewRulerLanes\n\t\t\t&& a.overviewRulerBorder === b.overviewRulerBorder\n\t\t\t&& a.cursorBlinking === b.cursorBlinking\n\t\t\t&& a.mouseWheelZoom === b.mouseWheelZoom\n\t\t\t&& a.cursorSmoothCaretAnimation === b.cursorSmoothCaretAnimation\n\t\t\t&& a.cursorStyle === b.cursorStyle\n\t\t\t&& a.cursorWidth === b.cursorWidth\n\t\t\t&& a.hideCursorInOverviewRuler === b.hideCursorInOverviewRuler\n\t\t\t&& a.scrollBeyondLastLine === b.scrollBeyondLastLine\n\t\t\t&& a.scrollBeyondLastColumn === b.scrollBeyondLastColumn\n\t\t\t&& a.smoothScrolling === b.smoothScrolling\n\t\t\t&& a.stopRenderingLineAfter === b.stopRenderingLineAfter\n\t\t\t&& a.renderWhitespace === b.renderWhitespace\n\t\t\t&& a.renderControlCharacters === b.renderControlCharacters\n\t\t\t&& a.fontLigatures === b.fontLigatures\n\t\t\t&& a.renderIndentGuides === b.renderIndentGuides\n\t\t\t&& a.highlightActiveIndentGuide === b.highlightActiveIndentGuide\n\t\t\t&& a.renderLineHighlight === b.renderLineHighlight\n\t\t\t&& this._equalsScrollbarOptions(a.scrollbar, b.scrollbar)\n\t\t\t&& this._equalsMinimapOptions(a.minimap, b.minimap)\n\t\t\t&& a.fixedOverflowWidgets === b.fixedOverflowWidgets\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsScrollbarOptions(a: InternalEditorScrollbarOptions, b: InternalEditorScrollbarOptions): boolean {\n\t\treturn (\n\t\t\ta.arrowSize === b.arrowSize\n\t\t\t&& a.vertical === b.vertical\n\t\t\t&& a.horizontal === b.horizontal\n\t\t\t&& a.useShadows === b.useShadows\n\t\t\t&& a.verticalHasArrows === b.verticalHasArrows\n\t\t\t&& a.horizontalHasArrows === b.horizontalHasArrows\n\t\t\t&& a.handleMouseWheel === b.handleMouseWheel\n\t\t\t&& a.horizontalScrollbarSize === b.horizontalScrollbarSize\n\t\t\t&& a.horizontalSliderSize === b.horizontalSliderSize\n\t\t\t&& a.verticalScrollbarSize === b.verticalScrollbarSize\n\t\t\t&& a.verticalSliderSize === b.verticalSliderSize\n\t\t\t&& a.mouseWheelScrollSensitivity === b.mouseWheelScrollSensitivity\n\t\t\t&& a.fastScrollSensitivity === b.fastScrollSensitivity\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsMinimapOptions(a: InternalEditorMinimapOptions, b: InternalEditorMinimapOptions): boolean {\n\t\treturn (\n\t\t\ta.enabled === b.enabled\n\t\t\t&& a.side === b.side\n\t\t\t&& a.showSlider === b.showSlider\n\t\t\t&& a.renderCharacters === b.renderCharacters\n\t\t\t&& a.maxColumn === b.maxColumn\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalFindOptions(a: InternalEditorFindOptions, b: InternalEditorFindOptions): boolean {\n\t\treturn (\n\t\t\ta.seedSearchStringFromSelection === b.seedSearchStringFromSelection\n\t\t\t&& a.autoFindInSelection === b.autoFindInSelection\n\t\t\t&& a.globalFindClipboard === b.globalFindClipboard\n\t\t\t&& a.addExtraSpaceOnTop === b.addExtraSpaceOnTop\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsParameterHintOptions(a: InternalParameterHintOptions, b: InternalParameterHintOptions): boolean {\n\t\treturn (\n\t\t\ta.enabled === b.enabled\n\t\t\t&& a.cycle === b.cycle\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsHoverOptions(a: InternalEditorHoverOptions, b: InternalEditorHoverOptions): boolean {\n\t\treturn (\n\t\t\ta.enabled === b.enabled\n\t\t\t&& a.delay === b.delay\n\t\t\t&& a.sticky === b.sticky\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsSuggestOptions(a: InternalSuggestOptions, b: InternalSuggestOptions): any {\n\t\tif (a === b) {\n\t\t\treturn true;\n\t\t} else if (!a || !b) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn a.filterGraceful === b.filterGraceful\n\t\t\t\t&& a.snippets === b.snippets\n\t\t\t\t&& a.snippetsPreventQuickSuggestions === b.snippetsPreventQuickSuggestions\n\t\t\t\t&& a.localityBonus === b.localityBonus\n\t\t\t\t&& a.shareSuggestSelections === b.shareSuggestSelections\n\t\t\t\t&& a.showIcons === b.showIcons\n\t\t\t\t&& a.maxVisibleSuggestions === b.maxVisibleSuggestions\n\t\t\t\t&& objects.equals(a.filteredTypes, b.filteredTypes);\n\t\t}\n\t}\n\n\tprivate static _equalsGotoLocationOptions(a: InternalGoToLocationOptions | undefined, b: InternalGoToLocationOptions | undefined): boolean {\n\t\tif (a === b) {\n\t\t\treturn true;\n\t\t} else if (!a || !b) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn a.multiple === b.multiple;\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsWrappingInfo(a: EditorWrappingInfo, b: EditorWrappingInfo): boolean {\n\t\treturn (\n\t\t\ta.inDiffEditor === b.inDiffEditor\n\t\t\t&& a.isDominatedByLongLines === b.isDominatedByLongLines\n\t\t\t&& a.isWordWrapMinified === b.isWordWrapMinified\n\t\t\t&& a.isViewportWrapping === b.isViewportWrapping\n\t\t\t&& a.wrappingColumn === b.wrappingColumn\n\t\t\t&& a.wrappingIndent === b.wrappingIndent\n\t\t\t&& a.wordWrapBreakBeforeCharacters === b.wordWrapBreakBeforeCharacters\n\t\t\t&& a.wordWrapBreakAfterCharacters === b.wordWrapBreakAfterCharacters\n\t\t\t&& a.wordWrapBreakObtrusiveCharacters === b.wordWrapBreakObtrusiveCharacters\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tprivate static _equalsContribOptions(a: EditorContribOptions, b: EditorContribOptions): boolean {\n\t\treturn (\n\t\t\ta.selectionClipboard === b.selectionClipboard\n\t\t\t&& this._equalsHoverOptions(a.hover, b.hover)\n\t\t\t&& a.links === b.links\n\t\t\t&& a.contextmenu === b.contextmenu\n\t\t\t&& InternalEditorOptions._equalsQuickSuggestions(a.quickSuggestions, b.quickSuggestions)\n\t\t\t&& a.quickSuggestionsDelay === b.quickSuggestionsDelay\n\t\t\t&& this._equalsParameterHintOptions(a.parameterHints, b.parameterHints)\n\t\t\t&& a.formatOnType === b.formatOnType\n\t\t\t&& a.formatOnPaste === b.formatOnPaste\n\t\t\t&& a.suggestOnTriggerCharacters === b.suggestOnTriggerCharacters\n\t\t\t&& a.acceptSuggestionOnEnter === b.acceptSuggestionOnEnter\n\t\t\t&& a.acceptSuggestionOnCommitCharacter === b.acceptSuggestionOnCommitCharacter\n\t\t\t&& a.wordBasedSuggestions === b.wordBasedSuggestions\n\t\t\t&& a.suggestSelection === b.suggestSelection\n\t\t\t&& a.suggestFontSize === b.suggestFontSize\n\t\t\t&& a.suggestLineHeight === b.suggestLineHeight\n\t\t\t&& a.tabCompletion === b.tabCompletion\n\t\t\t&& this._equalsSuggestOptions(a.suggest, b.suggest)\n\t\t\t&& InternalEditorOptions._equalsGotoLocationOptions(a.gotoLocation, b.gotoLocation)\n\t\t\t&& a.selectionHighlight === b.selectionHighlight\n\t\t\t&& a.occurrencesHighlight === b.occurrencesHighlight\n\t\t\t&& a.codeLens === b.codeLens\n\t\t\t&& a.folding === b.folding\n\t\t\t&& a.foldingStrategy === b.foldingStrategy\n\t\t\t&& a.showFoldingControls === b.showFoldingControls\n\t\t\t&& a.matchBrackets === b.matchBrackets\n\t\t\t&& this._equalFindOptions(a.find, b.find)\n\t\t\t&& a.colorDecorators === b.colorDecorators\n\t\t\t&& objects.equals(a.codeActionsOnSave, b.codeActionsOnSave)\n\t\t\t&& a.codeActionsOnSaveTimeout === b.codeActionsOnSaveTimeout\n\t\t\t&& a.lightbulbEnabled === b.lightbulbEnabled\n\t\t);\n\t}\n\n\tprivate static _equalsQuickSuggestions(a: boolean | { other: boolean, comments: boolean, strings: boolean }, b: boolean | { other: boolean, comments: boolean, strings: boolean }): boolean {\n\t\tif (typeof a === 'boolean') {\n\t\t\tif (typeof b !== 'boolean') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn a === b;\n\t\t}\n\t\tif (typeof b === 'boolean') {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\ta.comments === b.comments\n\t\t\t&& a.other === b.other\n\t\t\t&& a.strings === b.strings\n\t\t);\n\t}\n}\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\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\t/**\n\t * The height of the glyph margin.\n\t */\n\treadonly glyphMarginHeight: 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\t/**\n\t * The height of the line numbers.\n\t */\n\treadonly lineNumbersHeight: 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\t/**\n\t * The height of the line decorations.\n\t */\n\treadonly decorationsHeight: 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\t/**\n\t * The height of the content (actual height)\n\t */\n\treadonly contentHeight: number;\n\n\t/**\n\t * The position for the minimap\n\t */\n\treadonly minimapLeft: number;\n\t/**\n\t * The width of the minimap\n\t */\n\treadonly minimapWidth: number;\n\n\t/**\n\t * Minimap render type\n\t */\n\treadonly renderMinimap: RenderMinimap;\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\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 * An event describing that the configuration of the editor has changed.\n */\nexport interface IConfigurationChangedEvent {\n\treadonly canUseLayerHinting: boolean;\n\treadonly pixelRatio: boolean;\n\treadonly editorClassName: boolean;\n\treadonly lineHeight: boolean;\n\treadonly readOnly: boolean;\n\treadonly accessibilitySupport: boolean;\n\treadonly multiCursorModifier: boolean;\n\treadonly multiCursorMergeOverlapping: boolean;\n\treadonly wordSeparators: boolean;\n\treadonly autoClosingBrackets: boolean;\n\treadonly autoClosingQuotes: boolean;\n\treadonly autoSurround: boolean;\n\treadonly autoIndent: boolean;\n\treadonly useTabStops: boolean;\n\treadonly tabFocusMode: boolean;\n\treadonly dragAndDrop: boolean;\n\treadonly emptySelectionClipboard: boolean;\n\treadonly copyWithSyntaxHighlighting: boolean;\n\treadonly layoutInfo: boolean;\n\treadonly fontInfo: boolean;\n\treadonly viewInfo: boolean;\n\treadonly wrappingInfo: boolean;\n\treadonly contribInfo: boolean;\n}\n\n/**\n * @internal\n */\nexport interface IEnvironmentalOptions {\n\treadonly outerWidth: number;\n\treadonly outerHeight: number;\n\treadonly fontInfo: FontInfo;\n\treadonly extraEditorClassName: string;\n\treadonly isDominatedByLongLines: boolean;\n\treadonly lineNumbersDigitCount: number;\n\treadonly emptySelectionClipboard: boolean;\n\treadonly pixelRatio: number;\n\treadonly tabFocusMode: boolean;\n\treadonly accessibilitySupport: AccessibilitySupport;\n}\n\nfunction _boolean<T>(value: any, defaultValue: T): boolean | T {\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\nfunction _booleanMap(value: { [key: string]: boolean } | undefined, defaultValue: { [key: string]: boolean }): { [key: string]: boolean } {\n\tif (!value) {\n\t\treturn defaultValue;\n\t}\n\n\tconst out = Object.create(null);\n\tfor (const k of Object.keys(value)) {\n\t\tconst v = value[k];\n\t\tif (typeof v === 'boolean') {\n\t\t\tout[k] = v;\n\t\t}\n\t}\n\treturn out;\n}\n\nfunction _string(value: any, defaultValue: string): string {\n\tif (typeof value !== 'string') {\n\t\treturn defaultValue;\n\t}\n\treturn value;\n}\n\nfunction _stringSet<T>(value: T | undefined, defaultValue: T, allowedValues: 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\nfunction _clampedInt(value: any, defaultValue: number, minimum: number, maximum: number): number {\n\tlet r: number;\n\tif (typeof value === 'undefined') {\n\t\tr = defaultValue;\n\t} else {\n\t\tr = parseInt(value, 10);\n\t\tif (isNaN(r)) {\n\t\t\tr = defaultValue;\n\t\t}\n\t}\n\tr = Math.max(minimum, r);\n\tr = Math.min(maximum, r);\n\treturn r | 0;\n}\n\nfunction _float(value: any, defaultValue: number): number {\n\tlet r = parseFloat(value);\n\tif (isNaN(r)) {\n\t\tr = defaultValue;\n\t}\n\treturn r;\n}\n\nfunction _wrappingIndentFromString(wrappingIndent: string | undefined, defaultValue: WrappingIndent): WrappingIndent {\n\tif (typeof wrappingIndent !== 'string') {\n\t\treturn defaultValue;\n\t}\n\tif (wrappingIndent === 'same') {\n\t\treturn WrappingIndent.Same;\n\t} else if (wrappingIndent === 'indent') {\n\t\treturn WrappingIndent.Indent;\n\t} else if (wrappingIndent === 'deepIndent') {\n\t\treturn WrappingIndent.DeepIndent;\n\t} else {\n\t\treturn WrappingIndent.None;\n\t}\n}\n\nfunction _cursorBlinkingStyleFromString(cursorBlinkingStyle: string | undefined, defaultValue: TextEditorCursorBlinkingStyle): TextEditorCursorBlinkingStyle {\n\tif (typeof cursorBlinkingStyle !== 'string') {\n\t\treturn defaultValue;\n\t}\n\tswitch (cursorBlinkingStyle) {\n\t\tcase 'blink':\n\t\t\treturn TextEditorCursorBlinkingStyle.Blink;\n\t\tcase 'smooth':\n\t\t\treturn TextEditorCursorBlinkingStyle.Smooth;\n\t\tcase 'phase':\n\t\t\treturn TextEditorCursorBlinkingStyle.Phase;\n\t\tcase 'expand':\n\t\t\treturn TextEditorCursorBlinkingStyle.Expand;\n\t\tcase 'visible': // maintain compatibility\n\t\tcase 'solid':\n\t\t\treturn TextEditorCursorBlinkingStyle.Solid;\n\t}\n\treturn TextEditorCursorBlinkingStyle.Blink;\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':\n\t\t\treturn ScrollbarVisibility.Hidden;\n\t\tcase 'visible':\n\t\t\treturn ScrollbarVisibility.Visible;\n\t\tdefault:\n\t\t\treturn ScrollbarVisibility.Auto;\n\t}\n}\n\n/**\n * @internal\n */\nexport class EditorOptionsValidator {\n\n\t/**\n\t * Validate raw editor options.\n\t * i.e. since they can be defined by the user, they might be invalid.\n\t */\n\tpublic static validate(opts: IEditorOptions, defaults: IValidatedEditorOptions): IValidatedEditorOptions {\n\t\tlet wordWrap = opts.wordWrap;\n\t\t{\n\t\t\t// Compatibility with old true or false values\n\t\t\tif (<any>wordWrap === true) {\n\t\t\t\twordWrap = 'on';\n\t\t\t} else if (<any>wordWrap === false) {\n\t\t\t\twordWrap = 'off';\n\t\t\t}\n\n\t\t\twordWrap = _stringSet<'off' | 'on' | 'wordWrapColumn' | 'bounded'>(wordWrap, defaults.wordWrap, ['off', 'on', 'wordWrapColumn', 'bounded']);\n\t\t}\n\n\t\tconst viewInfo = this._sanitizeViewInfo(opts, defaults.viewInfo);\n\t\tconst contribInfo = this._sanitizeContribInfo(opts, defaults.contribInfo);\n\n\t\tlet configuredMulticursorModifier: 'altKey' | 'metaKey' | 'ctrlKey' | undefined = undefined;\n\t\tif (typeof opts.multiCursorModifier === 'string') {\n\t\t\tif (opts.multiCursorModifier === 'ctrlCmd') {\n\t\t\t\tconfiguredMulticursorModifier = platform.isMacintosh ? 'metaKey' : 'ctrlKey';\n\t\t\t} else {\n\t\t\t\tconfiguredMulticursorModifier = 'altKey';\n\t\t\t}\n\t\t}\n\t\tconst multiCursorModifier = _stringSet<'altKey' | 'metaKey' | 'ctrlKey'>(configuredMulticursorModifier, defaults.multiCursorModifier, ['altKey', 'metaKey', 'ctrlKey']);\n\n\t\tlet autoClosingBrackets: EditorAutoClosingStrategy;\n\t\tlet autoClosingQuotes: EditorAutoClosingStrategy;\n\t\tlet autoSurround: EditorAutoSurroundStrategy;\n\t\tif (typeof opts.autoClosingBrackets === 'boolean' && opts.autoClosingBrackets === false) {\n\t\t\t// backwards compatibility: disable all on boolean false\n\t\t\tautoClosingBrackets = 'never';\n\t\t\tautoClosingQuotes = 'never';\n\t\t\tautoSurround = 'never';\n\t\t} else {\n\t\t\tautoClosingBrackets = _stringSet<EditorAutoClosingStrategy>(opts.autoClosingBrackets, defaults.autoClosingBrackets, ['always', 'languageDefined', 'beforeWhitespace', 'never']);\n\t\t\tautoClosingQuotes = _stringSet<EditorAutoClosingStrategy>(opts.autoClosingQuotes, defaults.autoClosingQuotes, ['always', 'languageDefined', 'beforeWhitespace', 'never']);\n\t\t\tautoSurround = _stringSet<EditorAutoSurroundStrategy>(opts.autoSurround, defaults.autoSurround, ['languageDefined', 'brackets', 'quotes', 'never']);\n\t\t}\n\n\t\treturn {\n\t\t\tinDiffEditor: _boolean(opts.inDiffEditor, defaults.inDiffEditor),\n\t\t\twordSeparators: _string(opts.wordSeparators, defaults.wordSeparators),\n\t\t\tlineNumbersMinChars: _clampedInt(opts.lineNumbersMinChars, defaults.lineNumbersMinChars, 1, 10),\n\t\t\tlineDecorationsWidth: (typeof opts.lineDecorationsWidth === 'undefined' ? defaults.lineDecorationsWidth : opts.lineDecorationsWidth),\n\t\t\treadOnly: _boolean(opts.readOnly, defaults.readOnly),\n\t\t\tmouseStyle: _stringSet<'text' | 'default' | 'copy'>(opts.mouseStyle, defaults.mouseStyle, ['text', 'default', 'copy']),\n\t\t\tdisableLayerHinting: _boolean(opts.disableLayerHinting, defaults.disableLayerHinting),\n\t\t\tautomaticLayout: _boolean(opts.automaticLayout, defaults.automaticLayout),\n\t\t\twordWrap: wordWrap,\n\t\t\twordWrapColumn: _clampedInt(opts.wordWrapColumn, defaults.wordWrapColumn, 1, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\twordWrapMinified: _boolean(opts.wordWrapMinified, defaults.wordWrapMinified),\n\t\t\twrappingIndent: _wrappingIndentFromString(opts.wrappingIndent, defaults.wrappingIndent),\n\t\t\twordWrapBreakBeforeCharacters: _string(opts.wordWrapBreakBeforeCharacters, defaults.wordWrapBreakBeforeCharacters),\n\t\t\twordWrapBreakAfterCharacters: _string(opts.wordWrapBreakAfterCharacters, defaults.wordWrapBreakAfterCharacters),\n\t\t\twordWrapBreakObtrusiveCharacters: _string(opts.wordWrapBreakObtrusiveCharacters, defaults.wordWrapBreakObtrusiveCharacters),\n\t\t\tautoClosingBrackets,\n\t\t\tautoClosingQuotes,\n\t\t\tautoSurround,\n\t\t\tautoIndent: _boolean(opts.autoIndent, defaults.autoIndent),\n\t\t\tdragAndDrop: _boolean(opts.dragAndDrop, defaults.dragAndDrop),\n\t\t\temptySelectionClipboard: _boolean(opts.emptySelectionClipboard, defaults.emptySelectionClipboard),\n\t\t\tcopyWithSyntaxHighlighting: _boolean(opts.copyWithSyntaxHighlighting, defaults.copyWithSyntaxHighlighting),\n\t\t\tuseTabStops: _boolean(opts.useTabStops, defaults.useTabStops),\n\t\t\tmultiCursorModifier: multiCursorModifier,\n\t\t\tmultiCursorMergeOverlapping: _boolean(opts.multiCursorMergeOverlapping, defaults.multiCursorMergeOverlapping),\n\t\t\taccessibilitySupport: _stringSet<'auto' | 'on' | 'off'>(opts.accessibilitySupport, defaults.accessibilitySupport, ['auto', 'on', 'off']),\n\t\t\tshowUnused: _boolean(opts.showUnused, defaults.showUnused),\n\t\t\tviewInfo: viewInfo,\n\t\t\tcontribInfo: contribInfo,\n\t\t};\n\t}\n\n\tprivate static _sanitizeScrollbarOpts(opts: IEditorScrollbarOptions | undefined, defaults: InternalEditorScrollbarOptions, mouseWheelScrollSensitivity: number, fastScrollSensitivity: number): InternalEditorScrollbarOptions {\n\t\tif (typeof opts !== 'object') {\n\t\t\treturn defaults;\n\t\t}\n\t\tconst horizontalScrollbarSize = _clampedInt(opts.horizontalScrollbarSize, defaults.horizontalScrollbarSize, 0, 1000);\n\t\tconst verticalScrollbarSize = _clampedInt(opts.verticalScrollbarSize, defaults.verticalScrollbarSize, 0, 1000);\n\t\treturn {\n\t\t\tvertical: _scrollbarVisibilityFromString(opts.vertical, defaults.vertical),\n\t\t\thorizontal: _scrollbarVisibilityFromString(opts.horizontal, defaults.horizontal),\n\n\t\t\tarrowSize: _clampedInt(opts.arrowSize, defaults.arrowSize, 0, 1000),\n\t\t\tuseShadows: _boolean(opts.useShadows, defaults.useShadows),\n\n\t\t\tverticalHasArrows: _boolean(opts.verticalHasArrows, defaults.verticalHasArrows),\n\t\t\thorizontalHasArrows: _boolean(opts.horizontalHasArrows, defaults.horizontalHasArrows),\n\n\t\t\thorizontalScrollbarSize: horizontalScrollbarSize,\n\t\t\thorizontalSliderSize: _clampedInt(opts.horizontalSliderSize, horizontalScrollbarSize, 0, 1000),\n\n\t\t\tverticalScrollbarSize: verticalScrollbarSize,\n\t\t\tverticalSliderSize: _clampedInt(opts.verticalSliderSize, verticalScrollbarSize, 0, 1000),\n\n\t\t\thandleMouseWheel: _boolean(opts.handleMouseWheel, defaults.handleMouseWheel),\n\t\t\tmouseWheelScrollSensitivity: mouseWheelScrollSensitivity,\n\t\t\tfastScrollSensitivity: fastScrollSensitivity,\n\t\t};\n\t}\n\n\tprivate static _sanitizeMinimapOpts(opts: IEditorMinimapOptions | undefined, defaults: InternalEditorMinimapOptions): InternalEditorMinimapOptions {\n\t\tif (typeof opts !== 'object') {\n\t\t\treturn defaults;\n\t\t}\n\t\treturn {\n\t\t\tenabled: _boolean(opts.enabled, defaults.enabled),\n\t\t\tside: _stringSet<'right' | 'left'>(opts.side, defaults.side, ['right', 'left']),\n\t\t\tshowSlider: _stringSet<'always' | 'mouseover'>(opts.showSlider, defaults.showSlider, ['always', 'mouseover']),\n\t\t\trenderCharacters: _boolean(opts.renderCharacters, defaults.renderCharacters),\n\t\t\tmaxColumn: _clampedInt(opts.maxColumn, defaults.maxColumn, 1, 10000),\n\t\t};\n\t}\n\n\tprivate static _sanitizeFindOpts(opts: IEditorFindOptions | undefined, defaults: InternalEditorFindOptions): InternalEditorFindOptions {\n\t\tif (typeof opts !== 'object') {\n\t\t\treturn defaults;\n\t\t}\n\n\t\treturn {\n\t\t\tseedSearchStringFromSelection: _boolean(opts.seedSearchStringFromSelection, defaults.seedSearchStringFromSelection),\n\t\t\tautoFindInSelection: _boolean(opts.autoFindInSelection, defaults.autoFindInSelection),\n\t\t\tglobalFindClipboard: _boolean(opts.globalFindClipboard, defaults.globalFindClipboard),\n\t\t\taddExtraSpaceOnTop: _boolean(opts.addExtraSpaceOnTop, defaults.addExtraSpaceOnTop)\n\t\t};\n\t}\n\n\tprivate static _sanitizeParameterHintOpts(opts: IEditorParameterHintOptions | undefined, defaults: InternalParameterHintOptions): InternalParameterHintOptions {\n\t\tif (typeof opts !== 'object') {\n\t\t\treturn defaults;\n\t\t}\n\n\t\treturn {\n\t\t\tenabled: _boolean(opts.enabled, defaults.enabled),\n\t\t\tcycle: _boolean(opts.cycle, defaults.cycle)\n\t\t};\n\t}\n\n\tprivate static _sanitizeHoverOpts(_opts: boolean | IEditorHoverOptions | undefined, defaults: InternalEditorHoverOptions): InternalEditorHoverOptions {\n\t\tlet opts: IEditorHoverOptions;\n\t\tif (typeof _opts === 'boolean') {\n\t\t\topts = {\n\t\t\t\tenabled: _opts\n\t\t\t};\n\t\t} else if (typeof _opts === 'object') {\n\t\t\topts = _opts;\n\t\t} else {\n\t\t\treturn defaults;\n\t\t}\n\n\t\treturn {\n\t\t\tenabled: _boolean(opts.enabled, defaults.enabled),\n\t\t\tdelay: _clampedInt(opts.delay, defaults.delay, 0, 10000),\n\t\t\tsticky: _boolean(opts.sticky, defaults.sticky)\n\t\t};\n\t}\n\n\tprivate static _sanitizeSuggestOpts(opts: IEditorOptions, defaults: InternalSuggestOptions): InternalSuggestOptions {\n\t\tconst suggestOpts = opts.suggest || {};\n\t\treturn {\n\t\t\tfilterGraceful: _boolean(suggestOpts.filterGraceful, defaults.filterGraceful),\n\t\t\tsnippets: _stringSet<'top' | 'bottom' | 'inline' | 'none'>(opts.snippetSuggestions, defaults.snippets, ['top', 'bottom', 'inline', 'none']),\n\t\t\tsnippetsPreventQuickSuggestions: _boolean(suggestOpts.snippetsPreventQuickSuggestions, defaults.filterGraceful),\n\t\t\tlocalityBonus: _boolean(suggestOpts.localityBonus, defaults.localityBonus),\n\t\t\tshareSuggestSelections: _boolean(suggestOpts.shareSuggestSelections, defaults.shareSuggestSelections),\n\t\t\tshowIcons: _boolean(suggestOpts.showIcons, defaults.showIcons),\n\t\t\tmaxVisibleSuggestions: _clampedInt(suggestOpts.maxVisibleSuggestions, defaults.maxVisibleSuggestions, 1, 15),\n\t\t\tfilteredTypes: isObject(suggestOpts.filteredTypes) ? suggestOpts.filteredTypes : Object.create(null)\n\t\t};\n\t}\n\n\tprivate static _sanitizeGotoLocationOpts(opts: IEditorOptions, defaults: InternalGoToLocationOptions): InternalGoToLocationOptions {\n\t\tconst gotoOpts = opts.gotoLocation || {};\n\t\treturn {\n\t\t\tmultiple: _stringSet<'peek' | 'gotoAndPeek' | 'goto'>(gotoOpts.multiple, defaults.multiple, ['peek', 'gotoAndPeek', 'goto'])\n\t\t};\n\t}\n\n\tprivate static _sanitizeTabCompletionOpts(opts: boolean | 'on' | 'off' | 'onlySnippets' | undefined, defaults: 'on' | 'off' | 'onlySnippets'): 'on' | 'off' | 'onlySnippets' {\n\t\tif (opts === false) {\n\t\t\treturn 'off';\n\t\t} else if (opts === true) {\n\t\t\treturn 'onlySnippets';\n\t\t} else {\n\t\t\treturn _stringSet<'on' | 'off' | 'onlySnippets'>(opts, defaults, ['on', 'off', 'onlySnippets']);\n\t\t}\n\t}\n\n\tprivate static _sanitizeViewInfo(opts: IEditorOptions, defaults: InternalEditorViewOptions): InternalEditorViewOptions {\n\n\t\tlet rulers: number[] = [];\n\t\tif (Array.isArray(opts.rulers)) {\n\t\t\tfor (let i = 0, len = opts.rulers.length; i < len; i++) {\n\t\t\t\trulers.push(_clampedInt(opts.rulers[i], 0, 0, 10000));\n\t\t\t}\n\t\t\trulers.sort();\n\t\t}\n\n\t\tlet renderLineNumbers: RenderLineNumbersType = defaults.renderLineNumbers;\n\t\tlet renderCustomLineNumbers: ((lineNumber: number) => string) | null = defaults.renderCustomLineNumbers;\n\n\t\tif (typeof opts.lineNumbers !== 'undefined') {\n\t\t\tlet lineNumbers = opts.lineNumbers;\n\n\t\t\t// Compatibility with old true or false values\n\t\t\tif (<any>lineNumbers === true) {\n\t\t\t\tlineNumbers = 'on';\n\t\t\t} else if (<any>lineNumbers === false) {\n\t\t\t\tlineNumbers = 'off';\n\t\t\t}\n\n\t\t\tif (typeof lineNumbers === 'function') {\n\t\t\t\trenderLineNumbers = RenderLineNumbersType.Custom;\n\t\t\t\trenderCustomLineNumbers = lineNumbers;\n\t\t\t} else if (lineNumbers === 'interval') {\n\t\t\t\trenderLineNumbers = RenderLineNumbersType.Interval;\n\t\t\t} else if (lineNumbers === 'relative') {\n\t\t\t\trenderLineNumbers = RenderLineNumbersType.Relative;\n\t\t\t} else if (lineNumbers === 'on') {\n\t\t\t\trenderLineNumbers = RenderLineNumbersType.On;\n\t\t\t} else {\n\t\t\t\trenderLineNumbers = RenderLineNumbersType.Off;\n\t\t\t}\n\t\t}\n\n\t\tconst fontLigatures = _boolean(opts.fontLigatures, defaults.fontLigatures);\n\t\tconst disableMonospaceOptimizations = _boolean(opts.disableMonospaceOptimizations, defaults.disableMonospaceOptimizations) || fontLigatures;\n\n\t\tlet renderWhitespace = opts.renderWhitespace;\n\t\t{\n\t\t\t// Compatibility with old true or false values\n\t\t\tif (<any>renderWhitespace === true) {\n\t\t\t\trenderWhitespace = 'boundary';\n\t\t\t} else if (<any>renderWhitespace === false) {\n\t\t\t\trenderWhitespace = 'none';\n\t\t\t}\n\t\t\trenderWhitespace = _stringSet<'none' | 'boundary' | 'all'>(renderWhitespace, defaults.renderWhitespace, ['none', 'boundary', 'all']);\n\t\t}\n\n\t\tlet renderLineHighlight = opts.renderLineHighlight;\n\t\t{\n\t\t\t// Compatibility with old true or false values\n\t\t\tif (<any>renderLineHighlight === true) {\n\t\t\t\trenderLineHighlight = 'line';\n\t\t\t} else if (<any>renderLineHighlight === false) {\n\t\t\t\trenderLineHighlight = 'none';\n\t\t\t}\n\t\t\trenderLineHighlight = _stringSet<'none' | 'gutter' | 'line' | 'all'>(renderLineHighlight, defaults.renderLineHighlight, ['none', 'gutter', 'line', 'all']);\n\t\t}\n\n\t\tlet mouseWheelScrollSensitivity = _float(opts.mouseWheelScrollSensitivity, defaults.scrollbar.mouseWheelScrollSensitivity);\n\t\tif (mouseWheelScrollSensitivity === 0) {\n\t\t\t// Disallow 0, as it would prevent/block scrolling\n\t\t\tmouseWheelScrollSensitivity = 1;\n\t\t}\n\n\t\tlet fastScrollSensitivity = _float(opts.fastScrollSensitivity, defaults.scrollbar.fastScrollSensitivity);\n\t\tif (fastScrollSensitivity <= 0) {\n\t\t\tfastScrollSensitivity = defaults.scrollbar.fastScrollSensitivity;\n\t\t}\n\t\tconst scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, defaults.scrollbar, mouseWheelScrollSensitivity, fastScrollSensitivity);\n\t\tconst minimap = this._sanitizeMinimapOpts(opts.minimap, defaults.minimap);\n\n\t\treturn {\n\t\t\textraEditorClassName: _string(opts.extraEditorClassName, defaults.extraEditorClassName),\n\t\t\tdisableMonospaceOptimizations: disableMonospaceOptimizations,\n\t\t\trulers: rulers,\n\t\t\tariaLabel: _string(opts.ariaLabel, defaults.ariaLabel),\n\t\t\trenderLineNumbers: renderLineNumbers,\n\t\t\trenderCustomLineNumbers: renderCustomLineNumbers,\n\t\t\trenderFinalNewline: _boolean(opts.renderFinalNewline, defaults.renderFinalNewline),\n\t\t\tselectOnLineNumbers: _boolean(opts.selectOnLineNumbers, defaults.selectOnLineNumbers),\n\t\t\tglyphMargin: _boolean(opts.glyphMargin, defaults.glyphMargin),\n\t\t\trevealHorizontalRightPadding: _clampedInt(opts.revealHorizontalRightPadding, defaults.revealHorizontalRightPadding, 0, 1000),\n\t\t\troundedSelection: _boolean(opts.roundedSelection, defaults.roundedSelection),\n\t\t\toverviewRulerLanes: _clampedInt(opts.overviewRulerLanes, defaults.overviewRulerLanes, 0, 3),\n\t\t\toverviewRulerBorder: _boolean(opts.overviewRulerBorder, defaults.overviewRulerBorder),\n\t\t\tcursorBlinking: _cursorBlinkingStyleFromString(opts.cursorBlinking, defaults.cursorBlinking),\n\t\t\tmouseWheelZoom: _boolean(opts.mouseWheelZoom, defaults.mouseWheelZoom),\n\t\t\tcursorSmoothCaretAnimation: _boolean(opts.cursorSmoothCaretAnimation, defaults.cursorSmoothCaretAnimation),\n\t\t\tcursorStyle: _cursorStyleFromString(opts.cursorStyle, defaults.cursorStyle),\n\t\t\tcursorWidth: _clampedInt(opts.cursorWidth, defaults.cursorWidth, 0, Number.MAX_VALUE),\n\t\t\thideCursorInOverviewRuler: _boolean(opts.hideCursorInOverviewRuler, defaults.hideCursorInOverviewRuler),\n\t\t\tscrollBeyondLastLine: _boolean(opts.scrollBeyondLastLine, defaults.scrollBeyondLastLine),\n\t\t\tscrollBeyondLastColumn: _clampedInt(opts.scrollBeyondLastColumn, defaults.scrollBeyondLastColumn, 0, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\tsmoothScrolling: _boolean(opts.smoothScrolling, defaults.smoothScrolling),\n\t\t\tstopRenderingLineAfter: _clampedInt(opts.stopRenderingLineAfter, defaults.stopRenderingLineAfter, -1, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\trenderWhitespace: renderWhitespace,\n\t\t\trenderControlCharacters: _boolean(opts.renderControlCharacters, defaults.renderControlCharacters),\n\t\t\tfontLigatures: fontLigatures,\n\t\t\trenderIndentGuides: _boolean(opts.renderIndentGuides, defaults.renderIndentGuides),\n\t\t\thighlightActiveIndentGuide: _boolean(opts.highlightActiveIndentGuide, defaults.highlightActiveIndentGuide),\n\t\t\trenderLineHighlight: renderLineHighlight,\n\t\t\tscrollbar: scrollbar,\n\t\t\tminimap: minimap,\n\t\t\tfixedOverflowWidgets: _boolean(opts.fixedOverflowWidgets, defaults.fixedOverflowWidgets),\n\t\t};\n\t}\n\n\tprivate static _sanitizeContribInfo(opts: IEditorOptions, defaults: EditorContribOptions): EditorContribOptions {\n\t\tlet quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean };\n\t\tif (typeof opts.quickSuggestions === 'object') {\n\t\t\tquickSuggestions = { other: true, ...opts.quickSuggestions };\n\t\t} else {\n\t\t\tquickSuggestions = _boolean(opts.quickSuggestions, defaults.quickSuggestions);\n\t\t}\n\t\t// Compatibility support for acceptSuggestionOnEnter\n\t\tif (typeof opts.acceptSuggestionOnEnter === 'boolean') {\n\t\t\topts.acceptSuggestionOnEnter = opts.acceptSuggestionOnEnter ? 'on' : 'off';\n\t\t}\n\t\tconst find = this._sanitizeFindOpts(opts.find, defaults.find);\n\t\treturn {\n\t\t\tselectionClipboard: _boolean(opts.selectionClipboard, defaults.selectionClipboard),\n\t\t\thover: this._sanitizeHoverOpts(opts.hover, defaults.hover),\n\t\t\tlinks: _boolean(opts.links, defaults.links),\n\t\t\tcontextmenu: _boolean(opts.contextmenu, defaults.contextmenu),\n\t\t\tquickSuggestions: quickSuggestions,\n\t\t\tquickSuggestionsDelay: _clampedInt(opts.quickSuggestionsDelay, defaults.quickSuggestionsDelay, Constants.MIN_SAFE_SMALL_INTEGER, Constants.MAX_SAFE_SMALL_INTEGER),\n\t\t\tparameterHints: this._sanitizeParameterHintOpts(opts.parameterHints, defaults.parameterHints),\n\t\t\tformatOnType: _boolean(opts.formatOnType, defaults.formatOnType),\n\t\t\tformatOnPaste: _boolean(opts.formatOnPaste, defaults.formatOnPaste),\n\t\t\tsuggestOnTriggerCharacters: _boolean(opts.suggestOnTriggerCharacters, defaults.suggestOnTriggerCharacters),\n\t\t\tacceptSuggestionOnEnter: _stringSet<'on' | 'smart' | 'off'>(opts.acceptSuggestionOnEnter, defaults.acceptSuggestionOnEnter, ['on', 'smart', 'off']),\n\t\t\tacceptSuggestionOnCommitCharacter: _boolean(opts.acceptSuggestionOnCommitCharacter, defaults.acceptSuggestionOnCommitCharacter),\n\t\t\twordBasedSuggestions: _boolean(opts.wordBasedSuggestions, defaults.wordBasedSuggestions),\n\t\t\tsuggestSelection: _stringSet<'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>(opts.suggestSelection, defaults.suggestSelection, ['first', 'recentlyUsed', 'recentlyUsedByPrefix']),\n\t\t\tsuggestFontSize: _clampedInt(opts.suggestFontSize, defaults.suggestFontSize, 0, 1000),\n\t\t\tsuggestLineHeight: _clampedInt(opts.suggestLineHeight, defaults.suggestLineHeight, 0, 1000),\n\t\t\ttabCompletion: this._sanitizeTabCompletionOpts(opts.tabCompletion, defaults.tabCompletion),\n\t\t\tsuggest: this._sanitizeSuggestOpts(opts, defaults.suggest),\n\t\t\tgotoLocation: this._sanitizeGotoLocationOpts(opts, defaults.gotoLocation),\n\t\t\tselectionHighlight: _boolean(opts.selectionHighlight, defaults.selectionHighlight),\n\t\t\toccurrencesHighlight: _boolean(opts.occurrencesHighlight, defaults.occurrencesHighlight),\n\t\t\tcodeLens: _boolean(opts.codeLens, defaults.codeLens),\n\t\t\tfolding: _boolean(opts.folding, defaults.folding),\n\t\t\tfoldingStrategy: _stringSet<'auto' | 'indentation'>(opts.foldingStrategy, defaults.foldingStrategy, ['auto', 'indentation']),\n\t\t\tshowFoldingControls: _stringSet<'always' | 'mouseover'>(opts.showFoldingControls, defaults.showFoldingControls, ['always', 'mouseover']),\n\t\t\tmatchBrackets: _boolean(opts.matchBrackets, defaults.matchBrackets),\n\t\t\tfind: find,\n\t\t\tcolorDecorators: _boolean(opts.colorDecorators, defaults.colorDecorators),\n\t\t\tlightbulbEnabled: _boolean(opts.lightbulb ? opts.lightbulb.enabled : false, defaults.lightbulbEnabled),\n\t\t\tcodeActionsOnSave: _booleanMap(opts.codeActionsOnSave, {}),\n\t\t\tcodeActionsOnSaveTimeout: _clampedInt(opts.codeActionsOnSaveTimeout, defaults.codeActionsOnSaveTimeout, 1, 10000)\n\t\t};\n\t}\n}\n\n/**\n * @internal\n */\nexport class InternalEditorOptionsFactory {\n\n\tprivate static _tweakValidatedOptions(opts: IValidatedEditorOptions, accessibilitySupport: AccessibilitySupport): IValidatedEditorOptions {\n\t\tconst accessibilityIsOn = (accessibilitySupport === AccessibilitySupport.Enabled);\n\t\tconst accessibilityIsOff = (accessibilitySupport === AccessibilitySupport.Disabled);\n\t\treturn {\n\t\t\tinDiffEditor: opts.inDiffEditor,\n\t\t\twordSeparators: opts.wordSeparators,\n\t\t\tlineNumbersMinChars: opts.lineNumbersMinChars,\n\t\t\tlineDecorationsWidth: opts.lineDecorationsWidth,\n\t\t\treadOnly: opts.readOnly,\n\t\t\tmouseStyle: opts.mouseStyle,\n\t\t\tdisableLayerHinting: opts.disableLayerHinting,\n\t\t\tautomaticLayout: opts.automaticLayout,\n\t\t\twordWrap: opts.wordWrap,\n\t\t\twordWrapColumn: opts.wordWrapColumn,\n\t\t\twordWrapMinified: opts.wordWrapMinified,\n\t\t\twrappingIndent: opts.wrappingIndent,\n\t\t\twordWrapBreakBeforeCharacters: opts.wordWrapBreakBeforeCharacters,\n\t\t\twordWrapBreakAfterCharacters: opts.wordWrapBreakAfterCharacters,\n\t\t\twordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters,\n\t\t\tautoClosingBrackets: opts.autoClosingBrackets,\n\t\t\tautoClosingQuotes: opts.autoClosingQuotes,\n\t\t\tautoSurround: opts.autoSurround,\n\t\t\tautoIndent: opts.autoIndent,\n\t\t\tdragAndDrop: opts.dragAndDrop,\n\t\t\temptySelectionClipboard: opts.emptySelectionClipboard,\n\t\t\tcopyWithSyntaxHighlighting: opts.copyWithSyntaxHighlighting,\n\t\t\tuseTabStops: opts.useTabStops,\n\t\t\tmultiCursorModifier: opts.multiCursorModifier,\n\t\t\tmultiCursorMergeOverlapping: opts.multiCursorMergeOverlapping,\n\t\t\taccessibilitySupport: opts.accessibilitySupport,\n\t\t\tshowUnused: opts.showUnused,\n\n\t\t\tviewInfo: {\n\t\t\t\textraEditorClassName: opts.viewInfo.extraEditorClassName,\n\t\t\t\tdisableMonospaceOptimizations: opts.viewInfo.disableMonospaceOptimizations,\n\t\t\t\trulers: opts.viewInfo.rulers,\n\t\t\t\tariaLabel: (accessibilityIsOff ? nls.localize('accessibilityOffAriaLabel', \"The editor is not accessible at this time. Press Alt+F1 for options.\") : opts.viewInfo.ariaLabel),\n\t\t\t\trenderLineNumbers: opts.viewInfo.renderLineNumbers,\n\t\t\t\trenderCustomLineNumbers: opts.viewInfo.renderCustomLineNumbers,\n\t\t\t\trenderFinalNewline: opts.viewInfo.renderFinalNewline,\n\t\t\t\tselectOnLineNumbers: opts.viewInfo.selectOnLineNumbers,\n\t\t\t\tglyphMargin: opts.viewInfo.glyphMargin,\n\t\t\t\trevealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding,\n\t\t\t\troundedSelection: (accessibilityIsOn ? false : opts.viewInfo.roundedSelection), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\toverviewRulerLanes: opts.viewInfo.overviewRulerLanes,\n\t\t\t\toverviewRulerBorder: opts.viewInfo.overviewRulerBorder,\n\t\t\t\tcursorBlinking: opts.viewInfo.cursorBlinking,\n\t\t\t\tmouseWheelZoom: opts.viewInfo.mouseWheelZoom,\n\t\t\t\tcursorSmoothCaretAnimation: opts.viewInfo.cursorSmoothCaretAnimation,\n\t\t\t\tcursorStyle: opts.viewInfo.cursorStyle,\n\t\t\t\tcursorWidth: opts.viewInfo.cursorWidth,\n\t\t\t\thideCursorInOverviewRuler: opts.viewInfo.hideCursorInOverviewRuler,\n\t\t\t\tscrollBeyondLastLine: opts.viewInfo.scrollBeyondLastLine,\n\t\t\t\tscrollBeyondLastColumn: opts.viewInfo.scrollBeyondLastColumn,\n\t\t\t\tsmoothScrolling: opts.viewInfo.smoothScrolling,\n\t\t\t\tstopRenderingLineAfter: opts.viewInfo.stopRenderingLineAfter,\n\t\t\t\trenderWhitespace: (accessibilityIsOn ? 'none' : opts.viewInfo.renderWhitespace), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\trenderControlCharacters: (accessibilityIsOn ? false : opts.viewInfo.renderControlCharacters), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\tfontLigatures: (accessibilityIsOn ? false : opts.viewInfo.fontLigatures), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\trenderIndentGuides: (accessibilityIsOn ? false : opts.viewInfo.renderIndentGuides), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\thighlightActiveIndentGuide: opts.viewInfo.highlightActiveIndentGuide,\n\t\t\t\trenderLineHighlight: opts.viewInfo.renderLineHighlight,\n\t\t\t\tscrollbar: opts.viewInfo.scrollbar,\n\t\t\t\tminimap: {\n\t\t\t\t\tenabled: (accessibilityIsOn ? false : opts.viewInfo.minimap.enabled), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\t\tside: opts.viewInfo.minimap.side,\n\t\t\t\t\trenderCharacters: opts.viewInfo.minimap.renderCharacters,\n\t\t\t\t\tshowSlider: opts.viewInfo.minimap.showSlider,\n\t\t\t\t\tmaxColumn: opts.viewInfo.minimap.maxColumn\n\t\t\t\t},\n\t\t\t\tfixedOverflowWidgets: opts.viewInfo.fixedOverflowWidgets\n\t\t\t},\n\n\t\t\tcontribInfo: {\n\t\t\t\tselectionClipboard: opts.contribInfo.selectionClipboard,\n\t\t\t\thover: opts.contribInfo.hover,\n\t\t\t\tlinks: (accessibilityIsOn ? false : opts.contribInfo.links), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\tcontextmenu: opts.contribInfo.contextmenu,\n\t\t\t\tquickSuggestions: opts.contribInfo.quickSuggestions,\n\t\t\t\tquickSuggestionsDelay: opts.contribInfo.quickSuggestionsDelay,\n\t\t\t\tparameterHints: opts.contribInfo.parameterHints,\n\t\t\t\tformatOnType: opts.contribInfo.formatOnType,\n\t\t\t\tformatOnPaste: opts.contribInfo.formatOnPaste,\n\t\t\t\tsuggestOnTriggerCharacters: opts.contribInfo.suggestOnTriggerCharacters,\n\t\t\t\tacceptSuggestionOnEnter: opts.contribInfo.acceptSuggestionOnEnter,\n\t\t\t\tacceptSuggestionOnCommitCharacter: opts.contribInfo.acceptSuggestionOnCommitCharacter,\n\t\t\t\twordBasedSuggestions: opts.contribInfo.wordBasedSuggestions,\n\t\t\t\tsuggestSelection: opts.contribInfo.suggestSelection,\n\t\t\t\tsuggestFontSize: opts.contribInfo.suggestFontSize,\n\t\t\t\tsuggestLineHeight: opts.contribInfo.suggestLineHeight,\n\t\t\t\ttabCompletion: opts.contribInfo.tabCompletion,\n\t\t\t\tsuggest: opts.contribInfo.suggest,\n\t\t\t\tgotoLocation: opts.contribInfo.gotoLocation,\n\t\t\t\tselectionHighlight: (accessibilityIsOn ? false : opts.contribInfo.selectionHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\toccurrencesHighlight: (accessibilityIsOn ? false : opts.contribInfo.occurrencesHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\tcodeLens: (accessibilityIsOn ? false : opts.contribInfo.codeLens), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\tfolding: (accessibilityIsOn ? false : opts.contribInfo.folding), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\tfoldingStrategy: opts.contribInfo.foldingStrategy,\n\t\t\t\tshowFoldingControls: opts.contribInfo.showFoldingControls,\n\t\t\t\tmatchBrackets: (accessibilityIsOn ? false : opts.contribInfo.matchBrackets), // DISABLED WHEN SCREEN READER IS ATTACHED\n\t\t\t\tfind: opts.contribInfo.find,\n\t\t\t\tcolorDecorators: opts.contribInfo.colorDecorators,\n\t\t\t\tlightbulbEnabled: opts.contribInfo.lightbulbEnabled,\n\t\t\t\tcodeActionsOnSave: opts.contribInfo.codeActionsOnSave,\n\t\t\t\tcodeActionsOnSaveTimeout: opts.contribInfo.codeActionsOnSaveTimeout\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic static createInternalEditorOptions(env: IEnvironmentalOptions, _opts: IValidatedEditorOptions) {\n\n\t\tlet accessibilitySupport: AccessibilitySupport;\n\t\tif (_opts.accessibilitySupport === 'auto') {\n\t\t\t// The editor reads the `accessibilitySupport` from the environment\n\t\t\taccessibilitySupport = env.accessibilitySupport;\n\t\t} else if (_opts.accessibilitySupport === 'on') {\n\t\t\taccessibilitySupport = AccessibilitySupport.Enabled;\n\t\t} else {\n\t\t\taccessibilitySupport = AccessibilitySupport.Disabled;\n\t\t}\n\n\t\t// Disable some non critical features to get as best performance as possible\n\t\t// See https://github.com/Microsoft/vscode/issues/26730\n\t\tconst opts = this._tweakValidatedOptions(_opts, accessibilitySupport);\n\n\t\tlet lineDecorationsWidth: number;\n\t\tif (typeof opts.lineDecorationsWidth === 'string' && /^\\d+(\\.\\d+)?ch$/.test(opts.lineDecorationsWidth)) {\n\t\t\tconst multiple = parseFloat(opts.lineDecorationsWidth.substr(0, opts.lineDecorationsWidth.length - 2));\n\t\t\tlineDecorationsWidth = multiple * env.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t} else {\n\t\t\tlineDecorationsWidth = _clampedInt(opts.lineDecorationsWidth, 0, 0, 1000);\n\t\t}\n\t\tif (opts.contribInfo.folding) {\n\t\t\tlineDecorationsWidth += 16;\n\t\t}\n\n\t\tconst layoutInfo = EditorLayoutProvider.compute({\n\t\t\touterWidth: env.outerWidth,\n\t\t\touterHeight: env.outerHeight,\n\t\t\tshowGlyphMargin: opts.viewInfo.glyphMargin,\n\t\t\tlineHeight: env.fontInfo.lineHeight,\n\t\t\tshowLineNumbers: (opts.viewInfo.renderLineNumbers !== RenderLineNumbersType.Off),\n\t\t\tlineNumbersMinChars: opts.lineNumbersMinChars,\n\t\t\tlineNumbersDigitCount: env.lineNumbersDigitCount,\n\t\t\tlineDecorationsWidth: lineDecorationsWidth,\n\t\t\ttypicalHalfwidthCharacterWidth: env.fontInfo.typicalHalfwidthCharacterWidth,\n\t\t\tmaxDigitWidth: env.fontInfo.maxDigitWidth,\n\t\t\tverticalScrollbarWidth: opts.viewInfo.scrollbar.verticalScrollbarSize,\n\t\t\thorizontalScrollbarHeight: opts.viewInfo.scrollbar.horizontalScrollbarSize,\n\t\t\tscrollbarArrowSize: opts.viewInfo.scrollbar.arrowSize,\n\t\t\tverticalScrollbarHasArrows: opts.viewInfo.scrollbar.verticalHasArrows,\n\t\t\tminimap: opts.viewInfo.minimap.enabled,\n\t\t\tminimapSide: opts.viewInfo.minimap.side,\n\t\t\tminimapRenderCharacters: opts.viewInfo.minimap.renderCharacters,\n\t\t\tminimapMaxColumn: opts.viewInfo.minimap.maxColumn,\n\t\t\tpixelRatio: env.pixelRatio\n\t\t});\n\n\t\tlet bareWrappingInfo: { isWordWrapMinified: boolean; isViewportWrapping: boolean; wrappingColumn: number; } | null = null;\n\t\t{\n\t\t\tconst wordWrap = opts.wordWrap;\n\t\t\tconst wordWrapColumn = opts.wordWrapColumn;\n\t\t\tconst wordWrapMinified = opts.wordWrapMinified;\n\n\t\t\tif (accessibilitySupport === AccessibilitySupport.Enabled) {\n\t\t\t\t// See https://github.com/Microsoft/vscode/issues/27766\n\t\t\t\t// Never enable wrapping when a screen reader is attached\n\t\t\t\t// because arrow down etc. will not move the cursor in the way\n\t\t\t\t// a screen reader expects.\n\t\t\t\tbareWrappingInfo = {\n\t\t\t\t\tisWordWrapMinified: false,\n\t\t\t\t\tisViewportWrapping: false,\n\t\t\t\t\twrappingColumn: -1\n\t\t\t\t};\n\t\t\t} else if (wordWrapMinified && env.isDominatedByLongLines) {\n\t\t\t\t// Force viewport width wrapping if model is dominated by long lines\n\t\t\t\tbareWrappingInfo = {\n\t\t\t\t\tisWordWrapMinified: true,\n\t\t\t\t\tisViewportWrapping: true,\n\t\t\t\t\twrappingColumn: Math.max(1, layoutInfo.viewportColumn)\n\t\t\t\t};\n\t\t\t} else if (wordWrap === 'on') {\n\t\t\t\tbareWrappingInfo = {\n\t\t\t\t\tisWordWrapMinified: false,\n\t\t\t\t\tisViewportWrapping: true,\n\t\t\t\t\twrappingColumn: Math.max(1, layoutInfo.viewportColumn)\n\t\t\t\t};\n\t\t\t} else if (wordWrap === 'bounded') {\n\t\t\t\tbareWrappingInfo = {\n\t\t\t\t\tisWordWrapMinified: false,\n\t\t\t\t\tisViewportWrapping: true,\n\t\t\t\t\twrappingColumn: Math.min(Math.max(1, layoutInfo.viewportColumn), wordWrapColumn)\n\t\t\t\t};\n\t\t\t} else if (wordWrap === 'wordWrapColumn') {\n\t\t\t\tbareWrappingInfo = {\n\t\t\t\t\tisWordWrapMinified: false,\n\t\t\t\t\tisViewportWrapping: false,\n\t\t\t\t\twrappingColumn: wordWrapColumn\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tbareWrappingInfo = {\n\t\t\t\t\tisWordWrapMinified: false,\n\t\t\t\t\tisViewportWrapping: false,\n\t\t\t\t\twrappingColumn: -1\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst wrappingInfo: EditorWrappingInfo = {\n\t\t\tinDiffEditor: opts.inDiffEditor,\n\t\t\tisDominatedByLongLines: env.isDominatedByLongLines,\n\t\t\tisWordWrapMinified: bareWrappingInfo.isWordWrapMinified,\n\t\t\tisViewportWrapping: bareWrappingInfo.isViewportWrapping,\n\t\t\twrappingColumn: bareWrappingInfo.wrappingColumn,\n\t\t\twrappingIndent: opts.wrappingIndent,\n\t\t\twordWrapBreakBeforeCharacters: opts.wordWrapBreakBeforeCharacters,\n\t\t\twordWrapBreakAfterCharacters: opts.wordWrapBreakAfterCharacters,\n\t\t\twordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters,\n\t\t};\n\n\t\tlet className = 'monaco-editor';\n\t\tif (opts.viewInfo.extraEditorClassName) {\n\t\t\tclassName += ' ' + opts.viewInfo.extraEditorClassName;\n\t\t}\n\t\tif (env.extraEditorClassName) {\n\t\t\tclassName += ' ' + env.extraEditorClassName;\n\t\t}\n\t\tif (opts.viewInfo.fontLigatures) {\n\t\t\tclassName += ' enable-ligatures';\n\t\t}\n\t\tif (opts.mouseStyle === 'default') {\n\t\t\tclassName += ' mouse-default';\n\t\t} else if (opts.mouseStyle === 'copy') {\n\t\t\tclassName += ' mouse-copy';\n\t\t}\n\n\t\treturn new InternalEditorOptions({\n\t\t\tcanUseLayerHinting: opts.disableLayerHinting ? false : true,\n\t\t\tpixelRatio: env.pixelRatio,\n\t\t\teditorClassName: className,\n\t\t\tlineHeight: env.fontInfo.lineHeight,\n\t\t\treadOnly: opts.readOnly,\n\t\t\taccessibilitySupport: accessibilitySupport,\n\t\t\tmultiCursorModifier: opts.multiCursorModifier,\n\t\t\tmultiCursorMergeOverlapping: opts.multiCursorMergeOverlapping,\n\t\t\twordSeparators: opts.wordSeparators,\n\t\t\tautoClosingBrackets: opts.autoClosingBrackets,\n\t\t\tautoClosingQuotes: opts.autoClosingQuotes,\n\t\t\tautoSurround: opts.autoSurround,\n\t\t\tautoIndent: opts.autoIndent,\n\t\t\tuseTabStops: opts.useTabStops,\n\t\t\ttabFocusMode: opts.readOnly ? true : env.tabFocusMode,\n\t\t\tdragAndDrop: opts.dragAndDrop,\n\t\t\temptySelectionClipboard: opts.emptySelectionClipboard && env.emptySelectionClipboard,\n\t\t\tcopyWithSyntaxHighlighting: opts.copyWithSyntaxHighlighting,\n\t\t\tlayoutInfo: layoutInfo,\n\t\t\tfontInfo: env.fontInfo,\n\t\t\tviewInfo: opts.viewInfo,\n\t\t\twrappingInfo: wrappingInfo,\n\t\t\tcontribInfo: opts.contribInfo,\n\t\t\tshowUnused: opts.showUnused,\n\t\t});\n\t}\n}\n\n/**\n * @internal\n */\nexport interface IEditorLayoutProviderOpts {\n\treadonly outerWidth: number;\n\treadonly outerHeight: number;\n\n\treadonly showGlyphMargin: boolean;\n\treadonly lineHeight: number;\n\n\treadonly showLineNumbers: boolean;\n\treadonly lineNumbersMinChars: number;\n\treadonly lineNumbersDigitCount: number;\n\n\treadonly lineDecorationsWidth: number;\n\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly maxDigitWidth: number;\n\n\treadonly verticalScrollbarWidth: number;\n\treadonly verticalScrollbarHasArrows: boolean;\n\treadonly scrollbarArrowSize: number;\n\treadonly horizontalScrollbarHeight: number;\n\n\treadonly minimap: boolean;\n\treadonly minimapSide: string;\n\treadonly minimapRenderCharacters: boolean;\n\treadonly minimapMaxColumn: number;\n\treadonly pixelRatio: number;\n}\n\n/**\n * @internal\n */\nexport class EditorLayoutProvider {\n\tpublic static compute(_opts: IEditorLayoutProviderOpts): EditorLayoutInfo {\n\t\tconst outerWidth = _opts.outerWidth | 0;\n\t\tconst outerHeight = _opts.outerHeight | 0;\n\t\tconst showGlyphMargin = _opts.showGlyphMargin;\n\t\tconst lineHeight = _opts.lineHeight | 0;\n\t\tconst showLineNumbers = _opts.showLineNumbers;\n\t\tconst lineNumbersMinChars = _opts.lineNumbersMinChars | 0;\n\t\tconst lineNumbersDigitCount = _opts.lineNumbersDigitCount | 0;\n\t\tconst lineDecorationsWidth = _opts.lineDecorationsWidth | 0;\n\t\tconst typicalHalfwidthCharacterWidth = _opts.typicalHalfwidthCharacterWidth;\n\t\tconst maxDigitWidth = _opts.maxDigitWidth;\n\t\tconst verticalScrollbarWidth = _opts.verticalScrollbarWidth | 0;\n\t\tconst verticalScrollbarHasArrows = _opts.verticalScrollbarHasArrows;\n\t\tconst scrollbarArrowSize = _opts.scrollbarArrowSize | 0;\n\t\tconst horizontalScrollbarHeight = _opts.horizontalScrollbarHeight | 0;\n\t\tconst minimap = _opts.minimap;\n\t\tconst minimapSide = _opts.minimapSide;\n\t\tconst minimapRenderCharacters = _opts.minimapRenderCharacters;\n\t\tconst minimapMaxColumn = _opts.minimapMaxColumn | 0;\n\t\tconst pixelRatio = _opts.pixelRatio;\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 renderMinimap: RenderMinimap;\n\t\tlet minimapLeft: number;\n\t\tlet minimapWidth: number;\n\t\tlet contentWidth: number;\n\t\tif (!minimap) {\n\t\t\tminimapLeft = 0;\n\t\t\tminimapWidth = 0;\n\t\t\trenderMinimap = RenderMinimap.None;\n\t\t\tcontentWidth = remainingWidth;\n\t\t} else {\n\t\t\tlet minimapCharWidth: number;\n\t\t\tif (pixelRatio >= 2) {\n\t\t\t\trenderMinimap = minimapRenderCharacters ? RenderMinimap.Large : RenderMinimap.LargeBlocks;\n\t\t\t\tminimapCharWidth = 2 / pixelRatio;\n\t\t\t} else {\n\t\t\t\trenderMinimap = minimapRenderCharacters ? RenderMinimap.Small : RenderMinimap.SmallBlocks;\n\t\t\t\tminimapCharWidth = 1 / pixelRatio;\n\t\t\t}\n\n\t\t\t// Given:\n\t\t\t// (leaving 2px for the cursor to have space after the last character)\n\t\t\t// viewportColumn = (contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth\n\t\t\t// minimapWidth = viewportColumn * minimapCharWidth\n\t\t\t// contentWidth = remainingWidth - minimapWidth\n\t\t\t// What are good values for contentWidth and minimapWidth ?\n\n\t\t\t// minimapWidth = ((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth) * minimapCharWidth\n\t\t\t// typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n\t\t\t// typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n\t\t\t// (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n\t\t\t// minimapWidth = ((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)\n\n\t\t\tminimapWidth = Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)));\n\t\t\tlet minimapColumns = minimapWidth / minimapCharWidth;\n\t\t\tif (minimapColumns > minimapMaxColumn) {\n\t\t\t\tminimapWidth = Math.floor(minimapMaxColumn * minimapCharWidth);\n\t\t\t}\n\t\t\tcontentWidth = remainingWidth - minimapWidth;\n\n\t\t\tif (minimapSide === 'left') {\n\t\t\t\tminimapLeft = 0;\n\t\t\t\tglyphMarginLeft += minimapWidth;\n\t\t\t\tlineNumbersLeft += minimapWidth;\n\t\t\t\tdecorationsLeft += minimapWidth;\n\t\t\t\tcontentLeft += minimapWidth;\n\t\t\t} else {\n\t\t\t\tminimapLeft = outerWidth - minimapWidth - verticalScrollbarWidth;\n\t\t\t}\n\t\t}\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\treturn {\n\t\t\twidth: outerWidth,\n\t\t\theight: outerHeight,\n\n\t\t\tglyphMarginLeft: glyphMarginLeft,\n\t\t\tglyphMarginWidth: glyphMarginWidth,\n\t\t\tglyphMarginHeight: outerHeight,\n\n\t\t\tlineNumbersLeft: lineNumbersLeft,\n\t\t\tlineNumbersWidth: lineNumbersWidth,\n\t\t\tlineNumbersHeight: outerHeight,\n\n\t\t\tdecorationsLeft: decorationsLeft,\n\t\t\tdecorationsWidth: lineDecorationsWidth,\n\t\t\tdecorationsHeight: outerHeight,\n\n\t\t\tcontentLeft: contentLeft,\n\t\t\tcontentWidth: contentWidth,\n\t\t\tcontentHeight: outerHeight,\n\n\t\t\trenderMinimap: renderMinimap,\n\t\t\tminimapLeft: minimapLeft,\n\t\t\tminimapWidth: minimapWidth,\n\n\t\t\tviewportColumn: viewportColumn,\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\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, \\'Droid Sans Fallback\\'';\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 EDITOR_MODEL_DEFAULTS = {\n\ttabSize: 4,\n\tindentSize: 4,\n\tinsertSpaces: true,\n\tdetectIndentation: true,\n\ttrimAutoWhitespace: true,\n\tlargeFileOptimizations: true\n};\n\n/**\n * @internal\n */\nexport const EDITOR_DEFAULTS: IValidatedEditorOptions = {\n\tinDiffEditor: false,\n\twordSeparators: USUAL_WORD_SEPARATORS,\n\tlineNumbersMinChars: 5,\n\tlineDecorationsWidth: 10,\n\treadOnly: false,\n\tmouseStyle: 'text',\n\tdisableLayerHinting: false,\n\tautomaticLayout: false,\n\twordWrap: 'off',\n\twordWrapColumn: 80,\n\twordWrapMinified: true,\n\twrappingIndent: WrappingIndent.Same,\n\twordWrapBreakBeforeCharacters: '([{‘“〈《「『【〔([{「£¥$£¥++',\n\twordWrapBreakAfterCharacters: ' \\t})]?|/&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」',\n\twordWrapBreakObtrusiveCharacters: '.',\n\tautoClosingBrackets: 'languageDefined',\n\tautoClosingQuotes: 'languageDefined',\n\tautoSurround: 'languageDefined',\n\tautoIndent: true,\n\tdragAndDrop: true,\n\temptySelectionClipboard: true,\n\tcopyWithSyntaxHighlighting: true,\n\tuseTabStops: true,\n\tmultiCursorModifier: 'altKey',\n\tmultiCursorMergeOverlapping: true,\n\taccessibilitySupport: 'auto',\n\tshowUnused: true,\n\n\tviewInfo: {\n\t\textraEditorClassName: '',\n\t\tdisableMonospaceOptimizations: false,\n\t\trulers: [],\n\t\tariaLabel: nls.localize('editorViewAccessibleLabel', \"Editor content\"),\n\t\trenderLineNumbers: RenderLineNumbersType.On,\n\t\trenderCustomLineNumbers: null,\n\t\trenderFinalNewline: true,\n\t\tselectOnLineNumbers: true,\n\t\tglyphMargin: true,\n\t\trevealHorizontalRightPadding: 30,\n\t\troundedSelection: true,\n\t\toverviewRulerLanes: 2,\n\t\toverviewRulerBorder: true,\n\t\tcursorBlinking: TextEditorCursorBlinkingStyle.Blink,\n\t\tmouseWheelZoom: false,\n\t\tcursorSmoothCaretAnimation: false,\n\t\tcursorStyle: TextEditorCursorStyle.Line,\n\t\tcursorWidth: 0,\n\t\thideCursorInOverviewRuler: false,\n\t\tscrollBeyondLastLine: true,\n\t\tscrollBeyondLastColumn: 5,\n\t\tsmoothScrolling: false,\n\t\tstopRenderingLineAfter: 10000,\n\t\trenderWhitespace: 'none',\n\t\trenderControlCharacters: false,\n\t\tfontLigatures: false,\n\t\trenderIndentGuides: true,\n\t\thighlightActiveIndentGuide: true,\n\t\trenderLineHighlight: 'line',\n\t\tscrollbar: {\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: 10,\n\t\t\thorizontalSliderSize: 10,\n\t\t\tverticalScrollbarSize: 14,\n\t\t\tverticalSliderSize: 14,\n\t\t\thandleMouseWheel: true,\n\t\t\tmouseWheelScrollSensitivity: 1,\n\t\t\tfastScrollSensitivity: 5,\n\t\t},\n\t\tminimap: {\n\t\t\tenabled: true,\n\t\t\tside: 'right',\n\t\t\tshowSlider: 'mouseover',\n\t\t\trenderCharacters: true,\n\t\t\tmaxColumn: 120\n\t\t},\n\t\tfixedOverflowWidgets: false,\n\t},\n\n\tcontribInfo: {\n\t\tselectionClipboard: true,\n\t\thover: {\n\t\t\tenabled: true,\n\t\t\tdelay: 300,\n\t\t\tsticky: true\n\t\t},\n\t\tlinks: true,\n\t\tcontextmenu: true,\n\t\tquickSuggestions: { other: true, comments: false, strings: false },\n\t\tquickSuggestionsDelay: 10,\n\t\tparameterHints: {\n\t\t\tenabled: true,\n\t\t\tcycle: false\n\t\t},\n\t\tformatOnType: false,\n\t\tformatOnPaste: false,\n\t\tsuggestOnTriggerCharacters: true,\n\t\tacceptSuggestionOnEnter: 'on',\n\t\tacceptSuggestionOnCommitCharacter: true,\n\t\twordBasedSuggestions: true,\n\t\tsuggestSelection: 'recentlyUsed',\n\t\tsuggestFontSize: 0,\n\t\tsuggestLineHeight: 0,\n\t\ttabCompletion: 'off',\n\t\tsuggest: {\n\t\t\tfilterGraceful: true,\n\t\t\tsnippets: 'inline',\n\t\t\tsnippetsPreventQuickSuggestions: true,\n\t\t\tlocalityBonus: false,\n\t\t\tshareSuggestSelections: false,\n\t\t\tshowIcons: true,\n\t\t\tmaxVisibleSuggestions: 12,\n\t\t\tfilteredTypes: Object.create(null)\n\t\t},\n\t\tgotoLocation: {\n\t\t\tmultiple: 'peek'\n\t\t},\n\t\tselectionHighlight: true,\n\t\toccurrencesHighlight: true,\n\t\tcodeLens: true,\n\t\tfolding: true,\n\t\tfoldingStrategy: 'auto',\n\t\tshowFoldingControls: 'mouseover',\n\t\tmatchBrackets: true,\n\t\tfind: {\n\t\t\tseedSearchStringFromSelection: true,\n\t\t\tautoFindInSelection: false,\n\t\t\tglobalFindClipboard: false,\n\t\t\taddExtraSpaceOnTop: true\n\t\t},\n\t\tcolorDecorators: true,\n\t\tlightbulbEnabled: true,\n\t\tcodeActionsOnSave: {},\n\t\tcodeActionsOnSaveTimeout: 750\n\t},\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { EDITOR_FONT_DEFAULTS } 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 * Font settings maximum and minimum limits\n */\nconst MINIMUM_FONT_SIZE = 8;\nconst MAXIMUM_FONT_SIZE = 100;\nconst MINIMUM_LINE_HEIGHT = 8;\nconst MAXIMUM_LINE_HEIGHT = 150;\nconst MINIMUM_LETTER_SPACING = -5;\nconst MAXIMUM_LETTER_SPACING = 20;\n\nfunction safeParseFloat(n: number | string | undefined, defaultValue: number): number {\n\tif (typeof n === 'number') {\n\t\treturn n;\n\t}\n\tif (typeof n === 'undefined') {\n\t\treturn defaultValue;\n\t}\n\tlet r = parseFloat(n);\n\tif (isNaN(r)) {\n\t\treturn defaultValue;\n\t}\n\treturn r;\n}\n\nfunction safeParseInt(n: number | string | undefined, defaultValue: number): number {\n\tif (typeof n === 'number') {\n\t\treturn Math.round(n);\n\t}\n\tif (typeof n === 'undefined') {\n\t\treturn defaultValue;\n\t}\n\tlet r = parseInt(n);\n\tif (isNaN(r)) {\n\t\treturn defaultValue;\n\t}\n\treturn r;\n}\n\nfunction clamp(n: number, min: number, max: number): number {\n\tif (n < min) {\n\t\treturn min;\n\t}\n\tif (n > max) {\n\t\treturn max;\n\t}\n\treturn n;\n}\n\nfunction _string(value: any, defaultValue: string): string {\n\tif (typeof value !== 'string') {\n\t\treturn defaultValue;\n\t}\n\treturn value;\n}\n\nexport class BareFontInfo {\n\treadonly _bareFontInfoBrand: void;\n\n\t/**\n\t * @internal\n\t */\n\tpublic static createFromRawSettings(opts: {\n\t\tfontFamily?: string;\n\t\tfontWeight?: string;\n\t\tfontSize?: number | string;\n\t\tlineHeight?: number | string;\n\t\tletterSpacing?: number | string;\n\t}, zoomLevel: number, ignoreEditorZoom: boolean = false): BareFontInfo {\n\n\t\tlet fontFamily = _string(opts.fontFamily, EDITOR_FONT_DEFAULTS.fontFamily);\n\t\tlet fontWeight = _string(opts.fontWeight, EDITOR_FONT_DEFAULTS.fontWeight);\n\n\n\t\tlet fontSize = safeParseFloat(opts.fontSize, EDITOR_FONT_DEFAULTS.fontSize);\n\t\tfontSize = clamp(fontSize, 0, MAXIMUM_FONT_SIZE);\n\t\tif (fontSize === 0) {\n\t\t\tfontSize = EDITOR_FONT_DEFAULTS.fontSize;\n\t\t} else if (fontSize < MINIMUM_FONT_SIZE) {\n\t\t\tfontSize = MINIMUM_FONT_SIZE;\n\t\t}\n\n\t\tlet lineHeight = safeParseInt(opts.lineHeight, 0);\n\t\tlineHeight = clamp(lineHeight, 0, MAXIMUM_LINE_HEIGHT);\n\t\tif (lineHeight === 0) {\n\t\t\tlineHeight = Math.round(GOLDEN_LINE_HEIGHT_RATIO * fontSize);\n\t\t} else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\tlineHeight = MINIMUM_LINE_HEIGHT;\n\t\t}\n\n\t\tlet letterSpacing = safeParseFloat(opts.letterSpacing, 0);\n\t\tletterSpacing = clamp(letterSpacing, MINIMUM_LETTER_SPACING, MAXIMUM_LETTER_SPACING);\n\n\t\tlet 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\tzoomLevel: zoomLevel,\n\t\t\tfontFamily: fontFamily,\n\t\t\tfontWeight: fontWeight,\n\t\t\tfontSize: fontSize,\n\t\t\tlineHeight: lineHeight,\n\t\t\tletterSpacing: letterSpacing\n\t\t});\n\t}\n\n\treadonly zoomLevel: number;\n\treadonly fontFamily: string;\n\treadonly fontWeight: string;\n\treadonly fontSize: number;\n\treadonly lineHeight: number;\n\treadonly letterSpacing: number;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(opts: {\n\t\tzoomLevel: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t}) {\n\t\tthis.zoomLevel = opts.zoomLevel;\n\t\tthis.fontFamily = String(opts.fontFamily);\n\t\tthis.fontWeight = String(opts.fontWeight);\n\t\tthis.fontSize = opts.fontSize;\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.zoomLevel + '-' + this.fontFamily + '-' + this.fontWeight + '-' + this.fontSize + '-' + this.lineHeight + '-' + this.letterSpacing;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getMassagedFontFamily(): string {\n\t\tif (/[,\"']/.test(this.fontFamily)) {\n\t\t\t// Looks like the font family might be already escaped\n\t\t\treturn this.fontFamily;\n\t\t}\n\t\tif (/[+ ]/.test(this.fontFamily)) {\n\t\t\t// Wrap a font family using + or <space> with quotes\n\t\t\treturn `\"${this.fontFamily}\"`;\n\t\t}\n\n\t\treturn this.fontFamily;\n\t}\n}\n\nexport class FontInfo extends BareFontInfo {\n\treadonly _editorStylingBrand: void;\n\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 maxDigitWidth: number;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(opts: {\n\t\tzoomLevel: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\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\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.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.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.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 { fuzzyScore, fuzzyScoreGracefulAggressive, anyScore, FuzzyScorer, FuzzyScore } from 'vs/base/common/filters';\nimport { isDisposable } from 'vs/base/common/lifecycle';\nimport { CompletionList, CompletionItemProvider, CompletionItemKind } from 'vs/editor/common/modes';\nimport { CompletionItem } from './suggest';\nimport { InternalSuggestOptions, EDITOR_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { WordDistance } from 'vs/editor/contrib/suggest/wordDistance';\nimport { CharCode } from 'vs/base/common/charCode';\n\ntype StrictCompletionItem = Required<CompletionItem>;\n\n/* __GDPR__FRAGMENT__\n\t\"ICompletionStats\" : {\n\t\t\"suggestionCount\" : { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\", \"isMeasurement\": true },\n\t\t\"snippetCount\": { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\", \"isMeasurement\": true },\n\t\t\"textCount\": { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\", \"isMeasurement\": true }\n\t}\n*/\n// __GDPR__TODO__: This is a dynamically extensible structure which can not be declared statically.\nexport interface ICompletionStats {\n\tsuggestionCount: number;\n\tsnippetCount: number;\n\ttextCount: number;\n\t[name: string]: any;\n}\n\nexport class LineContext {\n\tleadingLineContent: string;\n\tcharacterCountDelta: number;\n}\n\nconst enum Refilter {\n\tNothing = 0,\n\tAll = 1,\n\tIncr = 2\n}\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 _isIncomplete: Set<CompletionItemProvider>;\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 = EDITOR_DEFAULTS.contribInfo.suggest\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 (options.snippets === 'top') {\n\t\t\tthis._snippetCompareFn = CompletionModel._compareCompletionItemsSnippetsUp;\n\t\t} else if (options.snippets === 'bottom') {\n\t\t\tthis._snippetCompareFn = CompletionModel._compareCompletionItemsSnippetsDown;\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tconst seen = new Set<CompletionList>();\n\t\tfor (const { container } of this._items) {\n\t\t\tif (!seen.has(container)) {\n\t\t\t\tseen.add(container);\n\t\t\t\tif (isDisposable(container)) {\n\t\t\t\t\tcontainer.dispose();\n\t\t\t\t}\n\t\t\t}\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 incomplete(): Set<CompletionItemProvider> {\n\t\tthis._ensureCachedState();\n\t\treturn this._isIncomplete;\n\t}\n\n\tadopt(except: Set<CompletionItemProvider>): CompletionItem[] {\n\t\tlet res = new Array<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._isIncomplete = new Set();\n\t\tthis._stats = { suggestionCount: 0, snippetCount: 0, textCount: 0 };\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\t// collect those supports that signaled having\n\t\t\t// an incomplete result\n\t\t\tif (item.container.incomplete) {\n\t\t\t\tthis._isIncomplete.add(item.provider);\n\t\t\t}\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.completion.range.startColumn;\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\titem.score = anyScore(word, wordLow, 0, item.completion.label, item.labelLow, 0);\n\t\t\t\t\titem.score[0] = match[0]; // use score from filterText\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.completion.label, 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\tthis._stats.suggestionCount++;\n\t\t\tswitch (item.completion.kind) {\n\t\t\t\tcase CompletionItemKind.Snippet: this._stats.snippetCount++; break;\n\t\t\t\tcase CompletionItemKind.Text: this._stats.textCount++; break;\n\t\t\t}\n\t\t}\n\n\t\tthis._filteredItems = target.sort(this._snippetCompareFn);\n\t\tthis._refilterKind = Refilter.Nothing;\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 * 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 gotoLineLabelValidLineAndColumn = nls.localize('gotoLineLabelValidLineAndColumn', \"Go to line {0} and character {1}\");\n\texport const gotoLineLabelValidLine = nls.localize('gotoLineLabelValidLine', \"Go to line {0}\");\n\texport const gotoLineLabelEmptyWithLineLimit = nls.localize('gotoLineLabelEmptyWithLineLimit', \"Type a line number between 1 and {0} to navigate to\");\n\texport const gotoLineLabelEmptyWithLineAndColumnLimit = nls.localize('gotoLineLabelEmptyWithLineAndColumnLimit', \"Type a character between 1 and {0} to navigate to\");\n\texport const gotoLineAriaLabel = nls.localize('gotoLineAriaLabel', \"Current Line: {0}. Go to line {1}.\");\n\texport const gotoLineActionInput = nls.localize('gotoLineActionInput', \"Type a line number, followed by an optional colon and a character number to navigate to\");\n\texport const gotoLineActionLabel = nls.localize('gotoLineActionLabel', \"Go to Line...\");\n}\n\nexport namespace QuickCommandNLS {\n\texport const ariaLabelEntryWithKey = nls.localize('ariaLabelEntryWithKey', \"{0}, {1}, commands\");\n\texport const ariaLabelEntry = nls.localize('ariaLabelEntry', \"{0}, commands\");\n\texport const quickCommandActionInput = nls.localize('quickCommandActionInput', \"Type the name of an action you want to execute\");\n\texport const quickCommandActionLabel = nls.localize('quickCommandActionLabel', \"Command Palette\");\n}\n\nexport namespace QuickOutlineNLS {\n\texport const entryAriaLabel = nls.localize('entryAriaLabel', \"{0}, symbols\");\n\texport const quickOutlineActionInput = nls.localize('quickOutlineActionInput', \"Type the name of an identifier you wish to navigate to\");\n\texport const quickOutlineActionLabel = nls.localize('quickOutlineActionLabel', \"Go to Symbol...\");\n\texport const _symbols_ = nls.localize('symbols', \"symbols ({0})\");\n\texport const _modules_ = nls.localize('modules', \"modules ({0})\");\n\texport const _class_ = nls.localize('class', \"classes ({0})\");\n\texport const _interface_ = nls.localize('interface', \"interfaces ({0})\");\n\texport const _method_ = nls.localize('method', \"methods ({0})\");\n\texport const _function_ = nls.localize('function', \"functions ({0})\");\n\texport const _property_ = nls.localize('property', \"properties ({0})\");\n\texport const _variable_ = nls.localize('variable', \"variables ({0})\");\n\texport const _variable2_ = nls.localize('variable2', \"variables ({0})\");\n\texport const _constructor_ = nls.localize('_constructor', \"constructors ({0})\");\n\texport const _call_ = nls.localize('call', \"calls ({0})\");\n}\n\nexport namespace StandaloneCodeEditorNLS {\n\texport const editorViewAccessibleLabel = nls.localize('editorViewAccessibleLabel', \"Editor content\");\n\texport const accessibilityHelpMessageIE = nls.localize('accessibilityHelpMessageIE', \"Press Ctrl+F1 for Accessibility Options.\");\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 SimpleServicesNLS {\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 { localize } from 'vs/nls';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { basename } from 'vs/base/common/resources';\nimport { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { defaultGenerator } from 'vs/base/common/idGenerator';\nimport { Range, IRange } from 'vs/editor/common/core/range';\nimport { Location, LocationLink } from 'vs/editor/common/modes';\nimport { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService';\nimport { Position } from 'vs/editor/common/core/position';\n\nexport class OneReference {\n\treadonly id: string;\n\n\tprivate readonly _onRefChanged = new Emitter<this>();\n\treadonly onRefChanged: Event<this> = this._onRefChanged.event;\n\n\tconstructor(\n\t\treadonly parent: FileReferences,\n\t\tprivate _range: IRange,\n\t\treadonly isProviderFirst: boolean\n\t) {\n\t\tthis.id = defaultGenerator.nextId();\n\t}\n\n\tget uri(): URI {\n\t\treturn this.parent.uri;\n\t}\n\n\tget range(): IRange {\n\t\treturn this._range;\n\t}\n\n\tset range(value: IRange) {\n\t\tthis._range = value;\n\t\tthis._onRefChanged.fire(this);\n\t}\n\n\tgetAriaMessage(): string {\n\t\treturn localize(\n\t\t\t'aria.oneReference', \"symbol in {0} on line {1} at column {2}\",\n\t\t\tbasename(this.uri), this.range.startLineNumber, this.range.startColumn\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\t}\n\n\tdispose(): void {\n\t\tdispose(this._modelReference);\n\t}\n\n\tpreview(range: IRange, n: number = 8): { before: string; inside: string; after: string } | 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, Number.MAX_VALUE);\n\n\t\tconst ret = {\n\t\t\tbefore: model.getValueInRange(beforeRange).replace(/^\\s+/, strings.empty),\n\t\t\tinside: model.getValueInRange(range),\n\t\t\tafter: model.getValueInRange(afterRange).replace(/\\s+$/, strings.empty)\n\t\t};\n\n\t\treturn ret;\n\t}\n}\n\nexport class FileReferences implements IDisposable {\n\n\tprivate _children: OneReference[];\n\tprivate _preview?: FilePreview;\n\tprivate _resolved: boolean;\n\tprivate _loadFailure: any;\n\n\tconstructor(private readonly _parent: ReferencesModel, private readonly _uri: URI) {\n\t\tthis._children = [];\n\t}\n\n\tget id(): string {\n\t\treturn this._uri.toString();\n\t}\n\n\tget parent(): ReferencesModel {\n\t\treturn this._parent;\n\t}\n\n\tget children(): OneReference[] {\n\t\treturn this._children;\n\t}\n\n\tget uri(): URI {\n\t\treturn this._uri;\n\t}\n\n\tget preview(): FilePreview | undefined {\n\t\treturn this._preview;\n\t}\n\n\tget failure(): any {\n\t\treturn this._loadFailure;\n\t}\n\n\tgetAriaMessage(): 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\tresolve(textModelResolverService: ITextModelService): Promise<FileReferences> {\n\n\t\tif (this._resolved) {\n\t\t\treturn Promise.resolve(this);\n\t\t}\n\n\t\treturn Promise.resolve(textModelResolverService.createModelReference(this._uri).then(modelReference => {\n\t\t\tconst model = modelReference.object;\n\n\t\t\tif (!model) {\n\t\t\t\tmodelReference.dispose();\n\t\t\t\tthrow new Error();\n\t\t\t}\n\n\t\t\tthis._preview = new FilePreview(modelReference);\n\t\t\tthis._resolved = true;\n\t\t\treturn this;\n\n\t\t}, err => {\n\t\t\t// something wrong here\n\t\t\tthis._children = [];\n\t\t\tthis._resolved = true;\n\t\t\tthis._loadFailure = err;\n\t\t\treturn this;\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tif (this._preview) {\n\t\t\tthis._preview.dispose();\n\t\t\tthis._preview = undefined;\n\t\t}\n\t}\n}\n\nexport class ReferencesModel implements IDisposable {\n\n\tprivate readonly _disposables: IDisposable[];\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(references: LocationLink[]) {\n\t\tthis._disposables = [];\n\t\t// grouping and sorting\n\t\tconst [providersFirst] = references;\n\t\treferences.sort(ReferencesModel._compareReferences);\n\n\t\tlet current: FileReferences | undefined;\n\t\tfor (let ref of references) {\n\t\t\tif (!current || current.uri.toString() !== ref.uri.toString()) {\n\t\t\t\t// new group\n\t\t\t\tcurrent = new FileReferences(this, ref.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\n\t\t\t\t|| !Range.equalsRange(ref.range, current.children[current.children.length - 1].range)) {\n\n\t\t\t\tlet oneRef = new OneReference(current, ref.targetSelectionRange || ref.range, providersFirst === ref);\n\t\t\t\tthis._disposables.push(oneRef.onRefChanged((e) => this._onDidChangeReferenceRange.fire(e)));\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\tget empty(): boolean {\n\t\treturn this.groups.length === 0;\n\t}\n\n\tgetAriaMessage(): string {\n\t\tif (this.empty) {\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\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\tdispose(): void {\n\t\tdispose(this.groups);\n\t\tdispose(this._disposables);\n\t\tthis.groups.length = 0;\n\t\tthis._disposables.length = 0;\n\t}\n\n\tprivate static _compareReferences(a: Location, b: Location): number {\n\t\tconst auri = a.uri.toString();\n\t\tconst buri = b.uri.toString();\n\t\tif (auri < buri) {\n\t\t\treturn -1;\n\t\t} else if (auri > buri) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn Range.compareRangesUsingStarts(a.range, b.range);\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 { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\nimport { Disposable } from 'vs/base/common/lifecycle';\n\nexport class BrowserAccessibilityService extends Disposable implements IAccessibilityService {\n\n\t_serviceBrand: any;\n\n\tprivate _accessibilitySupport = AccessibilitySupport.Unknown;\n\tprivate readonly _onDidChangeAccessibilitySupport = new Emitter<void>();\n\treadonly onDidChangeAccessibilitySupport: Event<void> = this._onDidChangeAccessibilitySupport.event;\n\n\tgetAccessibilitySupport(): AccessibilitySupport {\n\t\treturn this._accessibilitySupport;\n\t}\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\nexport enum FileKind {\n\tFILE,\n\tFOLDER,\n\tROOT_FOLDER\n}\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\tctor: any;\n\tbind(): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor1<A1, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor2<A1, A2, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor1<A2, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor3<A1, A2, A3, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor2<A2, A3, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor1<A3, T>;\n\tbind(a1: A1, a2: A2, a3: A3): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor4<A1, A2, A3, A4, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor3<A2, A3, A4, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor2<A3, A4, T>;\n\tbind(a1: A1, a2: A2, a3: A3): SyncDescriptor1<A4, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor5<A1, A2, A3, A4, A5, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor4<A2, A3, A4, A5, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor3<A3, A4, A5, T>;\n\tbind(a1: A1, a2: A2, a3: A3): SyncDescriptor2<A4, A5, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4): SyncDescriptor1<A5, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor6<A1, A2, A3, A4, A5, A6, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor5<A2, A3, A4, A5, A6, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor4<A3, A4, A5, A6, T>;\n\tbind(a1: A1, a2: A2, a3: A3): SyncDescriptor3<A4, A5, A6, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4): SyncDescriptor2<A5, A6, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): SyncDescriptor1<A6, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor7<A1, A2, A3, A4, A5, A6, A7, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor6<A2, A3, A4, A5, A6, A7, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor5<A3, A4, A5, A6, A7, T>;\n\tbind(a1: A1, a2: A2, a3: A3): SyncDescriptor4<A4, A5, A6, A7, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4): SyncDescriptor3<A5, A6, A7, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): SyncDescriptor2<A6, A7, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6): SyncDescriptor1<A7, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7): SyncDescriptor0<T>;\n}\nexport interface SyncDescriptor8<A1, A2, A3, A4, A5, A6, A7, A8, T> {\n\tctor: any;\n\tbind(a1: A1): SyncDescriptor7<A2, A3, A4, A5, A6, A7, A8, T>;\n\tbind(a1: A1, a2: A2): SyncDescriptor6<A3, A4, A5, A6, A7, A8, T>;\n\tbind(a1: A1, a2: A2, a3: A3): SyncDescriptor5<A4, A5, A6, A7, A8, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4): SyncDescriptor4<A5, A6, A7, A8, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): SyncDescriptor3<A6, A7, A8, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6): SyncDescriptor2<A7, A8, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7): SyncDescriptor1<A8, T>;\n\tbind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8): SyncDescriptor0<T>;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { ServiceIdentifier, IConstructorSignature0 } from './instantiation';\n\n\nexport interface IServiceContribution<T> {\n\tid: ServiceIdentifier<T>;\n\tdescriptor: SyncDescriptor<T>;\n}\n\nconst _registry: IServiceContribution<any>[] = [];\n\nexport function registerSingleton<T>(id: ServiceIdentifier<T>, ctor: IConstructorSignature0<T>, supportsDelayedInstantiation?: boolean): void {\n\t_registry.push({ id, descriptor: new SyncDescriptor<T>(ctor, [], supportsDelayedInstantiation) });\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isEmptyObject } from 'vs/base/common/types';\nimport { forEach } from 'vs/base/common/collections';\n\nexport interface Node<T> {\n\tdata: T;\n\tincoming: { [key: string]: Node<T> };\n\toutgoing: { [key: string]: Node<T> };\n}\n\nfunction newNode<T>(data: T): Node<T> {\n\treturn {\n\t\tdata: data,\n\t\tincoming: Object.create(null),\n\t\toutgoing: Object.create(null)\n\t};\n}\n\nexport class Graph<T> {\n\n\tprivate _nodes: { [key: string]: Node<T> } = Object.create(null);\n\n\tconstructor(private _hashFn: (element: T) => string) {\n\t\t// empty\n\t}\n\n\troots(): Node<T>[] {\n\t\tconst ret: Node<T>[] = [];\n\t\tforEach(this._nodes, entry => {\n\t\t\tif (isEmptyObject(entry.value.outgoing)) {\n\t\t\t\tret.push(entry.value);\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\t\ttoNode = this.lookupOrInsertNode(to);\n\n\t\tfromNode.outgoing[this._hashFn(to)] = toNode;\n\t\ttoNode.incoming[this._hashFn(from)] = fromNode;\n\t}\n\n\tremoveNode(data: T): void {\n\t\tconst key = this._hashFn(data);\n\t\tdelete this._nodes[key];\n\t\tforEach(this._nodes, (entry) => {\n\t\t\tdelete entry.value.outgoing[key];\n\t\t\tdelete entry.value.incoming[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[key];\n\n\t\tif (!node) {\n\t\t\tnode = newNode(data);\n\t\t\tthis._nodes[key] = node;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tisEmpty(): boolean {\n\t\tfor (const _key in this._nodes) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\ttoString(): string {\n\t\tlet data: string[] = [];\n\t\tforEach(this._nodes, entry => {\n\t\t\tdata.push(`${entry.key}, (incoming)[${Object.keys(entry.value.incoming).join(', ')}], (outgoing)[${Object.keys(entry.value.outgoing).join(',')}]`);\n\t\t});\n\t\treturn data.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 { ServiceCollection } from './serviceCollection';\nimport * as descriptors from './descriptors';\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, optional: boolean }[] {\n\t\treturn ctor[DI_DEPENDENCIES] || [];\n\t}\n}\n\n// --- interfaces ------\n\nexport interface IConstructorSignature0<T> {\n\tnew(...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature1<A1, T> {\n\tnew(first: A1, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature2<A1, A2, T> {\n\tnew(first: A1, second: A2, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature3<A1, A2, A3, T> {\n\tnew(first: A1, second: A2, third: A3, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature4<A1, A2, A3, A4, T> {\n\tnew(first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature5<A1, A2, A3, A4, A5, T> {\n\tnew(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature6<A1, A2, A3, A4, A5, A6, T> {\n\tnew(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature7<A1, A2, A3, A4, A5, A6, A7, T> {\n\tnew(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface IConstructorSignature8<A1, A2, A3, A4, A5, A6, A7, A8, T> {\n\tnew(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: any; }[]): T;\n}\n\nexport interface ServicesAccessor {\n\tget<T>(id: ServiceIdentifier<T>, isOptional?: typeof optional): T;\n}\n\nexport const IInstantiationService = createDecorator<IInstantiationService>('instantiationService');\n\nexport interface IInstantiationService {\n\n\t_serviceBrand: any;\n\n\t/**\n\t * Synchronously creates an instance that is denoted by\n\t * the descriptor\n\t */\n\tcreateInstance<T>(descriptor: descriptors.SyncDescriptor0<T>): T;\n\tcreateInstance<A1, T>(descriptor: descriptors.SyncDescriptor1<A1, T>, a1: A1): T;\n\tcreateInstance<A1, A2, T>(descriptor: descriptors.SyncDescriptor2<A1, A2, T>, a1: A1, a2: A2): T;\n\tcreateInstance<A1, A2, A3, T>(descriptor: descriptors.SyncDescriptor3<A1, A2, A3, T>, a1: A1, a2: A2, a3: A3): T;\n\tcreateInstance<A1, A2, A3, A4, T>(descriptor: descriptors.SyncDescriptor4<A1, A2, A3, A4, T>, a1: A1, a2: A2, a3: A3, a4: A4): T;\n\tcreateInstance<A1, A2, A3, A4, A5, T>(descriptor: descriptors.SyncDescriptor5<A1, A2, A3, A4, A5, T>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): T;\n\tcreateInstance<A1, A2, A3, A4, A5, A6, T>(descriptor: descriptors.SyncDescriptor6<A1, A2, A3, A4, A5, A6, T>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6): T;\n\tcreateInstance<A1, A2, A3, A4, A5, A6, A7, T>(descriptor: descriptors.SyncDescriptor7<A1, A2, A3, A4, A5, A6, A7, T>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7): T;\n\tcreateInstance<A1, A2, A3, A4, A5, A6, A7, A8, T>(descriptor: descriptors.SyncDescriptor8<A1, A2, A3, A4, A5, A6, A7, A8, T>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8): T;\n\n\tcreateInstance<T>(ctor: IConstructorSignature0<T>): T;\n\tcreateInstance<A1, T>(ctor: IConstructorSignature1<A1, T>, first: A1): T;\n\tcreateInstance<A1, A2, T>(ctor: IConstructorSignature2<A1, A2, T>, first: A1, second: A2): T;\n\tcreateInstance<A1, A2, A3, T>(ctor: IConstructorSignature3<A1, A2, A3, T>, first: A1, second: A2, third: A3): T;\n\tcreateInstance<A1, A2, A3, A4, T>(ctor: IConstructorSignature4<A1, A2, A3, A4, T>, first: A1, second: A2, third: A3, fourth: A4): T;\n\tcreateInstance<A1, A2, A3, A4, A5, T>(ctor: IConstructorSignature5<A1, A2, A3, A4, A5, T>, first: A1, second: A2, third: A3, fourth: A4, fifth: A5): T;\n\tcreateInstance<A1, A2, A3, A4, A5, A6, T>(ctor: IConstructorSignature6<A1, A2, A3, A4, A5, A6, T>, first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6): T;\n\tcreateInstance<A1, A2, A3, A4, A5, A6, A7, T>(ctor: IConstructorSignature7<A1, A2, A3, A4, A5, A6, A7, T>, first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7): T;\n\tcreateInstance<A1, A2, A3, A4, A5, A6, A7, A8, T>(ctor: IConstructorSignature8<A1, A2, A3, A4, A5, A6, A7, A8, T>, first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8): T;\n\n\t/**\n\t *\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 inherts 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, optional: boolean): void {\n\tif (target[_util.DI_TARGET] === target) {\n\t\ttarget[_util.DI_DEPENDENCIES].push({ id, index, optional });\n\t} else {\n\t\ttarget[_util.DI_DEPENDENCIES] = [{ id, index, optional }];\n\t\ttarget[_util.DI_TARGET] = target;\n\t}\n}\n\n/**\n * A *only* valid way to create a {{ServiceIdentifier}}.\n */\nexport function createDecorator<T>(serviceId: string): { (...args: any[]): void; type: 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, false);\n\t};\n\n\tid.toString = () => serviceId;\n\n\t_util.serviceIds.set(serviceId, id);\n\treturn id;\n}\n\n/**\n * Mark a service dependency as optional.\n */\nexport function optional<T>(serviceIdentifier: ServiceIdentifier<T>) {\n\n\treturn function (target: Function, key: string, index: number) {\n\t\tif (arguments.length !== 3) {\n\t\t\tthrow new Error('@optional-decorator can only be used to decorate a parameter');\n\t\t}\n\t\tstoreServiceDependency(serviceIdentifier, target, index, 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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { WorkspaceEdit } from 'vs/editor/common/modes';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IBulkEditService = createDecorator<IBulkEditService>('IWorkspaceEditService');\n\n\nexport interface IBulkEditOptions {\n\teditor?: ICodeEditor;\n}\n\nexport interface IBulkEditResult {\n\tariaSummary: string;\n}\n\nexport interface IBulkEditService {\n\t_serviceBrand: any;\n\n\tapply(edit: WorkspaceEdit, options?: IBulkEditOptions): Promise<IBulkEditResult>;\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 { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';\nimport { IDecorationRenderOptions } from 'vs/editor/common/editorCommon';\nimport { IModelDecorationOptions } from 'vs/editor/common/model';\nimport { IResourceInput } from 'vs/platform/editor/common/editor';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const ICodeEditorService = createDecorator<ICodeEditorService>('codeEditorService');\n\nexport interface ICodeEditorService {\n\t_serviceBrand: any;\n\n\treadonly onCodeEditorAdd: Event<ICodeEditor>;\n\n\n\taddCodeEditor(editor: ICodeEditor): void;\n\tremoveCodeEditor(editor: ICodeEditor): void;\n\n\taddDiffEditor(editor: IDiffEditor): void;\n\tremoveDiffEditor(editor: IDiffEditor): void;\n\tlistDiffEditors(): 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\n\tregisterDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void;\n\tremoveDecorationType(key: string): void;\n\tresolveDecorationOptions(typeKey: string, writable: boolean): IModelDecorationOptions;\n\n\tgetActiveCodeEditor(): ICodeEditor | null;\n\topenCodeEditor(input: IResourceInput, 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 { URI } from 'vs/base/common/uri';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ILineChange } from 'vs/editor/common/editorCommon';\nimport { IInplaceReplaceSupportResult, TextEdit } from 'vs/editor/common/modes';\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 IDiffComputationResult {\n\tchanges: ILineChange[];\n}\n\nexport interface IEditorWorkerService {\n\t_serviceBrand: any;\n\n\tcanComputeDiff(original: URI, modified: URI): boolean;\n\tcomputeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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, IModelDecoration } from 'vs/editor/common/model';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IMarker } from 'vs/platform/markers/common/markers';\n\nexport const IMarkerDecorationsService = createDecorator<IMarkerDecorationsService>('markerDecorationsService');\n\nexport interface IMarkerDecorationsService {\n\t_serviceBrand: any;\n\n\tgetMarker(model: ITextModel, 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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { IMode, LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IModeService = createDecorator<IModeService>('modeService');\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}\n\nexport interface ILanguageSelection extends IDisposable {\n\treadonly languageIdentifier: LanguageIdentifier;\n\treadonly onDidChange: Event<LanguageIdentifier>;\n}\n\nexport interface IModeService {\n\t_serviceBrand: any;\n\n\tonDidCreateMode: Event<IMode>;\n\n\t// --- reading\n\tisRegisteredMode(mimetypeOrModeId: string): boolean;\n\tgetModeIdForLanguageName(alias: string): string | null;\n\tgetModeIdByFilepathOrFirstLine(filepath: string, firstLine?: string): string | null;\n\tgetModeId(commaSeparatedMimetypesOrCommaSeparatedIds: string): string | null;\n\tgetLanguageIdentifier(modeId: string | LanguageId): LanguageIdentifier | null;\n\n\t// --- instantiation\n\tcreate(commaSeparatedMimetypesOrCommaSeparatedIds: string | undefined): ILanguageSelection;\n\tcreateByFilepathOrFirstLine(filepath: string | null, firstLine?: string): ILanguageSelection;\n\n\ttriggerMode(commaSeparatedMimetypesOrCommaSeparatedIds: string): 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 { Event } from 'vs/base/common/event';\nimport { URI } from 'vs/base/common/uri';\nimport { ITextBufferFactory, ITextModel } from 'vs/editor/common/model';\nimport { ILanguageSelection } from 'vs/editor/common/services/modeService';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IModelService = createDecorator<IModelService>('modelService');\n\nexport interface IModelService {\n\t_serviceBrand: any;\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\tgetModel(resource: URI): ITextModel | null;\n\n\tonModelAdded: Event<ITextModel>;\n\n\tonModelRemoved: Event<ITextModel>;\n\n\tonModelModeChanged: Event<{ model: ITextModel; oldModeId: string; }>;\n}\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, Event } from 'vs/base/common/event';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { LanguageSelector, score } from 'vs/editor/common/modes/languageSelector';\nimport { shouldSynchronizeModel } from 'vs/editor/common/services/modelService';\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.exclusive;\n\t}\n}\n\nexport class LanguageFeatureRegistry<T> {\n\n\tprivate _clock: number = 0;\n\tprivate readonly _entries: Entry<T>[] = [];\n\tprivate readonly _onDidChange = new Emitter<number>();\n\n\tconstructor() {\n\t}\n\n\tget onDidChange(): Event<number> {\n\t\treturn this._onDidChange.event;\n\t}\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\tlet 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; } | undefined;\n\n\tprivate _updateScores(model: ITextModel): void {\n\n\t\tlet candidate = {\n\t\t\turi: model.uri.toString(),\n\t\t\tlanguage: model.getLanguageIdentifier().language\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\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.getLanguageIdentifier().language, shouldSynchronizeModel(model));\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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Event } from 'vs/base/common/event';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { isObject } from 'vs/base/common/types';\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 { Selection } from 'vs/editor/common/core/selection';\nimport { TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token';\nimport * as model from 'vs/editor/common/model';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/modes/languageFeatureRegistry';\nimport { TokenizationRegistryImpl } from 'vs/editor/common/modes/tokenizationRegistry';\nimport { IMarkerData } from 'vs/platform/markers/common/markers';\nimport { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';\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 * @internal\n */\nexport class LanguageIdentifier {\n\n\t/**\n\t * A string identifier. Unique across languages. e.g. 'javascript'.\n\t */\n\tpublic readonly language: string;\n\n\t/**\n\t * A numeric identifier. Unique across languages. e.g. 5\n\t * Will vary at runtime based on registration order, etc.\n\t */\n\tpublic readonly id: LanguageId;\n\n\tconstructor(language: string, id: LanguageId) {\n\t\tthis.language = language;\n\t\tthis.id = id;\n\t}\n}\n\n/**\n * A mode. Will soon be obsolete.\n * @internal\n */\nexport interface IMode {\n\n\tgetId(): string;\n\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}\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. Values are 2^x such that a bit mask can be used.\n * @internal\n */\nexport const enum StandardTokenType {\n\tOther = 0,\n\tComment = 1,\n\tString = 2,\n\tRegEx = 4\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 FTTT LLLL LLLL\n * - -------------------------------------------\n * - L = LanguageId (8 bits)\n * - T = StandardTokenType (3 bits)\n * - F = FontStyle (3 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 = 0b00000000000000000000011100000000,\n\tFONT_STYLE_MASK = 0b00000000000000000011100000000000,\n\tFOREGROUND_MASK = 0b00000000011111111100000000000000,\n\tBACKGROUND_MASK = 0b11111111100000000000000000000000,\n\n\tLANGUAGEID_OFFSET = 0,\n\tTOKEN_TYPE_OFFSET = 8,\n\tFONT_STYLE_OFFSET = 11,\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\tlet foreground = this.getForeground(metadata);\n\t\tlet className = 'mtk' + foreground;\n\n\t\tlet 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\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\tif (fontStyle & FontStyle.Underline) {\n\t\t\tresult += 'text-decoration: underline;';\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ITokenizationSupport {\n\n\tgetInitialState(): IState;\n\n\t// add offsetDelta to each of the returned indices\n\ttokenize(line: string, state: IState, offsetDelta: number): TokenizationResult;\n\n\ttokenize2(line: string, state: IState, offsetDelta: number): TokenizationResult2;\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 [`HoverProvider`](#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\tSnippet, // <- highest value (used for compare!)\n}\n\n/**\n * @internal\n */\nexport const completionKindToCssClass = (function () {\n\tlet data = Object.create(null);\n\tdata[CompletionItemKind.Method] = 'method';\n\tdata[CompletionItemKind.Function] = 'function';\n\tdata[CompletionItemKind.Constructor] = 'constructor';\n\tdata[CompletionItemKind.Field] = 'field';\n\tdata[CompletionItemKind.Variable] = 'variable';\n\tdata[CompletionItemKind.Class] = 'class';\n\tdata[CompletionItemKind.Struct] = 'struct';\n\tdata[CompletionItemKind.Interface] = 'interface';\n\tdata[CompletionItemKind.Module] = 'module';\n\tdata[CompletionItemKind.Property] = 'property';\n\tdata[CompletionItemKind.Event] = 'event';\n\tdata[CompletionItemKind.Operator] = 'operator';\n\tdata[CompletionItemKind.Unit] = 'unit';\n\tdata[CompletionItemKind.Value] = 'value';\n\tdata[CompletionItemKind.Constant] = 'constant';\n\tdata[CompletionItemKind.Enum] = 'enum';\n\tdata[CompletionItemKind.EnumMember] = 'enum-member';\n\tdata[CompletionItemKind.Keyword] = 'keyword';\n\tdata[CompletionItemKind.Snippet] = 'snippet';\n\tdata[CompletionItemKind.Text] = 'text';\n\tdata[CompletionItemKind.Color] = 'color';\n\tdata[CompletionItemKind.File] = 'file';\n\tdata[CompletionItemKind.Reference] = 'reference';\n\tdata[CompletionItemKind.Customcolor] = 'customcolor';\n\tdata[CompletionItemKind.Folder] = 'folder';\n\tdata[CompletionItemKind.TypeParameter] = 'type-parameter';\n\n\treturn function (kind: CompletionItemKind) {\n\t\treturn data[kind] || 'property';\n\t};\n})();\n\n/**\n * @internal\n */\nexport let completionKindFromString: {\n\t(value: string): CompletionItemKind;\n\t(value: string, strict: true): CompletionItemKind | undefined;\n} = (function () {\n\tlet data: Record<string, CompletionItemKind> = Object.create(null);\n\tdata['method'] = CompletionItemKind.Method;\n\tdata['function'] = CompletionItemKind.Function;\n\tdata['constructor'] = <any>CompletionItemKind.Constructor;\n\tdata['field'] = CompletionItemKind.Field;\n\tdata['variable'] = CompletionItemKind.Variable;\n\tdata['class'] = CompletionItemKind.Class;\n\tdata['struct'] = CompletionItemKind.Struct;\n\tdata['interface'] = CompletionItemKind.Interface;\n\tdata['module'] = CompletionItemKind.Module;\n\tdata['property'] = CompletionItemKind.Property;\n\tdata['event'] = CompletionItemKind.Event;\n\tdata['operator'] = CompletionItemKind.Operator;\n\tdata['unit'] = CompletionItemKind.Unit;\n\tdata['value'] = CompletionItemKind.Value;\n\tdata['constant'] = CompletionItemKind.Constant;\n\tdata['enum'] = CompletionItemKind.Enum;\n\tdata['enum-member'] = CompletionItemKind.EnumMember;\n\tdata['enumMember'] = CompletionItemKind.EnumMember;\n\tdata['keyword'] = CompletionItemKind.Keyword;\n\tdata['snippet'] = CompletionItemKind.Snippet;\n\tdata['text'] = CompletionItemKind.Text;\n\tdata['color'] = CompletionItemKind.Color;\n\tdata['file'] = CompletionItemKind.File;\n\tdata['reference'] = CompletionItemKind.Reference;\n\tdata['customcolor'] = CompletionItemKind.Customcolor;\n\tdata['folder'] = CompletionItemKind.Folder;\n\tdata['type-parameter'] = CompletionItemKind.TypeParameter;\n\tdata['typeParameter'] = CompletionItemKind.TypeParameter;\n\n\treturn function (value: string, strict?: true) {\n\t\tlet res = data[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 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\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;\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 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 [label](#CompletionItem.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 [label](#CompletionItem.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 * is used.\n\t */\n\tinsertText: string;\n\t/**\n\t * Addition 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 [current word](#TextDocument.getWordRangeAtPosition) to the\n\t * current position.\n\t *\n\t * *Note:* The range must be a [single line](#Range.isSingleLine) and it must\n\t * [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems).\n\t */\n\trange: IRange;\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?: model.ISingleEditOperation[];\n\t/**\n\t * A command that should be run upon acceptance of this item.\n\t */\n\tcommand?: Command;\n\n\t/**\n\t * @internal\n\t */\n\t[key: string]: any;\n}\n\nexport interface CompletionList {\n\tsuggestions: CompletionItem[];\n\tincomplete?: boolean;\n\tdispose?(): void;\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 * [completion provider](#CompletionItemProvider.provideCompletionItems) 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 [label](#CompletionItem.label) from the\n * [provideCompletionItems](#CompletionItemProvider.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 [doc-comment](#CompletionItem.documentation) or [details](#CompletionItem.detail).\n */\nexport interface CompletionItemProvider {\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 [doc-comment](#CompletionItem.documentation)\n\t * or [details](#CompletionItem.detail).\n\t *\n\t * The editor will only resolve a completion item once.\n\t */\n\tresolveCompletionItem?(model: model.ITextModel, position: Position, item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;\n}\n\nexport interface CodeAction {\n\ttitle: string;\n\tcommand?: Command;\n\tedit?: WorkspaceEdit;\n\tdiagnostics?: IMarkerData[];\n\tkind?: string;\n\tisPreferred?: boolean;\n}\n\n/**\n * @internal\n */\nexport const enum CodeActionTrigger {\n\tAutomatic = 1,\n\tManual = 2,\n}\n\n/**\n * @internal\n */\nexport interface CodeActionContext {\n\tonly?: string;\n\ttrigger: CodeActionTrigger;\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\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<CodeAction[]>;\n\n\t/**\n\t * Optional list of CodeActionKinds that this provider returns.\n\t */\n\tprovidedCodeActionKinds?: ReadonlyArray<string>;\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}\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 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<SignatureHelp>;\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 [text](#DocumentHighlightKind.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 * 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\n\n/**\n * @internal\n */\nexport const symbolKindToCssClass = (function () {\n\n\tconst _fromMapping: { [n: number]: string } = Object.create(null);\n\t_fromMapping[SymbolKind.File] = 'file';\n\t_fromMapping[SymbolKind.Module] = 'module';\n\t_fromMapping[SymbolKind.Namespace] = 'namespace';\n\t_fromMapping[SymbolKind.Package] = 'package';\n\t_fromMapping[SymbolKind.Class] = 'class';\n\t_fromMapping[SymbolKind.Method] = 'method';\n\t_fromMapping[SymbolKind.Property] = 'property';\n\t_fromMapping[SymbolKind.Field] = 'field';\n\t_fromMapping[SymbolKind.Constructor] = 'constructor';\n\t_fromMapping[SymbolKind.Enum] = 'enum';\n\t_fromMapping[SymbolKind.Interface] = 'interface';\n\t_fromMapping[SymbolKind.Function] = 'function';\n\t_fromMapping[SymbolKind.Variable] = 'variable';\n\t_fromMapping[SymbolKind.Constant] = 'constant';\n\t_fromMapping[SymbolKind.String] = 'string';\n\t_fromMapping[SymbolKind.Number] = 'number';\n\t_fromMapping[SymbolKind.Boolean] = 'boolean';\n\t_fromMapping[SymbolKind.Array] = 'array';\n\t_fromMapping[SymbolKind.Object] = 'object';\n\t_fromMapping[SymbolKind.Key] = 'key';\n\t_fromMapping[SymbolKind.Null] = 'null';\n\t_fromMapping[SymbolKind.EnumMember] = 'enum-member';\n\t_fromMapping[SymbolKind.Struct] = 'struct';\n\t_fromMapping[SymbolKind.Event] = 'event';\n\t_fromMapping[SymbolKind.Operator] = 'operator';\n\t_fromMapping[SymbolKind.TypeParameter] = 'type-parameter';\n\n\treturn function toCssClassName(kind: SymbolKind, inline?: boolean): string {\n\t\treturn `symbol-icon ${inline ? 'inline' : 'block'} ${_fromMapping[kind] || 'property'}`;\n\t};\n})();\n\nexport interface DocumentSymbol {\n\tname: string;\n\tdetail: string;\n\tkind: SymbolKind;\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#_goto-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}\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 [edit](#TextEdit) 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 [text edits](#TextEdit) 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\tkind: string;\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 colors for editor models.\n */\nexport interface FoldingRangeProvider {\n\t/**\n\t * Provides the color 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 [Kind](#FoldingRangeKind) of the folding range such as [Comment](#FoldingRangeKind.Comment) or\n\t * [Region](#FoldingRangeKind.Region). The kind is used to categorize folding ranges and used by commands\n\t * like 'Fold all comments'. See\n\t * [FoldingRangeKind](#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 [FoldingRangeKind](#FoldingRangeKind).\n\t *\n\t * @param value of the kind.\n\t */\n\tpublic constructor(public value: string) {\n\t}\n}\n\n/**\n * @internal\n */\nexport function isResourceTextEdit(thing: any): thing is ResourceTextEdit {\n\treturn isObject(thing) && (<ResourceTextEdit>thing).resource && Array.isArray((<ResourceTextEdit>thing).edits);\n}\n\nexport interface ResourceFileEdit {\n\toldUri: URI;\n\tnewUri: URI;\n\toptions: { overwrite?: boolean, ignoreIfNotExists?: boolean, ignoreIfExists?: boolean, recursive?: boolean };\n}\n\nexport interface ResourceTextEdit {\n\tresource: URI;\n\tmodelVersionId?: number;\n\tedits: TextEdit[];\n}\n\nexport interface WorkspaceEdit {\n\tedits: Array<ResourceTextEdit | ResourceFileEdit>;\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\n\nexport interface Command {\n\tid: string;\n\ttitle: string;\n\ttooltip?: string;\n\targuments?: any[];\n}\n\nexport interface ICodeLensSymbol {\n\trange: IRange;\n\tid?: string;\n\tcommand?: Command;\n}\nexport interface CodeLensProvider {\n\tonDidChange?: Event<this>;\n\tprovideCodeLenses(model: model.ITextModel, token: CancellationToken): ProviderResult<ICodeLensSymbol[]>;\n\tresolveCodeLens?(model: model.ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ProviderResult<ICodeLensSymbol>;\n}\n\n// --- feature registries ------\n\n/**\n * @internal\n */\nexport const ReferenceProviderRegistry = new LanguageFeatureRegistry<ReferenceProvider>();\n\n/**\n * @internal\n */\nexport const RenameProviderRegistry = new LanguageFeatureRegistry<RenameProvider>();\n\n/**\n * @internal\n */\nexport const CompletionProviderRegistry = new LanguageFeatureRegistry<CompletionItemProvider>();\n\n/**\n * @internal\n */\nexport const SignatureHelpProviderRegistry = new LanguageFeatureRegistry<SignatureHelpProvider>();\n\n/**\n * @internal\n */\nexport const HoverProviderRegistry = new LanguageFeatureRegistry<HoverProvider>();\n\n/**\n * @internal\n */\nexport const DocumentSymbolProviderRegistry = new LanguageFeatureRegistry<DocumentSymbolProvider>();\n\n/**\n * @internal\n */\nexport const DocumentHighlightProviderRegistry = new LanguageFeatureRegistry<DocumentHighlightProvider>();\n\n/**\n * @internal\n */\nexport const DefinitionProviderRegistry = new LanguageFeatureRegistry<DefinitionProvider>();\n\n/**\n * @internal\n */\nexport const DeclarationProviderRegistry = new LanguageFeatureRegistry<DeclarationProvider>();\n\n/**\n * @internal\n */\nexport const ImplementationProviderRegistry = new LanguageFeatureRegistry<ImplementationProvider>();\n\n/**\n * @internal\n */\nexport const TypeDefinitionProviderRegistry = new LanguageFeatureRegistry<TypeDefinitionProvider>();\n\n/**\n * @internal\n */\nexport const CodeLensProviderRegistry = new LanguageFeatureRegistry<CodeLensProvider>();\n\n/**\n * @internal\n */\nexport const CodeActionProviderRegistry = new LanguageFeatureRegistry<CodeActionProvider>();\n\n/**\n * @internal\n */\nexport const DocumentFormattingEditProviderRegistry = new LanguageFeatureRegistry<DocumentFormattingEditProvider>();\n\n/**\n * @internal\n */\nexport const DocumentRangeFormattingEditProviderRegistry = new LanguageFeatureRegistry<DocumentRangeFormattingEditProvider>();\n\n/**\n * @internal\n */\nexport const OnTypeFormattingEditProviderRegistry = new LanguageFeatureRegistry<OnTypeFormattingEditProvider>();\n\n/**\n * @internal\n */\nexport const LinkProviderRegistry = new LanguageFeatureRegistry<LinkProvider>();\n\n/**\n * @internal\n */\nexport const ColorProviderRegistry = new LanguageFeatureRegistry<DocumentColorProvider>();\n\n/**\n * @internal\n */\nexport const SelectionRangeRegistry = new LanguageFeatureRegistry<SelectionRangeProvider>();\n\n/**\n * @internal\n */\nexport const FoldingRangeProviderRegistry = new LanguageFeatureRegistry<FoldingRangeProvider>();\n\n/**\n * @internal\n */\nexport interface ITokenizationSupportChangedEvent {\n\tchangedLanguages: string[];\n\tchangedColorMap: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ITokenizationRegistry {\n}\n\n/**\n * @internal\n */\nexport const TokenizationRegistry = 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 { ColorId, LanguageId, StandardTokenType, TokenMetadata } from 'vs/editor/common/modes';\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\tfindTokenIndexAtOffset(offset: number): number;\n}\n\nexport class LineTokens implements IViewLineTokens {\n\t_lineTokensBrand: void;\n\n\tprivate readonly _tokens: Uint32Array;\n\tprivate readonly _tokensCount: number;\n\tprivate readonly _text: string;\n\n\tconstructor(tokens: Uint32Array, text: string) {\n\t\tthis._tokens = tokens;\n\t\tthis._tokensCount = (this._tokens.length >>> 1);\n\t\tthis._text = text;\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 getLanguageId(tokenIndex: number): LanguageId {\n\t\tconst metadata = this._tokens[(tokenIndex << 1) + 1];\n\t\treturn TokenMetadata.getLanguageId(metadata);\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 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 SlicedLineTokens(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\tlet mid = low + Math.floor((high - low) / 2);\n\t\t\tlet 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\nexport class SlicedLineTokens 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 equals(other: IViewLineTokens): boolean {\n\t\tif (other instanceof SlicedLineTokens) {\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 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 { Token, TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token';\nimport { ColorId, FontStyle, IState, LanguageId, LanguageIdentifier, MetadataConsts, StandardTokenType } from 'vs/editor/common/modes';\n\nclass NullStateImpl implements IState {\n\n\tpublic clone(): IState {\n\t\treturn this;\n\t}\n\n\tpublic equals(other: IState): boolean {\n\t\treturn (this === other);\n\t}\n}\n\nexport const NULL_STATE: IState = new NullStateImpl();\n\nexport const NULL_MODE_ID = 'vs.editor.nullMode';\n\nexport const NULL_LANGUAGE_IDENTIFIER = new LanguageIdentifier(NULL_MODE_ID, LanguageId.Null);\n\nexport function nullTokenize(modeId: string, buffer: string, state: IState, deltaOffset: number): TokenizationResult {\n\treturn new TokenizationResult([new Token(deltaOffset, '', modeId)], state);\n}\n\nexport function nullTokenize2(languageId: LanguageId, buffer: string, state: IState | null, deltaOffset: number): TokenizationResult2 {\n\tlet tokens = new Uint32Array(2);\n\ttokens[0] = deltaOffset;\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 TokenizationResult2(tokens, state === null ? NULL_STATE : 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 * as arrays from 'vs/base/common/arrays';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { LineTokens } from 'vs/editor/common/core/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { TokenizationResult2 } from 'vs/editor/common/core/token';\nimport { ITextBuffer } from 'vs/editor/common/model';\nimport { IModelTokensChangedEvent } from 'vs/editor/common/model/textModelEvents';\nimport { ColorId, FontStyle, IState, ITokenizationSupport, LanguageId, LanguageIdentifier, MetadataConsts, StandardTokenType, TokenMetadata } from 'vs/editor/common/modes';\nimport { nullTokenize2 } from 'vs/editor/common/modes/nullMode';\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\nconst EMPTY_LINE_TOKENS = (new Uint32Array(0)).buffer;\n\nclass ModelLineTokens {\n\t_state: IState | null;\n\t_lineTokens: ArrayBuffer | null;\n\t_invalid: boolean;\n\n\tconstructor(state: IState | null) {\n\t\tthis._state = state;\n\t\tthis._lineTokens = null;\n\t\tthis._invalid = true;\n\t}\n\n\tpublic deleteBeginning(toChIndex: number): void {\n\t\tif (this._lineTokens === null || this._lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn;\n\t\t}\n\t\tthis.delete(0, toChIndex);\n\t}\n\n\tpublic deleteEnding(fromChIndex: number): void {\n\t\tif (this._lineTokens === null || this._lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokens = new Uint32Array(this._lineTokens);\n\t\tconst lineTextLength = tokens[tokens.length - 2];\n\t\tthis.delete(fromChIndex, lineTextLength);\n\t}\n\n\tpublic delete(fromChIndex: number, toChIndex: number): void {\n\t\tif (this._lineTokens === null || this._lineTokens === EMPTY_LINE_TOKENS || fromChIndex === toChIndex) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokens = new Uint32Array(this._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\tthis._lineTokens = EMPTY_LINE_TOKENS;\n\t\t\treturn;\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;\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;\n\t\t}\n\n\t\tlet tmp = new Uint32Array(dest);\n\t\ttmp.set(tokens.subarray(0, dest), 0);\n\t\tthis._lineTokens = tmp.buffer;\n\t}\n\n\tpublic append(_otherTokens: ArrayBuffer | null): void {\n\t\tif (_otherTokens === EMPTY_LINE_TOKENS) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._lineTokens === EMPTY_LINE_TOKENS) {\n\t\t\tthis._lineTokens = _otherTokens;\n\t\t\treturn;\n\t\t}\n\t\tif (this._lineTokens === null) {\n\t\t\treturn;\n\t\t}\n\t\tif (_otherTokens === null) {\n\t\t\t// cannot determine combined line length...\n\t\t\tthis._lineTokens = null;\n\t\t\treturn;\n\t\t}\n\t\tconst myTokens = new Uint32Array(this._lineTokens);\n\t\tconst otherTokens = new Uint32Array(_otherTokens);\n\t\tconst otherTokensCount = (otherTokens.length >>> 1);\n\n\t\tlet 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\tthis._lineTokens = result.buffer;\n\t}\n\n\tpublic insert(chIndex: number, textLength: number): void {\n\t\tif (!this._lineTokens) {\n\t\t\t// nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tconst tokens = new Uint32Array(this._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}\n}\n\nexport class ModelLinesTokens {\n\n\tpublic readonly languageIdentifier: LanguageIdentifier;\n\tpublic readonly tokenizationSupport: ITokenizationSupport | null;\n\tprivate _tokens: ModelLineTokens[];\n\tprivate _invalidLineStartIndex: number;\n\tprivate _lastState: IState | null;\n\n\tconstructor(languageIdentifier: LanguageIdentifier, tokenizationSupport: ITokenizationSupport | null) {\n\t\tthis.languageIdentifier = languageIdentifier;\n\t\tthis.tokenizationSupport = tokenizationSupport;\n\t\tthis._tokens = [];\n\t\tif (this.tokenizationSupport) {\n\t\t\tlet initialState: IState | null = null;\n\t\t\ttry {\n\t\t\t\tinitialState = this.tokenizationSupport.getInitialState();\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t\tthis.tokenizationSupport = null;\n\t\t\t}\n\n\t\t\tif (initialState) {\n\t\t\t\tthis._tokens[0] = new ModelLineTokens(initialState);\n\t\t\t}\n\t\t}\n\n\t\tthis._invalidLineStartIndex = 0;\n\t\tthis._lastState = null;\n\t}\n\n\tpublic get inValidLineStartIndex() {\n\t\treturn this._invalidLineStartIndex;\n\t}\n\n\tpublic getTokens(topLevelLanguageId: LanguageId, lineIndex: number, lineText: string): LineTokens {\n\t\tlet rawLineTokens: ArrayBuffer | null = null;\n\t\tif (lineIndex < this._tokens.length && this._tokens[lineIndex]) {\n\t\t\trawLineTokens = this._tokens[lineIndex]._lineTokens;\n\t\t}\n\n\t\tif (rawLineTokens !== null && rawLineTokens !== EMPTY_LINE_TOKENS) {\n\t\t\treturn new LineTokens(new Uint32Array(rawLineTokens), lineText);\n\t\t}\n\n\t\tlet lineTokens = new Uint32Array(2);\n\t\tlineTokens[0] = lineText.length;\n\t\tlineTokens[1] = getDefaultMetadata(topLevelLanguageId);\n\t\treturn new LineTokens(lineTokens, lineText);\n\t}\n\n\tpublic isCheapToTokenize(lineNumber: number): boolean {\n\t\tconst firstInvalidLineNumber = this._invalidLineStartIndex + 1;\n\t\treturn (firstInvalidLineNumber >= lineNumber);\n\t}\n\n\tpublic hasLinesToTokenize(buffer: ITextBuffer): boolean {\n\t\treturn (this._invalidLineStartIndex < buffer.getLineCount());\n\t}\n\n\tpublic invalidateLine(lineIndex: number): void {\n\t\tthis._setIsInvalid(lineIndex, true);\n\t\tif (lineIndex < this._invalidLineStartIndex) {\n\t\t\tthis._setIsInvalid(this._invalidLineStartIndex, true);\n\t\t\tthis._invalidLineStartIndex = lineIndex;\n\t\t}\n\t}\n\n\t_setIsInvalid(lineIndex: number, invalid: boolean): void {\n\t\tif (lineIndex < this._tokens.length && this._tokens[lineIndex]) {\n\t\t\tthis._tokens[lineIndex]._invalid = invalid;\n\t\t}\n\t}\n\n\t_isInvalid(lineIndex: number): boolean {\n\t\tif (lineIndex < this._tokens.length && this._tokens[lineIndex]) {\n\t\t\treturn this._tokens[lineIndex]._invalid;\n\t\t}\n\t\treturn true;\n\t}\n\n\t_getState(lineIndex: number): IState | null {\n\t\tif (lineIndex < this._tokens.length && this._tokens[lineIndex]) {\n\t\t\treturn this._tokens[lineIndex]._state;\n\t\t}\n\t\treturn null;\n\t}\n\n\t_setTokens(topLevelLanguageId: LanguageId, lineIndex: number, lineTextLength: number, tokens: Uint32Array): void {\n\t\tlet target: ModelLineTokens;\n\t\tif (lineIndex < this._tokens.length && this._tokens[lineIndex]) {\n\t\t\ttarget = this._tokens[lineIndex];\n\t\t} else {\n\t\t\ttarget = new ModelLineTokens(null);\n\t\t\tthis._tokens[lineIndex] = target;\n\t\t}\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\ttarget._lineTokens = EMPTY_LINE_TOKENS;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!tokens || tokens.length === 0) {\n\t\t\ttokens = new Uint32Array(2);\n\t\t\ttokens[0] = 0;\n\t\t\ttokens[1] = getDefaultMetadata(topLevelLanguageId);\n\t\t}\n\n\t\tLineTokens.convertToEndOffset(tokens, lineTextLength);\n\n\t\ttarget._lineTokens = tokens.buffer;\n\t}\n\n\t_setState(lineIndex: number, state: IState): void {\n\t\tif (lineIndex < this._tokens.length && this._tokens[lineIndex]) {\n\t\t\tthis._tokens[lineIndex]._state = state;\n\t\t} else {\n\t\t\tconst tmp = new ModelLineTokens(state);\n\t\t\tthis._tokens[lineIndex] = tmp;\n\t\t}\n\t}\n\n\t//#region Editing\n\n\tpublic applyEdits(range: Range, eolCount: number, firstLineLength: number): void {\n\n\t\tconst deletingLinesCnt = range.endLineNumber - range.startLineNumber;\n\t\tconst insertingLinesCnt = eolCount;\n\t\tconst editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt);\n\n\t\tfor (let j = editingLinesCnt; j >= 0; j--) {\n\t\t\tthis.invalidateLine(range.startLineNumber + j - 1);\n\t\t}\n\n\t\tthis._acceptDeleteRange(range);\n\t\tthis._acceptInsertText(new Position(range.startLineNumber, range.startColumn), eolCount, firstLineLength);\n\t}\n\n\tprivate _acceptDeleteRange(range: Range): void {\n\n\t\tconst firstLineIndex = range.startLineNumber - 1;\n\t\tif (firstLineIndex >= this._tokens.length) {\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._tokens[firstLineIndex].delete(range.startColumn - 1, range.endColumn - 1);\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstLine = this._tokens[firstLineIndex];\n\t\tfirstLine.deleteEnding(range.startColumn - 1);\n\n\t\tconst lastLineIndex = range.endLineNumber - 1;\n\t\tlet lastLineTokens: ArrayBuffer | null = null;\n\t\tif (lastLineIndex < this._tokens.length) {\n\t\t\tconst lastLine = this._tokens[lastLineIndex];\n\t\t\tlastLine.deleteBeginning(range.endColumn - 1);\n\t\t\tlastLineTokens = lastLine._lineTokens;\n\t\t}\n\n\t\t// Take remaining text on last line and append it to remaining text on first line\n\t\tfirstLine.append(lastLineTokens);\n\n\t\t// Delete middle lines\n\t\tthis._tokens.splice(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._tokens.length) {\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._tokens[lineIndex].insert(position.column - 1, firstLineLength);\n\t\t\treturn;\n\t\t}\n\n\t\tconst line = this._tokens[lineIndex];\n\t\tline.deleteEnding(position.column - 1);\n\t\tline.insert(position.column - 1, firstLineLength);\n\n\t\tlet insert: ModelLineTokens[] = new Array<ModelLineTokens>(eolCount);\n\t\tfor (let i = eolCount - 1; i >= 0; i--) {\n\t\t\tinsert[i] = new ModelLineTokens(null);\n\t\t}\n\t\tthis._tokens = arrays.arrayInsert(this._tokens, position.lineNumber, insert);\n\t}\n\n\t//#endregion\n\n\t//#region Tokenization\n\n\tpublic _tokenizeOneLine(buffer: ITextBuffer, eventBuilder: ModelTokensChangedEventBuilder): number {\n\t\tif (!this.hasLinesToTokenize(buffer)) {\n\t\t\treturn buffer.getLineCount() + 1;\n\t\t}\n\t\tconst lineNumber = this._invalidLineStartIndex + 1;\n\t\tthis._updateTokensUntilLine(buffer, eventBuilder, lineNumber);\n\t\treturn lineNumber;\n\t}\n\n\tpublic _tokenizeText(buffer: ITextBuffer, text: string, state: IState): TokenizationResult2 {\n\t\tlet r: TokenizationResult2 | null = null;\n\n\t\tif (this.tokenizationSupport) {\n\t\t\ttry {\n\t\t\t\tr = this.tokenizationSupport.tokenize2(text, state, 0);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tif (!r) {\n\t\t\tr = nullTokenize2(this.languageIdentifier.id, text, state, 0);\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic _updateTokensUntilLine(buffer: ITextBuffer, eventBuilder: ModelTokensChangedEventBuilder, lineNumber: number): void {\n\t\tif (!this.tokenizationSupport) {\n\t\t\tthis._invalidLineStartIndex = buffer.getLineCount();\n\t\t\treturn;\n\t\t}\n\n\t\tconst linesLength = buffer.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._invalidLineStartIndex; lineIndex <= endLineIndex; lineIndex++) {\n\t\t\tconst endStateIndex = lineIndex + 1;\n\t\t\tconst text = buffer.getLineContent(lineIndex + 1);\n\t\t\tconst lineStartState = this._getState(lineIndex);\n\n\t\t\tlet r: TokenizationResult2 | null = null;\n\n\t\t\ttry {\n\t\t\t\t// Tokenize only the first X characters\n\t\t\t\tlet freshState = lineStartState!.clone();\n\t\t\t\tr = this.tokenizationSupport.tokenize2(text, freshState, 0);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\n\t\t\tif (!r) {\n\t\t\t\tr = nullTokenize2(this.languageIdentifier.id, text, lineStartState, 0);\n\t\t\t}\n\t\t\tthis._setTokens(this.languageIdentifier.id, lineIndex, text.length, r.tokens);\n\t\t\teventBuilder.registerChangedTokens(lineIndex + 1);\n\t\t\tthis._setIsInvalid(lineIndex, false);\n\n\t\t\tif (endStateIndex < linesLength) {\n\t\t\t\tconst previousEndState = this._getState(endStateIndex);\n\t\t\t\tif (previousEndState !== null && r.endState.equals(previousEndState)) {\n\t\t\t\t\t// The end state of this line remains the same\n\t\t\t\t\tlet nextInvalidLineIndex = lineIndex + 1;\n\t\t\t\t\twhile (nextInvalidLineIndex < linesLength) {\n\t\t\t\t\t\tif (this._isInvalid(nextInvalidLineIndex)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nextInvalidLineIndex + 1 < linesLength) {\n\t\t\t\t\t\t\tif (this._getState(nextInvalidLineIndex + 1) === null) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (this._lastState === null) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextInvalidLineIndex++;\n\t\t\t\t\t}\n\t\t\t\t\tthis._invalidLineStartIndex = Math.max(this._invalidLineStartIndex, nextInvalidLineIndex);\n\t\t\t\t\tlineIndex = nextInvalidLineIndex - 1; // -1 because the outer loop increments it\n\t\t\t\t} else {\n\t\t\t\t\tthis._setState(endStateIndex, r.endState);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._lastState = r.endState;\n\t\t\t}\n\t\t}\n\t\tthis._invalidLineStartIndex = Math.max(this._invalidLineStartIndex, endLineIndex + 1);\n\t}\n\n\t// #endregion\n}\n\nexport class ModelTokensChangedEventBuilder {\n\n\tprivate readonly _ranges: { fromLineNumber: number; toLineNumber: number; }[];\n\n\tconstructor() {\n\t\tthis._ranges = [];\n\t}\n\n\tpublic registerChangedTokens(lineNumber: number): void {\n\t\tconst ranges = this._ranges;\n\t\tconst rangesLength = ranges.length;\n\t\tconst previousRange = rangesLength > 0 ? ranges[rangesLength - 1] : null;\n\n\t\tif (previousRange && previousRange.toLineNumber === lineNumber - 1) {\n\t\t\t// extend previous range\n\t\t\tpreviousRange.toLineNumber++;\n\t\t} else {\n\t\t\t// insert new range\n\t\t\tranges[rangesLength] = {\n\t\t\t\tfromLineNumber: lineNumber,\n\t\t\t\ttoLineNumber: lineNumber\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic build(): IModelTokensChangedEvent | null {\n\t\tif (this._ranges.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\ttokenizationSupportChanged: false,\n\t\t\tranges: this._ranges\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { StopWatch } from 'vs/base/common/stopwatch';\nimport * as strings from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { LineTokens } from 'vs/editor/common/core/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 { EditStack } from 'vs/editor/common/model/editStack';\nimport { guessIndentation } from 'vs/editor/common/model/indentationGuesser';\nimport { IntervalNode, IntervalTree, getNodeIsInOverviewRuler, recomputeMaxEnd } from 'vs/editor/common/model/intervalTree';\nimport { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder';\nimport { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent, IModelTokensChangedEvent, InternalModelContentChangeEvent, ModelRawChange, ModelRawContentChangedEvent, ModelRawEOLChanged, ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted } from 'vs/editor/common/model/textModelEvents';\nimport { SearchData, SearchParams, TextModelSearch } from 'vs/editor/common/model/textModelSearch';\nimport { ModelLinesTokens, ModelTokensChangedEventBuilder } from 'vs/editor/common/model/textModelTokens';\nimport { getWordAtText } from 'vs/editor/common/model/wordHelper';\nimport { IState, LanguageId, LanguageIdentifier, TokenizationRegistry, FormattingOptions } from 'vs/editor/common/modes';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { NULL_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/nullMode';\nimport { ignoreBracketsInToken } from 'vs/editor/common/modes/supports';\nimport { BracketsUtils, RichEditBracket, RichEditBrackets } from 'vs/editor/common/modes/supports/richEditBrackets';\nimport { ITheme, ThemeColor } from 'vs/platform/theme/common/themeService';\nimport { withUndefinedAsNull } from 'vs/base/common/types';\n\nconst CHEAP_TOKENIZATION_LENGTH_LIMIT = 2048;\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): model.ITextBuffer {\n\tconst factory = (typeof value === 'string' ? createTextBufferFactory(value) : value);\n\treturn factory.create(defaultEOL);\n}\n\nlet MODEL_ID = 0;\n\n/**\n * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.\n */\nfunction singleLetter(result: number): string {\n\tconst LETTERS_CNT = (CharCode.Z - CharCode.A + 1);\n\n\tresult = result % (2 * LETTERS_CNT);\n\n\tif (result < LETTERS_CNT) {\n\t\treturn String.fromCharCode(CharCode.a + result);\n\t}\n\n\treturn String.fromCharCode(CharCode.A + result - LETTERS_CNT);\n}\n\nconst LIMIT_FIND_COUNT = 999;\nexport const LONG_LINE_BOUNDARY = 10000;\n\nconst invalidFunc = () => { throw new Error(`Invalid change accessor`); };\n\nexport class TextModel extends Disposable implements model.ITextModel {\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};\n\n\tpublic static createFromString(text: string, options: model.ITextModelCreationOptions = TextModel.DEFAULT_CREATION_OPTIONS, languageIdentifier: LanguageIdentifier | null = null, uri: URI | null = null): TextModel {\n\t\treturn new TextModel(text, options, languageIdentifier, uri);\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});\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});\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());\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 _eventEmitter: DidChangeContentEmitter = this._register(new DidChangeContentEmitter());\n\tpublic onDidChangeRawContentFast(listener: (e: ModelRawContentChangedEvent) => void): IDisposable {\n\t\treturn this._eventEmitter.fastEvent((e: InternalModelContentChangeEvent) => listener(e.rawContentChangedEvent));\n\t}\n\tpublic onDidChangeRawContent(listener: (e: ModelRawContentChangedEvent) => void): IDisposable {\n\t\treturn this._eventEmitter.slowEvent((e: InternalModelContentChangeEvent) => listener(e.rawContentChangedEvent));\n\t}\n\tpublic onDidChangeContent(listener: (e: IModelContentChangedEvent) => void): IDisposable {\n\t\treturn this._eventEmitter.slowEvent((e: InternalModelContentChangeEvent) => listener(e.contentChangedEvent));\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 _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 readonly _isTooLargeForSyncing: boolean;\n\tprivate readonly _isTooLargeForTokenization: boolean;\n\n\t//#region Editing\n\tprivate _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\t//#endregion\n\n\t//#region Tokenization\n\tprivate _languageIdentifier: LanguageIdentifier;\n\tprivate readonly _tokenizationListener: IDisposable;\n\tprivate readonly _languageRegistryListener: IDisposable;\n\tprivate _revalidateTokensTimeout: any;\n\t/*private*/_tokens: ModelLinesTokens;\n\t//#endregion\n\n\tconstructor(source: string | model.ITextBufferFactory, creationOptions: model.ITextModelCreationOptions, languageIdentifier: LanguageIdentifier | null, associatedResource: URI | null = null) {\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\tthis._buffer = createTextBuffer(source, creationOptions.defaultEOL);\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._setVersionId(1);\n\t\tthis._isDisposed = false;\n\t\tthis._isDisposing = false;\n\n\t\tthis._languageIdentifier = languageIdentifier || NULL_LANGUAGE_IDENTIFIER;\n\t\tthis._tokenizationListener = TokenizationRegistry.onDidChange((e) => {\n\t\t\tif (e.changedLanguages.indexOf(this._languageIdentifier.language) === -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._resetTokenizationState();\n\t\t\tthis.emitModelTokensChangedEvent({\n\t\t\t\ttokenizationSupportChanged: true,\n\t\t\t\tranges: [{\n\t\t\t\t\tfromLineNumber: 1,\n\t\t\t\t\ttoLineNumber: this.getLineCount()\n\t\t\t\t}]\n\t\t\t});\n\n\t\t\tif (this._shouldAutoTokenize()) {\n\t\t\t\tthis._warmUpTokens();\n\t\t\t}\n\t\t});\n\t\tthis._revalidateTokensTimeout = -1;\n\t\tthis._languageRegistryListener = LanguageConfigurationRegistry.onDidChange((e) => {\n\t\t\tif (e.languageIdentifier.id === this._languageIdentifier.id) {\n\t\t\t\tthis._onDidChangeLanguageConfiguration.fire({});\n\t\t\t}\n\t\t});\n\t\tthis._resetTokenizationState();\n\n\t\tthis._instanceId = singleLetter(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);\n\t\tthis._isUndoing = false;\n\t\tthis._isRedoing = false;\n\t\tthis._trimAutoWhitespaceLines = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposing = true;\n\t\tthis._onWillDispose.fire();\n\t\tthis._tokenizationListener.dispose();\n\t\tthis._languageRegistryListener.dispose();\n\t\tthis._clearTimers();\n\t\tthis._isDisposed = true;\n\t\t// Null out members, such that any use of a disposed model will throw exceptions sooner rather than later\n\t\tsuper.dispose();\n\t\tthis._isDisposing = false;\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._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 = createTextBuffer(value, this._options.defaultEOL);\n\t\tthis.setValueFromTextBuffer(textBuffer);\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\tpublic setValueFromTextBuffer(textBuffer: model.ITextBuffer): void {\n\t\tthis._assertNotDisposed();\n\t\tif (textBuffer === null) {\n\t\t\t// There's nothing to do\n\t\t\treturn;\n\t\t}\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._increaseVersionId();\n\n\t\t// Cancel tokenization, clear all tokens and begin tokenizing\n\t\tthis._resetTokenizationState();\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 = new EditStack(this);\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\tconst versionId = this.getVersionId();\n\t\tconst allDecorations = this._decorationsTree.search(0, false, false, versionId);\n\t\tthis._ensureNodesHaveRanges(allDecorations);\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\n\t\t\tconst delta = node.cachedAbsoluteStart - node.start;\n\n\t\t\tconst startOffset = this._buffer.getOffsetAt(node.range.startLineNumber, node.range.startColumn);\n\t\t\tconst endOffset = this._buffer.getOffsetAt(node.range.endLineNumber, node.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\tprivate _resetTokenizationState(): void {\n\t\tthis._clearTimers();\n\t\tlet tokenizationSupport = (\n\t\t\tthis._isTooLargeForTokenization\n\t\t\t\t? null\n\t\t\t\t: TokenizationRegistry.get(this._languageIdentifier.language)\n\t\t);\n\t\tthis._tokens = new ModelLinesTokens(this._languageIdentifier, tokenizationSupport);\n\t\tthis._beginBackgroundTokenization();\n\t}\n\n\tprivate _clearTimers(): void {\n\t\tif (this._revalidateTokensTimeout !== -1) {\n\t\t\tclearTimeout(this._revalidateTokensTimeout);\n\t\t\tthis._revalidateTokensTimeout = -1;\n\t\t}\n\t}\n\n\tpublic onBeforeAttached(): void {\n\t\tthis._attachedEditorCount++;\n\t\t// Warm up tokens for the editor\n\t\tthis._warmUpTokens();\n\t}\n\n\tpublic onBeforeDetached(): void {\n\t\tthis._attachedEditorCount--;\n\t}\n\n\tprivate _shouldAutoTokenize(): boolean {\n\t\treturn this.isAttachedToEditor();\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\tlet tabSize = (typeof _newOpts.tabSize !== 'undefined') ? _newOpts.tabSize : this._options.tabSize;\n\t\tlet indentSize = (typeof _newOpts.indentSize !== 'undefined') ? _newOpts.indentSize : this._options.indentSize;\n\t\tlet insertSpaces = (typeof _newOpts.insertSpaces !== 'undefined') ? _newOpts.insertSpaces : this._options.insertSpaces;\n\t\tlet trimAutoWhitespace = (typeof _newOpts.trimAutoWhitespace !== 'undefined') ? _newOpts.trimAutoWhitespace : this._options.trimAutoWhitespace;\n\n\t\tlet 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});\n\n\t\tif (this._options.equals(newOpts)) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet e = this._options.createChangeEvent(newOpts);\n\t\tthis._options = newOpts;\n\n\t\tthis._onDidChangeOptions.fire(e);\n\t}\n\n\tpublic detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void {\n\t\tthis._assertNotDisposed();\n\t\tlet 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\tprivate static _normalizeIndentationFromWhitespace(str: string, indentSize: number, insertSpaces: boolean): string {\n\t\tlet spacesCnt = 0;\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\tif (str.charAt(i) === '\\t') {\n\t\t\t\tspacesCnt += indentSize;\n\t\t\t} else {\n\t\t\t\tspacesCnt++;\n\t\t\t}\n\t\t}\n\n\t\tlet result = '';\n\t\tif (!insertSpaces) {\n\t\t\tlet tabsCnt = Math.floor(spacesCnt / indentSize);\n\t\t\tspacesCnt = spacesCnt % indentSize;\n\t\t\tfor (let i = 0; i < tabsCnt; i++) {\n\t\t\t\tresult += '\\t';\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < spacesCnt; i++) {\n\t\t\tresult += ' ';\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic static normalizeIndentation(str: string, indentSize: number, insertSpaces: boolean): string {\n\t\tlet firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(str);\n\t\tif (firstNonWhitespaceIndex === -1) {\n\t\t\tfirstNonWhitespaceIndex = str.length;\n\t\t}\n\t\treturn TextModel._normalizeIndentationFromWhitespace(str.substring(0, firstNonWhitespaceIndex), indentSize, insertSpaces) + str.substring(firstNonWhitespaceIndex);\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\tthis._assertNotDisposed();\n\t\treturn TextModel.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 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 getOffsetAt(rawPosition: IPosition): number {\n\t\tthis._assertNotDisposed();\n\t\tlet position = this._validatePosition(rawPosition.lineNumber, rawPosition.column, false);\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\tlet 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._setVersionId(this._versionId + 1);\n\t}\n\n\tprivate _setVersionId(newVersionId: number): void {\n\t\tthis._versionId = newVersionId;\n\t\tthis._alternativeVersionId = this._versionId;\n\t}\n\n\tprivate _overwriteAlternativeVersionId(newAlternativeVersionId: number): void {\n\t\tthis._alternativeVersionId = newAlternativeVersionId;\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 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 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 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\tprivate _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: number;\n\t\tlet startColumn: number;\n\n\t\tif (initialStartLineNumber < 1) {\n\t\t\tstartLineNumber = 1;\n\t\t\tstartColumn = 1;\n\t\t} else if (initialStartLineNumber > linesCount) {\n\t\t\tstartLineNumber = linesCount;\n\t\t\tstartColumn = this.getLineMaxColumn(startLineNumber);\n\t\t} else {\n\t\t\tstartLineNumber = initialStartLineNumber | 0;\n\t\t\tif (initialStartColumn <= 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 (initialStartColumn >= maxColumn) {\n\t\t\t\t\tstartColumn = maxColumn;\n\t\t\t\t} else {\n\t\t\t\t\tstartColumn = initialStartColumn | 0;\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: number;\n\t\tlet endColumn: number;\n\n\t\tif (initialEndLineNumber < 1) {\n\t\t\tendLineNumber = 1;\n\t\t\tendColumn = 1;\n\t\t} else if (initialEndLineNumber > linesCount) {\n\t\t\tendLineNumber = linesCount;\n\t\t\tendColumn = this.getLineMaxColumn(endLineNumber);\n\t\t} else {\n\t\t\tendLineNumber = initialEndLineNumber | 0;\n\t\t\tif (initialEndColumn <= 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 (initialEndColumn >= maxColumn) {\n\t\t\t\t\tendColumn = maxColumn;\n\t\t\t\t} else {\n\t\t\t\t\tendColumn = initialEndColumn | 0;\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\t/**\n\t * @param strict Do NOT allow a position inside a high-low surrogate pair\n\t */\n\tprivate _isValidPosition(lineNumber: number, column: number, strict: boolean): 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\tconst maxColumn = this.getLineMaxColumn(lineNumber);\n\t\tif (column > maxColumn) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (strict) {\n\t\t\tif (column > 1) {\n\t\t\t\tconst charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2);\n\t\t\t\tif (strings.isHighSurrogate(charCodeBefore)) {\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\t/**\n\t * @param strict Do NOT allow a position inside a high-low surrogate pair\n\t */\n\tprivate _validatePosition(_lineNumber: number, _column: number, strict: boolean): 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 (strict) {\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\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, true)) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn this._validatePosition(position.lineNumber, position.column, true);\n\t}\n\n\t/**\n\t * @param strict Do NOT allow a range to have its boundaries inside a high-low surrogate pair\n\t */\n\tprivate _isValidRange(range: Range, strict: boolean): 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, false)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!this._isValidPosition(endLineNumber, endColumn, false)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (strict) {\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\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic validateRange(_range: IRange): Range {\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, true)) {\n\t\t\t\treturn _range;\n\t\t\t}\n\t\t}\n\n\t\tconst start = this._validatePosition(_range.startLineNumber, _range.startColumn, false);\n\t\tconst end = this._validatePosition(_range.endLineNumber, _range.endColumn, false);\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\tconst charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0);\n\t\tconst charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0);\n\n\t\tconst startInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeStart);\n\t\tconst endInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeEnd);\n\n\t\tif (!startInsideSurrogatePair && !endInsideSurrogatePair) {\n\t\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t\t}\n\n\t\tif (startLineNumber === endLineNumber && startColumn === endColumn) {\n\t\t\t// do not expand a collapsed range, simply move it to a valid location\n\t\t\treturn new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn - 1);\n\t\t}\n\n\t\tif (startInsideSurrogatePair && endInsideSurrogatePair) {\n\t\t\t// expand range at both ends\n\t\t\treturn new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn + 1);\n\t\t}\n\n\t\tif (startInsideSurrogatePair) {\n\t\t\t// only expand range at the start\n\t\t\treturn new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn);\n\t\t}\n\n\t\t// only expand range at the end\n\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn + 1);\n\t}\n\n\tpublic modifyPosition(rawPosition: IPosition, offset: number): Position {\n\t\tthis._assertNotDisposed();\n\t\tlet 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: 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, captureMatches: boolean, limitResultCount: number = LIMIT_FIND_COUNT): model.FindMatch[] {\n\t\tthis._assertNotDisposed();\n\n\t\tlet searchRange: Range;\n\t\tif (Range.isIRange(rawSearchScope)) {\n\t\t\tsearchRange = this.validateRange(rawSearchScope);\n\t\t} else {\n\t\t\tsearchRange = this.getFullModelRange();\n\t\t}\n\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\treturn this.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount);\n\t\t}\n\n\t\treturn TextModelSearch.findMatches(this, new SearchParams(searchString, isRegex, matchCase, wordSeparators), searchRange, captureMatches, limitResultCount);\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 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\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\tpublic pushEditOperations(beforeCursorState: Selection[], 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, 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[], editOperations: model.IIdentifiedSingleEditOperation[], 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\tlet 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\tfor (let i = 0, len = beforeCursorState.length; i < len; i++) {\n\t\t\t\tlet sel = beforeCursorState[i];\n\t\t\t\tlet foundEditNearSel = false;\n\t\t\t\tfor (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) {\n\t\t\t\t\tlet editRange = incomingEdits[j].range;\n\t\t\t\t\tlet selIsAbove = editRange.startLineNumber > sel.endLineNumber;\n\t\t\t\t\tlet selIsBelow = sel.startLineNumber > editRange.endLineNumber;\n\t\t\t\t\tif (!selIsAbove && !selIsBelow) {\n\t\t\t\t\t\tfoundEditNearSel = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!foundEditNearSel) {\n\t\t\t\t\teditsAreNearCursors = false;\n\t\t\t\t\tbreak;\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\tlet trimLineNumber = this._trimAutoWhitespaceLines[i];\n\t\t\t\t\tlet 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\tlet editRange = incomingEdits[j].range;\n\t\t\t\t\t\tlet 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\teditOperations.push({\n\t\t\t\t\t\t\trange: new Range(trimLineNumber, 1, trimLineNumber, maxLineColumn),\n\t\t\t\t\t\t\ttext: null\n\t\t\t\t\t\t});\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\treturn this._commandManager.pushEditOperation(beforeCursorState, editOperations, cursorStateComputer);\n\t}\n\n\tpublic applyEdits(rawOperations: model.IIdentifiedSingleEditOperation[]): model.IIdentifiedSingleEditOperation[] {\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\treturn this._applyEdits(rawOperations);\n\t\t} finally {\n\t\t\tthis._eventEmitter.endDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tprivate static _eolCount(text: string): [number, number] {\n\t\tlet eolCount = 0;\n\t\tlet firstLineLength = 0;\n\t\tfor (let i = 0, len = text.length; i < len; i++) {\n\t\t\tconst chr = text.charCodeAt(i);\n\n\t\t\tif (chr === CharCode.CarriageReturn) {\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\tfirstLineLength = i;\n\t\t\t\t}\n\t\t\t\teolCount++;\n\t\t\t\tif (i + 1 < len && text.charCodeAt(i + 1) === CharCode.LineFeed) {\n\t\t\t\t\t// \\r\\n... case\n\t\t\t\t\ti++; // skip \\n\n\t\t\t\t} else {\n\t\t\t\t\t// \\r... case\n\t\t\t\t}\n\t\t\t} else if (chr === CharCode.LineFeed) {\n\t\t\t\tif (eolCount === 0) {\n\t\t\t\t\tfirstLineLength = i;\n\t\t\t\t}\n\t\t\t\teolCount++;\n\t\t\t}\n\t\t}\n\t\tif (eolCount === 0) {\n\t\t\tfirstLineLength = text.length;\n\t\t}\n\t\treturn [eolCount, firstLineLength];\n\t}\n\n\tprivate _applyEdits(rawOperations: model.IIdentifiedSingleEditOperation[]): model.IIdentifiedSingleEditOperation[] {\n\t\tfor (let i = 0, len = rawOperations.length; i < len; i++) {\n\t\t\trawOperations[i].range = this.validateRange(rawOperations[i].range);\n\t\t}\n\n\t\tconst oldLineCount = this._buffer.getLineCount();\n\t\tconst result = this._buffer.applyEdits(rawOperations, this._options.trimAutoWhitespace);\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\tlet rawContentChanges: ModelRawChange[] = [];\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, firstLineLength] = TextModel._eolCount(change.text);\n\t\t\t\ttry {\n\t\t\t\t\tthis._tokens.applyEdits(change.range, eolCount, firstLineLength);\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// emergency recovery => reset tokens\n\t\t\t\t\tthis._tokens = new ModelLinesTokens(this._tokens.languageIdentifier, this._tokens.tokenizationSupport);\n\t\t\t\t}\n\t\t\t\tthis._onDidChangeDecorations.fire();\n\t\t\t\tthis._decorationsTree.acceptReplace(change.rangeOffset, change.rangeLength, change.text.length, change.forceMoveMarkers);\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\tfor (let j = editingLinesCnt; j >= 0; j--) {\n\t\t\t\t\tconst editLineNumber = startLineNumber + j;\n\t\t\t\t\tconst currentEditLineNumber = newLineCount - lineCount - changeLineCountDelta + editLineNumber;\n\t\t\t\t\trawContentChanges.push(new ModelRawLineChanged(editLineNumber, this.getLineContent(currentEditLineNumber)));\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\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\tlet newLines: string[] = [];\n\t\t\t\t\tfor (let i = 0; i < cnt; i++) {\n\t\t\t\t\t\tlet lineNumber = fromLineNumber + i;\n\t\t\t\t\t\tnewLines[lineNumber - fromLineNumber] = this.getLineContent(lineNumber);\n\t\t\t\t\t}\n\t\t\t\t\trawContentChanges.push(new ModelRawLinesInserted(spliceLineNumber + 1, startLineNumber + insertingLinesCnt, newLines));\n\t\t\t\t}\n\n\t\t\t\tlineCount += changeLineCountDelta;\n\t\t\t}\n\n\t\t\tthis._increaseVersionId();\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\tif (this._tokens.hasLinesToTokenize(this._buffer)) {\n\t\t\tthis._beginBackgroundTokenization();\n\t\t}\n\n\t\treturn result.reverseEdits;\n\t}\n\n\tprivate _undo(): Selection[] | null {\n\t\tthis._isUndoing = true;\n\t\tlet r = this._commandManager.undo();\n\t\tthis._isUndoing = false;\n\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tthis._overwriteAlternativeVersionId(r.recordedVersionId);\n\n\t\treturn r.selections;\n\t}\n\n\tpublic undo(): Selection[] | null {\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\treturn this._undo();\n\t\t} finally {\n\t\t\tthis._eventEmitter.endDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tpublic canUndo(): boolean {\n\t\treturn this._commandManager.canUndo();\n\t}\n\n\tprivate _redo(): Selection[] | null {\n\t\tthis._isRedoing = true;\n\t\tlet r = this._commandManager.redo();\n\t\tthis._isRedoing = false;\n\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tthis._overwriteAlternativeVersionId(r.recordedVersionId);\n\n\t\treturn r.selections;\n\t}\n\n\tpublic redo(): Selection[] | null {\n\t\ttry {\n\t\t\tthis._onDidChangeDecorations.beginDeferredEmit();\n\t\t\tthis._eventEmitter.beginDeferredEmit();\n\t\t\treturn this._redo();\n\t\t} finally {\n\t\t\tthis._eventEmitter.endDeferredEmit();\n\t\t\tthis._onDidChangeDecorations.endDeferredEmit();\n\t\t}\n\t}\n\n\tpublic canRedo(): boolean {\n\t\treturn this._commandManager.canRedo();\n\t}\n\n\t//#endregion\n\n\t//#region Decorations\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\tlet changeAccessor: model.IModelDecorationsChangeAccessor = {\n\t\t\taddDecoration: (range: IRange, options: model.IModelDecorationOptions): string => {\n\t\t\t\tthis._onDidChangeDecorations.fire();\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._onDidChangeDecorations.fire();\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._onDidChangeDecorations.fire();\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._onDidChangeDecorations.fire();\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\tthis._onDidChangeDecorations.fire();\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\tthis._onDidChangeDecorations.fire();\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\tconst versionId = this.getVersionId();\n\t\tif (node.cachedVersionId !== versionId) {\n\t\t\tthis._decorationsTree.resolveNode(node, versionId);\n\t\t}\n\t\tif (node.range === null) {\n\t\t\tnode.range = this._getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd);\n\t\t}\n\t\treturn node.range;\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\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\tlet lineCount = this.getLineCount();\n\t\tlet startLineNumber = Math.min(lineCount, Math.max(1, _startLineNumber));\n\t\tlet endLineNumber = Math.min(lineCount, Math.max(1, _endLineNumber));\n\t\tlet endColumn = this.getLineMaxColumn(endLineNumber);\n\t\treturn this._getDecorationsInRange(new Range(startLineNumber, 1, endLineNumber, endColumn), ownerId, filterOutValidation);\n\t}\n\n\tpublic getDecorationsInRange(range: IRange, ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tlet validatedRange = this.validateRange(range);\n\t\treturn this._getDecorationsInRange(validatedRange, ownerId, filterOutValidation);\n\t}\n\n\tpublic getOverviewRulerDecorations(ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tconst versionId = this.getVersionId();\n\t\tconst result = this._decorationsTree.search(ownerId, filterOutValidation, true, versionId);\n\t\treturn this._ensureNodesHaveRanges(result);\n\t}\n\n\tpublic getAllDecorations(ownerId: number = 0, filterOutValidation: boolean = false): model.IModelDecoration[] {\n\t\tconst versionId = this.getVersionId();\n\t\tconst result = this._decorationsTree.search(ownerId, filterOutValidation, false, versionId);\n\t\treturn this._ensureNodesHaveRanges(result);\n\t}\n\n\tprivate _getDecorationsInRange(filterRange: Range, filterOwnerId: number, filterOutValidation: boolean): IntervalNode[] {\n\t\tconst startOffset = this._buffer.getOffsetAt(filterRange.startLineNumber, filterRange.startColumn);\n\t\tconst endOffset = this._buffer.getOffsetAt(filterRange.endLineNumber, filterRange.endColumn);\n\n\t\tconst versionId = this.getVersionId();\n\t\tconst result = this._decorationsTree.intervalSearch(startOffset, endOffset, filterOwnerId, filterOutValidation, versionId);\n\n\t\treturn this._ensureNodesHaveRanges(result);\n\t}\n\n\tprivate _ensureNodesHaveRanges(nodes: IntervalNode[]): IntervalNode[] {\n\t\tfor (let i = 0, len = nodes.length; i < len; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (node.range === null) {\n\t\t\t\tnode.range = this._getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd);\n\t\t\t}\n\t\t}\n\t\treturn nodes;\n\t}\n\n\tprivate _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\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}\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\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\tlet 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\tthis._decorationsTree.delete(node);\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\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\t//#endregion\n\n\t//#region Tokenization\n\n\tpublic tokenizeViewport(startLineNumber: number, endLineNumber: number): void {\n\t\tif (!this._tokens.tokenizationSupport) {\n\t\t\t// nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tstartLineNumber = Math.max(1, startLineNumber);\n\t\tendLineNumber = Math.min(this.getLineCount(), endLineNumber);\n\n\t\tif (endLineNumber <= this._tokens.inValidLineStartIndex) {\n\t\t\t// nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tif (startLineNumber <= this._tokens.inValidLineStartIndex) {\n\t\t\t// tokenization has reached the viewport start...\n\t\t\tthis.forceTokenization(endLineNumber);\n\t\t\treturn;\n\t\t}\n\n\t\tlet nonWhitespaceColumn = this.getLineFirstNonWhitespaceColumn(startLineNumber);\n\t\tlet fakeLines: string[] = [];\n\t\tlet initialState: IState | null = null;\n\t\tfor (let i = startLineNumber - 1; nonWhitespaceColumn > 0 && i >= 1; i--) {\n\t\t\tlet newNonWhitespaceIndex = this.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._tokens._getState(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.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._tokens.tokenizationSupport.getInitialState();\n\t\t}\n\n\t\tlet state = initialState.clone();\n\t\tfor (let i = fakeLines.length - 1; i >= 0; i--) {\n\t\t\tlet r = this._tokens._tokenizeText(this._buffer, fakeLines[i], state);\n\t\t\tif (r) {\n\t\t\t\tstate = r.endState.clone();\n\t\t\t} else {\n\t\t\t\tstate = initialState.clone();\n\t\t\t}\n\t\t}\n\n\t\tconst eventBuilder = new ModelTokensChangedEventBuilder();\n\t\tfor (let i = startLineNumber; i <= endLineNumber; i++) {\n\t\t\tlet text = this.getLineContent(i);\n\t\t\tlet r = this._tokens._tokenizeText(this._buffer, text, state);\n\t\t\tif (r) {\n\t\t\t\tthis._tokens._setTokens(this._tokens.languageIdentifier.id, i - 1, text.length, r.tokens);\n\n\t\t\t\t// We cannot trust these states/tokens to be valid!\n\t\t\t\t// (see https://github.com/Microsoft/vscode/issues/67607)\n\t\t\t\tthis._tokens._setIsInvalid(i - 1, true);\n\t\t\t\tthis._tokens._setState(i - 1, state);\n\t\t\t\tstate = r.endState.clone();\n\t\t\t\teventBuilder.registerChangedTokens(i);\n\t\t\t} else {\n\t\t\t\tstate = initialState.clone();\n\t\t\t}\n\t\t}\n\n\t\tconst e = eventBuilder.build();\n\t\tif (e) {\n\t\t\tthis._onDidChangeTokens.fire(e);\n\t\t}\n\t}\n\n\tpublic flushTokens(): void {\n\t\tthis._resetTokenizationState();\n\t\tthis.emitModelTokensChangedEvent({\n\t\t\ttokenizationSupportChanged: false,\n\t\t\tranges: [{\n\t\t\t\tfromLineNumber: 1,\n\t\t\t\ttoLineNumber: this.getLineCount()\n\t\t\t}]\n\t\t});\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\tconst eventBuilder = new ModelTokensChangedEventBuilder();\n\n\t\tthis._tokens._updateTokensUntilLine(this._buffer, eventBuilder, lineNumber);\n\n\t\tconst e = eventBuilder.build();\n\t\tif (e) {\n\t\t\tthis._onDidChangeTokens.fire(e);\n\t\t}\n\t}\n\n\tpublic isCheapToTokenize(lineNumber: number): boolean {\n\t\tif (!this._tokens.isCheapToTokenize(lineNumber)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (lineNumber < this._tokens.inValidLineStartIndex + 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.getLineLength(lineNumber) < CHEAP_TOKENIZATION_LENGTH_LIMIT) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\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._buffer.getLineContent(lineNumber);\n\t\treturn this._tokens.getTokens(this._languageIdentifier.id, lineNumber - 1, lineText);\n\t}\n\n\tpublic getLanguageIdentifier(): LanguageIdentifier {\n\t\treturn this._languageIdentifier;\n\t}\n\n\tpublic getModeId(): string {\n\t\treturn this._languageIdentifier.language;\n\t}\n\n\tpublic setMode(languageIdentifier: LanguageIdentifier): void {\n\t\tif (this._languageIdentifier.id === languageIdentifier.id) {\n\t\t\t// There's nothing to do\n\t\t\treturn;\n\t\t}\n\n\t\tlet e: IModelLanguageChangedEvent = {\n\t\t\toldLanguage: this._languageIdentifier.language,\n\t\t\tnewLanguage: languageIdentifier.language\n\t\t};\n\n\t\tthis._languageIdentifier = languageIdentifier;\n\n\t\t// Cancel tokenization, clear all tokens and begin tokenizing\n\t\tthis._resetTokenizationState();\n\n\t\tthis.emitModelTokensChangedEvent({\n\t\t\ttokenizationSupportChanged: true,\n\t\t\tranges: [{\n\t\t\t\tfromLineNumber: 1,\n\t\t\t\ttoLineNumber: this.getLineCount()\n\t\t\t}]\n\t\t});\n\t\tthis._onDidChangeLanguage.fire(e);\n\t\tthis._onDidChangeLanguageConfiguration.fire({});\n\t}\n\n\tpublic getLanguageIdAtPosition(_lineNumber: number, _column: number): LanguageId {\n\t\tif (!this._tokens.tokenizationSupport) {\n\t\t\treturn this._languageIdentifier.id;\n\t\t}\n\t\tlet { lineNumber, column } = this.validatePosition({ lineNumber: _lineNumber, column: _column });\n\n\t\tlet lineTokens = this._getLineTokens(lineNumber);\n\t\treturn lineTokens.getLanguageId(lineTokens.findTokenIndexAtOffset(column - 1));\n\t}\n\n\tprivate _beginBackgroundTokenization(): void {\n\t\tif (this._shouldAutoTokenize() && this._revalidateTokensTimeout === -1) {\n\t\t\tthis._revalidateTokensTimeout = setTimeout(() => {\n\t\t\t\tthis._revalidateTokensTimeout = -1;\n\t\t\t\tthis._revalidateTokensNow();\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t_warmUpTokens(): void {\n\t\t// Warm up first 100 lines (if it takes less than 50ms)\n\t\tconst maxLineNumber = Math.min(100, this.getLineCount());\n\t\tthis._revalidateTokensNow(maxLineNumber);\n\n\t\tif (this._tokens.hasLinesToTokenize(this._buffer)) {\n\t\t\tthis._beginBackgroundTokenization();\n\t\t}\n\t}\n\n\tprivate _revalidateTokensNow(toLineNumber: number = this._buffer.getLineCount()): void {\n\t\tconst MAX_ALLOWED_TIME = 20;\n\t\tconst eventBuilder = new ModelTokensChangedEventBuilder();\n\t\tconst sw = StopWatch.create(false);\n\n\t\twhile (this._tokens.hasLinesToTokenize(this._buffer)) {\n\t\t\tif (sw.elapsed() > MAX_ALLOWED_TIME) {\n\t\t\t\t// Stop if MAX_ALLOWED_TIME is reached\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst tokenizedLineNumber = this._tokens._tokenizeOneLine(this._buffer, eventBuilder);\n\n\t\t\tif (tokenizedLineNumber >= toLineNumber) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (this._tokens.hasLinesToTokenize(this._buffer)) {\n\t\t\tthis._beginBackgroundTokenization();\n\t\t}\n\n\t\tconst e = eventBuilder.build();\n\t\tif (e) {\n\t\t\tthis._onDidChangeTokens.fire(e);\n\t\t}\n\t}\n\n\tprivate emitModelTokensChangedEvent(e: IModelTokensChangedEvent): void {\n\t\tif (!this._isDisposing) {\n\t\t\tthis._onDidChangeTokens.fire(e);\n\t\t}\n\t}\n\n\t// Having tokens allows implementing additional helper methods\n\n\tpublic getWordAtPosition(_position: IPosition): model.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\tLanguageConfigurationRegistry.getWordDefinition(lineTokens.getLanguageId(tokenIndex)),\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\tLanguageConfigurationRegistry.getWordDefinition(lineTokens.getLanguageId(tokenIndex - 1)),\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): model.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\tpublic findMatchingBracketUp(_bracket: string, _position: IPosition): Range | null {\n\t\tlet bracket = _bracket.toLowerCase();\n\t\tlet position = this.validatePosition(_position);\n\n\t\tlet lineTokens = this._getLineTokens(position.lineNumber);\n\t\tlet languageId = lineTokens.getLanguageId(lineTokens.findTokenIndexAtOffset(position.column - 1));\n\t\tlet bracketsSupport = LanguageConfigurationRegistry.getBracketsSupport(languageId);\n\n\t\tif (!bracketsSupport) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet data = bracketsSupport.textIsBracket[bracket];\n\n\t\tif (!data) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._findMatchingBracketUp(data, position);\n\t}\n\n\tpublic matchBracket(position: IPosition): [Range, Range] | null {\n\t\treturn this._matchBracket(this.validatePosition(position));\n\t}\n\n\tprivate _matchBracket(position: Position): [Range, Range] | null {\n\t\tconst lineNumber = position.lineNumber;\n\t\tconst lineTokens = this._getLineTokens(lineNumber);\n\t\tconst lineText = this._buffer.getLineContent(lineNumber);\n\n\t\tlet tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\tif (tokenIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst currentModeBrackets = LanguageConfigurationRegistry.getBracketsSupport(lineTokens.getLanguageId(tokenIndex));\n\n\t\t// check that the token is not to be ignored\n\t\tif (currentModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex))) {\n\t\t\t// limit search to not go before `maxBracketLength`\n\t\t\tlet searchStartOffset = Math.max(lineTokens.getStartOffset(tokenIndex), position.column - 1 - currentModeBrackets.maxBracketLength);\n\t\t\t// limit search to not go after `maxBracketLength`\n\t\t\tconst searchEndOffset = Math.min(lineTokens.getEndOffset(tokenIndex), position.column - 1 + currentModeBrackets.maxBracketLength);\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\tlet foundBracket = BracketsUtils.findNextBracketInToken(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\tlet foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1);\n\t\t\t\t\tfoundBracketText = foundBracketText.toLowerCase();\n\n\t\t\t\t\tlet r = this._matchFoundBracket(foundBracket, currentModeBrackets.textIsBracket[foundBracketText], currentModeBrackets.textIsOpenBracket[foundBracketText]);\n\n\t\t\t\t\t// check that we can actually match this bracket\n\t\t\t\t\tif (r) {\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 searchEndOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\ttokenIndex--;\n\t\t\tconst prevModeBrackets = LanguageConfigurationRegistry.getBracketsSupport(lineTokens.getLanguageId(tokenIndex));\n\n\t\t\t// check that previous token is not to be ignored\n\t\t\tif (prevModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex))) {\n\t\t\t\t// limit search in case previous token is very large, there's no need to go beyond `maxBracketLength`\n\t\t\t\tconst searchStartOffset = Math.max(lineTokens.getStartOffset(tokenIndex), position.column - 1 - prevModeBrackets.maxBracketLength);\n\t\t\t\tconst foundBracket = BracketsUtils.findPrevBracketInToken(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\tlet foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1);\n\t\t\t\t\tfoundBracketText = foundBracketText.toLowerCase();\n\n\t\t\t\t\tlet r = this._matchFoundBracket(foundBracket, prevModeBrackets.textIsBracket[foundBracketText], prevModeBrackets.textIsOpenBracket[foundBracketText]);\n\n\t\t\t\t\t// check that we can actually match this bracket\n\t\t\t\t\tif (r) {\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): [Range, Range] | null {\n\t\tif (!data) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (isOpen) {\n\t\t\tlet matched = this._findMatchingBracketDown(data, foundBracket.getEndPosition());\n\t\t\tif (matched) {\n\t\t\t\treturn [foundBracket, matched];\n\t\t\t}\n\t\t} else {\n\t\t\tlet matched = this._findMatchingBracketUp(data, foundBracket.getStartPosition());\n\t\t\tif (matched) {\n\t\t\t\treturn [foundBracket, matched];\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMatchingBracketUp(bracket: RichEditBracket, position: Position): Range | null {\n\t\t// console.log('_findMatchingBracketUp: ', 'bracket: ', JSON.stringify(bracket), 'startPosition: ', String(position));\n\n\t\tconst languageId = bracket.languageIdentifier.id;\n\t\tconst reversedBracketRegex = bracket.reversedRegex;\n\t\tlet count = -1;\n\n\t\tfor (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) {\n\t\t\tconst lineTokens = this._getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this._buffer.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = tokenCount - 1;\n\t\t\tlet searchStopOffset = -1;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStopOffset = position.column - 1;\n\t\t\t}\n\n\t\t\tfor (; tokenIndex >= 0; tokenIndex--) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(tokenIndex);\n\t\t\t\tconst tokenStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\tconst tokenEndOffset = lineTokens.getEndOffset(tokenIndex);\n\n\t\t\t\tif (searchStopOffset === -1) {\n\t\t\t\t\tsearchStopOffset = tokenEndOffset;\n\t\t\t\t}\n\n\t\t\t\tif (tokenLanguageId === languageId && !ignoreBracketsInToken(tokenType)) {\n\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tlet r = BracketsUtils.findPrevBracketInToken(reversedBracketRegex, lineNumber, lineText, tokenStartOffset, searchStopOffset);\n\t\t\t\t\t\tif (!r) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1);\n\t\t\t\t\t\thitText = hitText.toLowerCase();\n\n\t\t\t\t\t\tif (hitText === bracket.open) {\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t} else if (hitText === bracket.close) {\n\t\t\t\t\t\t\tcount--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count === 0) {\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsearchStopOffset = r.startColumn - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsearchStopOffset = -1;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMatchingBracketDown(bracket: RichEditBracket, position: Position): Range | null {\n\t\t// console.log('_findMatchingBracketDown: ', 'bracket: ', JSON.stringify(bracket), 'startPosition: ', String(position));\n\n\t\tconst languageId = bracket.languageIdentifier.id;\n\t\tconst bracketRegex = bracket.forwardRegex;\n\t\tlet count = 1;\n\n\t\tfor (let lineNumber = position.lineNumber, lineCount = this.getLineCount(); lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineTokens = this._getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this._buffer.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = 0;\n\t\t\tlet searchStartOffset = 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}\n\n\t\t\tfor (; tokenIndex < tokenCount; tokenIndex++) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(tokenIndex);\n\t\t\t\tconst tokenStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\tconst tokenEndOffset = lineTokens.getEndOffset(tokenIndex);\n\n\t\t\t\tif (searchStartOffset === 0) {\n\t\t\t\t\tsearchStartOffset = tokenStartOffset;\n\t\t\t\t}\n\n\t\t\t\tif (tokenLanguageId === languageId && !ignoreBracketsInToken(tokenType)) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tlet r = BracketsUtils.findNextBracketInToken(bracketRegex, lineNumber, lineText, searchStartOffset, tokenEndOffset);\n\t\t\t\t\t\tif (!r) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1);\n\t\t\t\t\t\thitText = hitText.toLowerCase();\n\n\t\t\t\t\t\tif (hitText === bracket.open) {\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t} else if (hitText === bracket.close) {\n\t\t\t\t\t\t\tcount--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count === 0) {\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsearchStartOffset = r.endColumn - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsearchStartOffset = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic findPrevBracket(_position: IPosition): model.IFoundBracket | null {\n\t\tconst position = this.validatePosition(_position);\n\n\t\tlet languageId: LanguageId = -1;\n\t\tlet modeBrackets: RichEditBrackets | null = null;\n\t\tfor (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) {\n\t\t\tconst lineTokens = this._getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this._buffer.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = tokenCount - 1;\n\t\t\tlet searchStopOffset = -1;\n\t\t\tif (lineNumber === position.lineNumber) {\n\t\t\t\ttokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1);\n\t\t\t\tsearchStopOffset = position.column - 1;\n\t\t\t}\n\n\t\t\tfor (; tokenIndex >= 0; tokenIndex--) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(tokenIndex);\n\t\t\t\tconst tokenStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\tconst tokenEndOffset = lineTokens.getEndOffset(tokenIndex);\n\n\t\t\t\tif (searchStopOffset === -1) {\n\t\t\t\t\tsearchStopOffset = tokenEndOffset;\n\t\t\t\t}\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = LanguageConfigurationRegistry.getBracketsSupport(languageId);\n\t\t\t\t}\n\t\t\t\tif (modeBrackets && !ignoreBracketsInToken(tokenType)) {\n\t\t\t\t\tlet r = BracketsUtils.findPrevBracketInToken(modeBrackets.reversedRegex, lineNumber, lineText, tokenStartOffset, searchStopOffset);\n\t\t\t\t\tif (r) {\n\t\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsearchStopOffset = -1;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic findNextBracket(_position: IPosition): model.IFoundBracket | null {\n\t\tconst position = this.validatePosition(_position);\n\n\t\tlet languageId: LanguageId = -1;\n\t\tlet modeBrackets: RichEditBrackets | null = null;\n\t\tfor (let lineNumber = position.lineNumber, lineCount = this.getLineCount(); lineNumber <= lineCount; lineNumber++) {\n\t\t\tconst lineTokens = this._getLineTokens(lineNumber);\n\t\t\tconst tokenCount = lineTokens.getCount();\n\t\t\tconst lineText = this._buffer.getLineContent(lineNumber);\n\n\t\t\tlet tokenIndex = 0;\n\t\t\tlet searchStartOffset = 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}\n\n\t\t\tfor (; tokenIndex < tokenCount; tokenIndex++) {\n\t\t\t\tconst tokenLanguageId = lineTokens.getLanguageId(tokenIndex);\n\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(tokenIndex);\n\t\t\t\tconst tokenStartOffset = lineTokens.getStartOffset(tokenIndex);\n\t\t\t\tconst tokenEndOffset = lineTokens.getEndOffset(tokenIndex);\n\n\t\t\t\tif (searchStartOffset === 0) {\n\t\t\t\t\tsearchStartOffset = tokenStartOffset;\n\t\t\t\t}\n\n\t\t\t\tif (languageId !== tokenLanguageId) {\n\t\t\t\t\tlanguageId = tokenLanguageId;\n\t\t\t\t\tmodeBrackets = LanguageConfigurationRegistry.getBracketsSupport(languageId);\n\t\t\t\t}\n\t\t\t\tif (modeBrackets && !ignoreBracketsInToken(tokenType)) {\n\t\t\t\t\tlet r = BracketsUtils.findNextBracketInToken(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, tokenEndOffset);\n\t\t\t\t\tif (r) {\n\t\t\t\t\t\treturn this._toFoundBracket(modeBrackets, r);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsearchStartOffset = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _toFoundBracket(modeBrackets: RichEditBrackets, r: Range): model.IFoundBracket | null {\n\t\tif (!r) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet text = this.getValueInRange(r);\n\t\ttext = text.toLowerCase();\n\n\t\tlet 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\t/**\n\t * Returns:\n\t * - -1 => the line consists of whitespace\n\t * - otherwise => the indent level is returned value\n\t */\n\tpublic static computeIndentLevel(line: string, tabSize: number): number {\n\t\tlet indent = 0;\n\t\tlet i = 0;\n\t\tlet len = line.length;\n\n\t\twhile (i < len) {\n\t\t\tlet chCode = line.charCodeAt(i);\n\t\t\tif (chCode === CharCode.Space) {\n\t\t\t\tindent++;\n\t\t\t} else if (chCode === CharCode.Tab) {\n\t\t\t\tindent = indent - indent % tabSize + tabSize;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\tif (i === len) {\n\t\t\treturn -1; // line only consists of whitespace\n\t\t}\n\n\t\treturn indent;\n\t}\n\n\tprivate _computeIndentLevel(lineIndex: number): number {\n\t\treturn TextModel.computeIndentLevel(this._buffer.getLineContent(lineIndex + 1), this._options.tabSize);\n\t}\n\n\tpublic getActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): model.IActiveIndentGuideInfo {\n\t\tthis._assertNotDisposed();\n\t\tconst lineCount = this.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 = LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id);\n\t\tconst offSide = Boolean(foldingRules && foldingRules.offSide);\n\n\t\tlet up_aboveContentLineIndex = -2; /* -2 is a marker for not having computed it */\n\t\tlet up_aboveContentLineIndent = -1;\n\t\tlet up_belowContentLineIndex = -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 (up_aboveContentLineIndex !== -1 && (up_aboveContentLineIndex === -2 || up_aboveContentLineIndex > lineNumber - 1)) {\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\tlet 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\tlet 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 = -2; /* -2 is a marker for not having computed it */\n\t\tlet down_aboveContentLineIndent = -1;\n\t\tlet down_belowContentLineIndex = -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\tlet 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 (down_belowContentLineIndex !== -1 && (down_belowContentLineIndex === -2 || down_belowContentLineIndex < lineNumber - 1)) {\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\tlet 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\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 !== 0 && (upLineNumber < 1 || upLineNumber < minLineNumber)) {\n\t\t\t\tgoUp = false;\n\t\t\t}\n\t\t\tif (distance !== 0 && (downLineNumber > lineCount || downLineNumber > maxLineNumber)) {\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\tif (goUp) {\n\t\t\t\t// compute indent level going up\n\t\t\t\tlet upLineIndentLevel: number;\n\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(currentIndent / this._options.indentSize);\n\t\t\t\t} else {\n\t\t\t\t\tup_resolveIndents(upLineNumber);\n\t\t\t\t\tupLineIndentLevel = this._getIndentLevelForWhitespaceLine(offSide, up_aboveContentLineIndent, up_belowContentLineIndent);\n\t\t\t\t}\n\n\t\t\t\tif (distance === 0) {\n\t\t\t\t\t// This is the initial line number\n\t\t\t\t\tstartLineNumber = upLineNumber;\n\t\t\t\t\tendLineNumber = downLineNumber;\n\t\t\t\t\tindent = upLineIndentLevel;\n\t\t\t\t\tif (indent === 0) {\n\t\t\t\t\t\t// No need to continue\n\t\t\t\t\t\treturn { startLineNumber, endLineNumber, indent };\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\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\n\t\t\tif (goDown) {\n\t\t\t\t// compute indent level going down\n\t\t\t\tlet downLineIndentLevel: number;\n\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(currentIndent / this._options.indentSize);\n\t\t\t\t} else {\n\t\t\t\t\tdown_resolveIndents(downLineNumber);\n\t\t\t\t\tdownLineIndentLevel = this._getIndentLevelForWhitespaceLine(offSide, down_aboveContentLineIndent, down_belowContentLineIndent);\n\t\t\t\t}\n\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 getLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[] {\n\t\tthis._assertNotDisposed();\n\t\tconst lineCount = this.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 foldingRules = LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id);\n\t\tconst offSide = Boolean(foldingRules && foldingRules.offSide);\n\n\t\tlet result: number[] = new Array<number>(endLineNumber - startLineNumber + 1);\n\n\t\tlet aboveContentLineIndex = -2; /* -2 is a marker for not having computed it */\n\t\tlet aboveContentLineIndent = -1;\n\n\t\tlet belowContentLineIndex = -2; /* -2 is a marker for not having computed it */\n\t\tlet belowContentLineIndent = -1;\n\n\t\tfor (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {\n\t\t\tlet 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 / this._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\tlet 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 (belowContentLineIndex !== -1 && (belowContentLineIndex === -2 || belowContentLineIndex < lineNumber - 1)) {\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\tlet 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(offSide, aboveContentLineIndent, belowContentLineIndent);\n\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _getIndentLevelForWhitespaceLine(offSide: boolean, aboveContentLineIndent: number, belowContentLineIndent: number): number {\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\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 / this._options.indentSize));\n\n\t\t} else if (aboveContentLineIndent === belowContentLineIndent) {\n\t\t\t// we are in between two regions\n\t\t\treturn Math.ceil(belowContentLineIndent / this._options.indentSize);\n\n\t\t} else {\n\n\t\t\tif (offSide) {\n\t\t\t\t// same level as region below\n\t\t\t\treturn Math.ceil(belowContentLineIndent / this._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 / this._options.indentSize));\n\t\t\t}\n\n\t\t}\n\t}\n\n\t//#endregion\n}\n\n//#region Decorations\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\tconstructor() {\n\t\tthis._decorationsTree0 = new IntervalTree();\n\t\tthis._decorationsTree1 = new IntervalTree();\n\t}\n\n\tpublic 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\treturn r0.concat(r1);\n\t}\n\n\tpublic 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\treturn r0.concat(r1);\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\treturn r0.concat(r1);\n\t}\n\n\tpublic collectNodesPostOrder(): IntervalNode[] {\n\t\tconst r0 = this._decorationsTree0.collectNodesPostOrder();\n\t\tconst r1 = this._decorationsTree1.collectNodesPostOrder();\n\t\treturn r0.concat(r1);\n\t}\n\n\tpublic insert(node: IntervalNode): void {\n\t\tif (getNodeIsInOverviewRuler(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 (getNodeIsInOverviewRuler(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 resolveNode(node: IntervalNode, cachedVersionId: number): void {\n\t\tif (getNodeIsInOverviewRuler(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}\n}\n\nfunction cleanClassName(className: string): string {\n\treturn className.replace(/[^a-z0-9\\-_]/gi, ' ');\n}\n\nexport class ModelDecorationOverviewRulerOptions implements model.IModelDecorationOverviewRulerOptions {\n\treadonly color: string | ThemeColor;\n\treadonly darkColor: string | ThemeColor;\n\treadonly position: model.OverviewRulerLane;\n\tprivate _resolvedColor: string | null;\n\n\tconstructor(options: model.IModelDecorationOverviewRulerOptions) {\n\t\tthis.color = options.color || strings.empty;\n\t\tthis.darkColor = options.darkColor || strings.empty;\n\t\tthis.position = (typeof options.position === 'number' ? options.position : model.OverviewRulerLane.Center);\n\t\tthis._resolvedColor = null;\n\t}\n\n\tpublic getColor(theme: ITheme): 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: ITheme): string {\n\t\tif (typeof color === 'string') {\n\t\t\treturn color;\n\t\t}\n\t\tlet c = color ? theme.getColor(color.id) : null;\n\t\tif (!c) {\n\t\t\treturn strings.empty;\n\t\t}\n\t\treturn c.toString();\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 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 glyphMarginClassName: string | null;\n\treadonly linesDecorationsClassName: 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\n\tprivate constructor(options: model.IModelDecorationOptions) {\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 = withUndefinedAsNull(options.hoverMessage);\n\t\tthis.glyphMarginHoverMessage = withUndefinedAsNull(options.glyphMarginHoverMessage);\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.glyphMarginClassName = options.glyphMarginClassName ? cleanClassName(options.glyphMarginClassName) : null;\n\t\tthis.linesDecorationsClassName = options.linesDecorationsClassName ? cleanClassName(options.linesDecorationsClassName) : 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}\n}\nModelDecorationOptions.EMPTY = ModelDecorationOptions.register({});\n\n/**\n * The order carefully matches the values of the enum.\n */\nconst TRACKED_RANGE_OPTIONS = [\n\tModelDecorationOptions.register({ stickiness: model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges }),\n\tModelDecorationOptions.register({ stickiness: model.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges }),\n\tModelDecorationOptions.register({ stickiness: model.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore }),\n\tModelDecorationOptions.register({ 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\n\tconstructor() {\n\t\tsuper();\n\t\tthis._deferredCnt = 0;\n\t\tthis._shouldFire = 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._shouldFire = false;\n\t\t\t\tthis._actual.fire({});\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic fire(): void {\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(): void {\n\t\tthis._deferredCnt--;\n\t\tif (this._deferredCnt === 0) {\n\t\t\tif (this._deferredEvent !== null) {\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 { CharCode } from 'vs/base/common/charCode';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport * as strings from 'vs/base/common/strings';\nimport { EditorAutoClosingStrategy, EditorAutoSurroundStrategy, IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';\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, IConfiguration, ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { LanguageIdentifier } from 'vs/editor/common/modes';\nimport { IAutoClosingPair } from 'vs/editor/common/modes/languageConfiguration';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { VerticalRevealType } from 'vs/editor/common/view/viewEvents';\nimport { IViewModel } from 'vs/editor/common/viewModel/viewModel';\n\nexport interface IColumnSelectData {\n\ttoViewLineNumber: number;\n\ttoViewVisualColumn: number;\n}\n\nexport const enum RevealTarget {\n\tPrimary = 0,\n\tTopMost = 1,\n\tBottomMost = 2\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\tTyping = 1,\n\tDeletingLeft = 2,\n\tDeletingRight = 3\n}\n\nexport interface ICursors {\n\treadonly context: CursorContext;\n\tgetPrimaryCursor(): CursorState;\n\tgetLastAddedCursorIndex(): number;\n\tgetAll(): CursorState[];\n\n\tgetColumnSelectData(): IColumnSelectData;\n\tsetColumnSelectData(columnSelectData: IColumnSelectData): void;\n\n\tsetStates(source: string, reason: CursorChangeReason, states: PartialCursorState[] | null): void;\n\treveal(horizontal: boolean, target: RevealTarget, scrollType: ScrollType): void;\n\trevealRange(revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;\n\n\tscrollTo(desiredScrollTop: number): void;\n\n\tgetPrevEditOperationType(): EditOperationType;\n\tsetPrevEditOperationType(type: EditOperationType): void;\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;\n\n\tpublic readonly readOnly: boolean;\n\tpublic readonly tabSize: number;\n\tpublic readonly indentSize: number;\n\tpublic readonly insertSpaces: 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 autoClosingBrackets: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingQuotes: EditorAutoClosingStrategy;\n\tpublic readonly autoSurround: EditorAutoSurroundStrategy;\n\tpublic readonly autoIndent: boolean;\n\tpublic readonly autoClosingPairsOpen: CharacterMap;\n\tpublic readonly autoClosingPairsClose: CharacterMap;\n\tpublic readonly surroundingPairs: CharacterMap;\n\tpublic readonly shouldAutoCloseBefore: { quote: (ch: string) => boolean, bracket: (ch: string) => boolean };\n\n\tprivate readonly _languageIdentifier: LanguageIdentifier;\n\tprivate _electricChars: { [key: string]: boolean; } | null;\n\n\tpublic static shouldRecreate(e: IConfigurationChangedEvent): boolean {\n\t\treturn (\n\t\t\te.layoutInfo\n\t\t\t|| e.wordSeparators\n\t\t\t|| e.emptySelectionClipboard\n\t\t\t|| e.multiCursorMergeOverlapping\n\t\t\t|| e.autoClosingBrackets\n\t\t\t|| e.autoClosingQuotes\n\t\t\t|| e.autoSurround\n\t\t\t|| e.useTabStops\n\t\t\t|| e.lineHeight\n\t\t\t|| e.readOnly\n\t\t);\n\t}\n\n\tconstructor(\n\t\tlanguageIdentifier: LanguageIdentifier,\n\t\tmodelOptions: TextModelResolvedOptions,\n\t\tconfiguration: IConfiguration\n\t) {\n\t\tthis._languageIdentifier = languageIdentifier;\n\n\t\tlet c = configuration.editor;\n\n\t\tthis.readOnly = c.readOnly;\n\t\tthis.tabSize = modelOptions.tabSize;\n\t\tthis.indentSize = modelOptions.indentSize;\n\t\tthis.insertSpaces = modelOptions.insertSpaces;\n\t\tthis.pageSize = Math.max(1, Math.floor(c.layoutInfo.height / c.fontInfo.lineHeight) - 2);\n\t\tthis.lineHeight = c.lineHeight;\n\t\tthis.useTabStops = c.useTabStops;\n\t\tthis.wordSeparators = c.wordSeparators;\n\t\tthis.emptySelectionClipboard = c.emptySelectionClipboard;\n\t\tthis.copyWithSyntaxHighlighting = c.copyWithSyntaxHighlighting;\n\t\tthis.multiCursorMergeOverlapping = c.multiCursorMergeOverlapping;\n\t\tthis.autoClosingBrackets = c.autoClosingBrackets;\n\t\tthis.autoClosingQuotes = c.autoClosingQuotes;\n\t\tthis.autoSurround = c.autoSurround;\n\t\tthis.autoIndent = c.autoIndent;\n\n\t\tthis.autoClosingPairsOpen = {};\n\t\tthis.autoClosingPairsClose = {};\n\t\tthis.surroundingPairs = {};\n\t\tthis._electricChars = null;\n\n\t\tthis.shouldAutoCloseBefore = {\n\t\t\tquote: CursorConfiguration._getShouldAutoClose(languageIdentifier, this.autoClosingQuotes),\n\t\t\tbracket: CursorConfiguration._getShouldAutoClose(languageIdentifier, this.autoClosingBrackets)\n\t\t};\n\n\t\tlet autoClosingPairs = CursorConfiguration._getAutoClosingPairs(languageIdentifier);\n\t\tif (autoClosingPairs) {\n\t\t\tfor (const pair of autoClosingPairs) {\n\t\t\t\tthis.autoClosingPairsOpen[pair.open] = pair.close;\n\t\t\t\tthis.autoClosingPairsClose[pair.close] = pair.open;\n\t\t\t}\n\t\t}\n\n\t\tlet surroundingPairs = CursorConfiguration._getSurroundingPairs(languageIdentifier);\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\tlet electricChars = CursorConfiguration._getElectricCharacters(this._languageIdentifier);\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\tpublic normalizeIndentation(str: string): string {\n\t\treturn TextModel.normalizeIndentation(str, this.indentSize, this.insertSpaces);\n\t}\n\n\tprivate static _getElectricCharacters(languageIdentifier: LanguageIdentifier): string[] | null {\n\t\ttry {\n\t\t\treturn LanguageConfigurationRegistry.getElectricCharacters(languageIdentifier.id);\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate static _getAutoClosingPairs(languageIdentifier: LanguageIdentifier): IAutoClosingPair[] | null {\n\t\ttry {\n\t\t\treturn LanguageConfigurationRegistry.getAutoClosingPairs(languageIdentifier.id);\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate static _getShouldAutoClose(languageIdentifier: LanguageIdentifier, 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 CursorConfiguration._getLanguageDefinedShouldAutoClose(languageIdentifier);\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 static _getLanguageDefinedShouldAutoClose(languageIdentifier: LanguageIdentifier): (ch: string) => boolean {\n\t\ttry {\n\t\t\tconst autoCloseBeforeSet = LanguageConfigurationRegistry.getAutoCloseBeforeSet(languageIdentifier.id);\n\t\t\treturn c => autoCloseBeforeSet.indexOf(c) !== -1;\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn autoCloseNever;\n\t\t}\n\t}\n\n\tprivate static _getSurroundingPairs(languageIdentifier: LanguageIdentifier): IAutoClosingPair[] | null {\n\t\ttry {\n\t\t\treturn LanguageConfigurationRegistry.getSurroundingPairs(languageIdentifier.id);\n\t\t} catch (e) {\n\t\t\tonUnexpectedError(e);\n\t\t\treturn null;\n\t\t}\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\tgetLineLastNonWhitespaceColumn(lineNumber: number): number;\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;\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\tlet startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number;\n\t\tif (selectionStart.isEmpty()) {\n\t\t\tstartLineNumber = selectionStart.startLineNumber;\n\t\t\tstartColumn = selectionStart.startColumn;\n\t\t\tendLineNumber = position.lineNumber;\n\t\t\tendColumn = position.column;\n\t\t} else {\n\t\t\tif (position.isBeforeOrEqual(selectionStart.getStartPosition())) {\n\t\t\t\tstartLineNumber = selectionStart.endLineNumber;\n\t\t\t\tstartColumn = selectionStart.endColumn;\n\t\t\t\tendLineNumber = position.lineNumber;\n\t\t\t\tendColumn = position.column;\n\t\t\t} else {\n\t\t\t\tstartLineNumber = selectionStart.startLineNumber;\n\t\t\t\tstartColumn = selectionStart.startColumn;\n\t\t\t\tendLineNumber = position.lineNumber;\n\t\t\t\tendColumn = position.column;\n\t\t\t}\n\t\t}\n\t\treturn new Selection(\n\t\t\tstartLineNumber,\n\t\t\tstartColumn,\n\t\t\tendLineNumber,\n\t\t\tendColumn\n\t\t);\n\t}\n}\n\nexport class CursorContext {\n\t_cursorContextBrand: void;\n\n\tpublic readonly model: ITextModel;\n\tpublic readonly viewModel: IViewModel;\n\tpublic readonly config: CursorConfiguration;\n\n\tconstructor(configuration: IConfiguration, model: ITextModel, viewModel: IViewModel) {\n\t\tthis.model = model;\n\t\tthis.viewModel = viewModel;\n\t\tthis.config = new CursorConfiguration(\n\t\t\tthis.model.getLanguageIdentifier(),\n\t\t\tthis.model.getOptions(),\n\t\t\tconfiguration\n\t\t);\n\t}\n\n\tpublic validateViewPosition(viewPosition: Position, modelPosition: Position): Position {\n\t\treturn this.viewModel.coordinatesConverter.validateViewPosition(viewPosition, modelPosition);\n\t}\n\n\tpublic validateViewRange(viewRange: Range, expectedModelRange: Range): Range {\n\t\treturn this.viewModel.coordinatesConverter.validateViewRange(viewRange, expectedModelRange);\n\t}\n\n\tpublic convertViewRangeToModelRange(viewRange: Range): Range {\n\t\treturn this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange);\n\t}\n\n\tpublic convertViewPositionToModelPosition(lineNumber: number, column: number): Position {\n\t\treturn this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber, column));\n\t}\n\n\tpublic convertModelPositionToViewPosition(modelPosition: Position): Position {\n\t\treturn this.viewModel.coordinatesConverter.convertModelPositionToViewPosition(modelPosition);\n\t}\n\n\tpublic convertModelRangeToViewRange(modelRange: Range): Range {\n\t\treturn this.viewModel.coordinatesConverter.convertModelRangeToViewRange(modelRange);\n\t}\n\n\tpublic getCurrentScrollTop(): number {\n\t\treturn this.viewModel.viewLayout.getCurrentScrollTop();\n\t}\n\n\tpublic getCompletelyVisibleViewRange(): Range {\n\t\treturn this.viewModel.getCompletelyVisibleViewRange();\n\t}\n\n\tpublic getCompletelyVisibleModelRange(): Range {\n\t\tconst viewRange = this.viewModel.getCompletelyVisibleViewRange();\n\t\treturn this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange);\n\t}\n\n\tpublic getCompletelyVisibleViewRangeAtScrollTop(scrollTop: number): Range {\n\t\treturn this.viewModel.getCompletelyVisibleViewRangeAtScrollTop(scrollTop);\n\t}\n\n\tpublic getVerticalOffsetForViewLine(viewLineNumber: number): number {\n\t\treturn this.viewModel.viewLayout.getVerticalOffsetForLineNumber(viewLineNumber);\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\nexport type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;\n\nexport class CursorState {\n\t_cursorStateBrand: void;\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 selectionStartLineNumber = modelSelection.selectionStartLineNumber;\n\t\tconst selectionStartColumn = modelSelection.selectionStartColumn;\n\t\tconst positionLineNumber = modelSelection.positionLineNumber;\n\t\tconst positionColumn = modelSelection.positionColumn;\n\t\tconst modelState = new SingleCursorState(\n\t\t\tnew Range(selectionStartLineNumber, selectionStartColumn, selectionStartLineNumber, selectionStartColumn), 0,\n\t\t\tnew Position(positionLineNumber, positionColumn), 0\n\t\t);\n\t\treturn CursorState.fromModelState(modelState);\n\t}\n\n\tpublic static fromModelSelections(modelSelections: ISelection[]): PartialModelCursorState[] {\n\t\tlet 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 EditOperationResult {\n\t_editOperationResultBrand: void;\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\n/**\n * Common operations that work and make sense both on the model and on the view model.\n */\nexport class CursorColumns {\n\n\tpublic static isLowSurrogate(model: ICursorSimpleModel, lineNumber: number, charOffset: number): boolean {\n\t\tlet lineContent = model.getLineContent(lineNumber);\n\t\tif (charOffset < 0 || charOffset >= lineContent.length) {\n\t\t\treturn false;\n\t\t}\n\t\treturn strings.isLowSurrogate(lineContent.charCodeAt(charOffset));\n\t}\n\n\tpublic static isHighSurrogate(model: ICursorSimpleModel, lineNumber: number, charOffset: number): boolean {\n\t\tlet lineContent = model.getLineContent(lineNumber);\n\t\tif (charOffset < 0 || charOffset >= lineContent.length) {\n\t\t\treturn false;\n\t\t}\n\t\treturn strings.isHighSurrogate(lineContent.charCodeAt(charOffset));\n\t}\n\n\tpublic static isInsideSurrogatePair(model: ICursorSimpleModel, lineNumber: number, column: number): boolean {\n\t\treturn this.isHighSurrogate(model, lineNumber, column - 2);\n\t}\n\n\tpublic static visibleColumnFromColumn(lineContent: string, column: number, tabSize: number): number {\n\t\tlet endOffset = lineContent.length;\n\t\tif (endOffset > column - 1) {\n\t\t\tendOffset = column - 1;\n\t\t}\n\n\t\tlet result = 0;\n\t\tfor (let i = 0; i < endOffset; i++) {\n\t\t\tlet charCode = lineContent.charCodeAt(i);\n\t\t\tif (charCode === CharCode.Tab) {\n\t\t\t\tresult = this.nextRenderTabStop(result, tabSize);\n\t\t\t} else if (strings.isFullWidthCharacter(charCode)) {\n\t\t\t\tresult = result + 2;\n\t\t\t} else {\n\t\t\t\tresult = result + 1;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static visibleColumnFromColumn2(config: CursorConfiguration, model: ICursorSimpleModel, position: Position): number {\n\t\treturn this.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, config.tabSize);\n\t}\n\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 lineLength = lineContent.length;\n\n\t\tlet beforeVisibleColumn = 0;\n\t\tfor (let i = 0; i < lineLength; i++) {\n\t\t\tlet charCode = lineContent.charCodeAt(i);\n\n\t\t\tlet afterVisibleColumn: number;\n\t\t\tif (charCode === CharCode.Tab) {\n\t\t\t\tafterVisibleColumn = this.nextRenderTabStop(beforeVisibleColumn, tabSize);\n\t\t\t} else if (strings.isFullWidthCharacter(charCode)) {\n\t\t\t\tafterVisibleColumn = beforeVisibleColumn + 2;\n\t\t\t} else {\n\t\t\t\tafterVisibleColumn = beforeVisibleColumn + 1;\n\t\t\t}\n\n\t\t\tif (afterVisibleColumn >= visibleColumn) {\n\t\t\t\tlet prevDelta = visibleColumn - beforeVisibleColumn;\n\t\t\t\tlet afterDelta = afterVisibleColumn - visibleColumn;\n\t\t\t\tif (afterDelta < prevDelta) {\n\t\t\t\t\treturn i + 2;\n\t\t\t\t} else {\n\t\t\t\t\treturn i + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbeforeVisibleColumn = afterVisibleColumn;\n\t\t}\n\n\t\t// walked the entire string\n\t\treturn lineLength + 1;\n\t}\n\n\tpublic static columnFromVisibleColumn2(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, visibleColumn: number): number {\n\t\tlet result = this.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, config.tabSize);\n\n\t\tlet minColumn = model.getLineMinColumn(lineNumber);\n\t\tif (result < minColumn) {\n\t\t\treturn minColumn;\n\t\t}\n\n\t\tlet 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\t/**\n\t * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns)\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 */\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 oposed to the regular 1-based columns)\n\t */\n\tpublic static prevRenderTabStop(column: number, tabSize: number): number {\n\t\treturn column - 1 - (column - 1) % 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 */\n\tpublic static prevIndentTabStop(column: number, indentSize: number): number {\n\t\treturn column - 1 - (column - 1) % indentSize;\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 { CharCode } from 'vs/base/common/charCode';\nimport * as strings from 'vs/base/common/strings';\nimport { CursorColumns } from 'vs/editor/common/controller/cursorCommon';\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/modes/languageConfigurationRegistry';\n\nexport interface IShiftCommandOpts {\n\tisUnshift: boolean;\n\ttabSize: number;\n\tindentSize: number;\n\tinsertSpaces: boolean;\n\tuseTabStops: boolean;\n}\n\nconst repeatCache: { [str: string]: string[]; } = Object.create(null);\nexport function cachedStringRepeat(str: string, count: number): string {\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;\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._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\t// if indenting or outdenting on a whitespace only line\n\t\tif (this._selection.isEmpty()) {\n\t\t\tif (/^\\s*$/.test(model.getLineContent(startLine))) {\n\t\t\t\tthis._useLastEditRangeForCursorEndPosition = true;\n\t\t\t}\n\t\t}\n\n\t\tif (this._opts.useTabStops) {\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\tlet 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\tlet 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\tlet enterAction = LanguageConfigurationRegistry.getRawEnterActionAtPosition(model, 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) {\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\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) {\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\tlet 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\tlet initialStartColumn = this._selection.startColumn;\n\t\t\tlet 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 { CursorColumns, CursorConfiguration, ICursorSimpleModel, SingleCursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\n\nexport interface IColumnSelectResult {\n\tviewStates: SingleCursorState[];\n\treversed: boolean;\n\ttoLineNumber: number;\n\ttoVisualColumn: number;\n}\n\nexport class ColumnSelection {\n\n\tprivate static _columnSelect(config: CursorConfiguration, model: ICursorSimpleModel, fromLineNumber: number, fromVisibleColumn: number, toLineNumber: number, toVisibleColumn: number): IColumnSelectResult {\n\t\tlet lineCount = Math.abs(toLineNumber - fromLineNumber) + 1;\n\t\tlet reversed = (fromLineNumber > toLineNumber);\n\t\tlet isRTL = (fromVisibleColumn > toVisibleColumn);\n\t\tlet isLTR = (fromVisibleColumn < toVisibleColumn);\n\n\t\tlet 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\tlet lineNumber = fromLineNumber + (reversed ? -i : i);\n\n\t\t\tlet startColumn = CursorColumns.columnFromVisibleColumn2(config, model, lineNumber, fromVisibleColumn);\n\t\t\tlet endColumn = CursorColumns.columnFromVisibleColumn2(config, model, lineNumber, toVisibleColumn);\n\t\t\tlet visibleStartColumn = CursorColumns.visibleColumnFromColumn2(config, model, new Position(lineNumber, startColumn));\n\t\t\tlet visibleEndColumn = CursorColumns.visibleColumnFromColumn2(config, 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\treturn {\n\t\t\tviewStates: result,\n\t\t\treversed: reversed,\n\t\t\ttoLineNumber: toLineNumber,\n\t\t\ttoVisualColumn: toVisibleColumn\n\t\t};\n\t}\n\n\tpublic static columnSelect(config: CursorConfiguration, model: ICursorSimpleModel, fromViewSelection: Selection, toViewLineNumber: number, toViewVisualColumn: number): IColumnSelectResult {\n\t\tconst fromViewPosition = new Position(fromViewSelection.selectionStartLineNumber, fromViewSelection.selectionStartColumn);\n\t\tconst fromViewVisibleColumn = CursorColumns.visibleColumnFromColumn2(config, model, fromViewPosition);\n\t\treturn ColumnSelection._columnSelect(config, model, fromViewPosition.lineNumber, fromViewVisibleColumn, toViewLineNumber, toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectLeft(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, toViewLineNumber: number, toViewVisualColumn: number): IColumnSelectResult {\n\t\tif (toViewVisualColumn > 1) {\n\t\t\ttoViewVisualColumn--;\n\t\t}\n\n\t\treturn this.columnSelect(config, model, cursor.selection, toViewLineNumber, toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectRight(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, toViewLineNumber: number, toViewVisualColumn: number): IColumnSelectResult {\n\t\tlet maxVisualViewColumn = 0;\n\t\tlet minViewLineNumber = Math.min(cursor.position.lineNumber, toViewLineNumber);\n\t\tlet maxViewLineNumber = Math.max(cursor.position.lineNumber, toViewLineNumber);\n\t\tfor (let lineNumber = minViewLineNumber; lineNumber <= maxViewLineNumber; lineNumber++) {\n\t\t\tlet lineMaxViewColumn = model.getLineMaxColumn(lineNumber);\n\t\t\tlet lineMaxVisualViewColumn = CursorColumns.visibleColumnFromColumn2(config, model, new Position(lineNumber, lineMaxViewColumn));\n\t\t\tmaxVisualViewColumn = Math.max(maxVisualViewColumn, lineMaxVisualViewColumn);\n\t\t}\n\n\t\tif (toViewVisualColumn < maxVisualViewColumn) {\n\t\t\ttoViewVisualColumn++;\n\t\t}\n\n\t\treturn this.columnSelect(config, model, cursor.selection, toViewLineNumber, toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectUp(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, isPaged: boolean, toViewLineNumber: number, toViewVisualColumn: number): IColumnSelectResult {\n\t\tlet linesCount = isPaged ? config.pageSize : 1;\n\n\t\ttoViewLineNumber -= linesCount;\n\t\tif (toViewLineNumber < 1) {\n\t\t\ttoViewLineNumber = 1;\n\t\t}\n\n\t\treturn this.columnSelect(config, model, cursor.selection, toViewLineNumber, toViewVisualColumn);\n\t}\n\n\tpublic static columnSelectDown(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, isPaged: boolean, toViewLineNumber: number, toViewVisualColumn: number): IColumnSelectResult {\n\t\tlet linesCount = isPaged ? config.pageSize : 1;\n\n\t\ttoViewLineNumber += linesCount;\n\t\tif (toViewLineNumber > model.getLineCount()) {\n\t\t\ttoViewLineNumber = model.getLineCount();\n\t\t}\n\n\t\treturn this.columnSelect(config, model, cursor.selection, toViewLineNumber, toViewVisualColumn);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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, CursorConfiguration, ICursorSimpleModel, SingleCursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\n\nexport class CursorPosition {\n\t_cursorPositionBrand: void;\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\n\tpublic static left(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number): CursorPosition {\n\n\t\tif (column > model.getLineMinColumn(lineNumber)) {\n\t\t\tif (CursorColumns.isLowSurrogate(model, lineNumber, column - 2)) {\n\t\t\t\t// character before column is a low surrogate\n\t\t\t\tcolumn = column - 2;\n\t\t\t} else {\n\t\t\t\tcolumn = column - 1;\n\t\t\t}\n\t\t} else if (lineNumber > 1) {\n\t\t\tlineNumber = lineNumber - 1;\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t}\n\n\t\treturn new CursorPosition(lineNumber, column, 0);\n\t}\n\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 we are in selection mode, move left without selection cancels selection and puts 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\tlet r = MoveOperations.left(config, model, cursor.position.lineNumber, cursor.position.column - (noOfColumns - 1));\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 right(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number): CursorPosition {\n\n\t\tif (column < model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (CursorColumns.isHighSurrogate(model, lineNumber, column - 1)) {\n\t\t\t\t// character after column is a high surrogate\n\t\t\t\tcolumn = column + 2;\n\t\t\t} else {\n\t\t\t\tcolumn = column + 1;\n\t\t\t}\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\n\t\treturn new CursorPosition(lineNumber, 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\tlet r = MoveOperations.right(config, model, cursor.position.lineNumber, cursor.position.column + (noOfColumns - 1));\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 down(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number, leftoverVisibleColumns: number, count: number, allowMoveOnLastLine: boolean): CursorPosition {\n\t\tconst currentVisibleColumn = CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns;\n\n\t\tlineNumber = lineNumber + count;\n\t\tlet lineCount = model.getLineCount();\n\t\tif (lineNumber > lineCount) {\n\t\t\tlineNumber = lineCount;\n\t\t\tif (allowMoveOnLastLine) {\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\tif (CursorColumns.isInsideSurrogatePair(model, lineNumber, column)) {\n\t\t\t\t\tcolumn = column - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tcolumn = CursorColumns.columnFromVisibleColumn2(config, model, lineNumber, currentVisibleColumn);\n\t\t\tif (CursorColumns.isInsideSurrogatePair(model, lineNumber, column)) {\n\t\t\t\tcolumn = column - 1;\n\t\t\t}\n\t\t}\n\n\t\tleftoverVisibleColumns = currentVisibleColumn - CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize);\n\n\t\treturn new CursorPosition(lineNumber, column, leftoverVisibleColumns);\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\tlet 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\tlet selection = cursor.selection;\n\n\t\tlet selectionStart = MoveOperations.down(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false);\n\t\tlet 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\tconst currentVisibleColumn = CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns;\n\n\t\tlineNumber = lineNumber - count;\n\t\tif (lineNumber < 1) {\n\t\t\tlineNumber = 1;\n\t\t\tif (allowMoveOnFirstLine) {\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\tif (CursorColumns.isInsideSurrogatePair(model, lineNumber, column)) {\n\t\t\t\t\tcolumn = column - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tcolumn = CursorColumns.columnFromVisibleColumn2(config, model, lineNumber, currentVisibleColumn);\n\t\t\tif (CursorColumns.isInsideSurrogatePair(model, lineNumber, column)) {\n\t\t\t\tcolumn = column - 1;\n\t\t\t}\n\t\t}\n\n\t\tleftoverVisibleColumns = currentVisibleColumn - CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize);\n\n\t\treturn new CursorPosition(lineNumber, column, leftoverVisibleColumns);\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\tlet 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\tlet selection = cursor.selection;\n\n\t\tlet selectionStart = MoveOperations.up(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false);\n\t\tlet 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\tpublic static moveToBeginningOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {\n\t\tlet lineNumber = cursor.position.lineNumber;\n\t\tlet minColumn = model.getLineMinColumn(lineNumber);\n\t\tlet firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || minColumn;\n\n\t\tlet column: number;\n\n\t\tlet 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): SingleCursorState {\n\t\tlet lineNumber = cursor.position.lineNumber;\n\t\tlet maxColumn = model.getLineMaxColumn(lineNumber);\n\t\treturn cursor.move(inSelectionMode, lineNumber, 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\tlet lastLineNumber = model.getLineCount();\n\t\tlet 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 { CursorColumns, CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/controller/cursorCommon';\nimport { MoveOperations } from 'vs/editor/common/controller/cursorMoveOperations';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand } from 'vs/editor/common/editorCommon';\n\nexport class DeleteOperations {\n\n\tpublic static deleteRight(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): [boolean, Array<ICommand | null>] {\n\t\tlet 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\tlet position = selection.getPosition();\n\t\t\t\tlet rightOfPosition = MoveOperations.right(config, model, position.lineNumber, position.column);\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\tprivate static _isAutoClosingPairDelete(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): boolean {\n\t\tif (config.autoClosingBrackets === 'never' && config.autoClosingQuotes === '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\tconst character = lineText[position.column - 2];\n\n\t\t\tif (!config.autoClosingPairsOpen.hasOwnProperty(character)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (isQuote(character)) {\n\t\t\t\tif (config.autoClosingQuotes === 'never') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (config.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[position.column - 1];\n\t\t\tconst closeCharacter = config.autoClosingPairsOpen[character];\n\n\t\t\tif (afterCharacter !== closeCharacter) {\n\t\t\t\treturn false;\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\tlet 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[]): [boolean, Array<ICommand | null>] {\n\n\t\tif (this._isAutoClosingPairDelete(config, model, selections)) {\n\t\t\treturn this._runAutoClosingPairDelete(config, model, selections);\n\t\t}\n\n\t\tlet 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 selection = selections[i];\n\n\t\t\tlet deleteSelection: Range = selection;\n\n\t\t\tif (deleteSelection.isEmpty()) {\n\t\t\t\tlet position = selection.getPosition();\n\n\t\t\t\tif (config.useTabStops && position.column > 1) {\n\t\t\t\t\tlet lineContent = model.getLineContent(position.lineNumber);\n\n\t\t\t\t\tlet firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n\t\t\t\t\tlet lastIndentationColumn = (\n\t\t\t\t\t\tfirstNonWhitespaceIndex === -1\n\t\t\t\t\t\t\t? /* entire string is whitespace */lineContent.length + 1\n\t\t\t\t\t\t\t: firstNonWhitespaceIndex + 1\n\t\t\t\t\t);\n\n\t\t\t\t\tif (position.column <= lastIndentationColumn) {\n\t\t\t\t\t\tlet fromVisibleColumn = CursorColumns.visibleColumnFromColumn2(config, model, position);\n\t\t\t\t\t\tlet toVisibleColumn = CursorColumns.prevIndentTabStop(fromVisibleColumn, config.indentSize);\n\t\t\t\t\t\tlet toColumn = CursorColumns.columnFromVisibleColumn2(config, model, position.lineNumber, toVisibleColumn);\n\t\t\t\t\t\tdeleteSelection = new Range(position.lineNumber, toColumn, position.lineNumber, position.column);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdeleteSelection = new Range(position.lineNumber, position.column - 1, position.lineNumber, position.column);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet leftOfPosition = MoveOperations.left(config, model, position.lineNumber, position.column);\n\t\t\t\t\tdeleteSelection = new Range(\n\t\t\t\t\t\tleftOfPosition.lineNumber,\n\t\t\t\t\t\tleftOfPosition.column,\n\t\t\t\t\t\tposition.lineNumber,\n\t\t\t\t\t\tposition.column\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (deleteSelection.isEmpty()) {\n\t\t\t\t// Probably at beginning 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 cut(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): EditOperationResult {\n\t\tlet commands: Array<ICommand | null> = [];\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\tlet 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) {\n\t\t\t\t\t\t// Cutting the last line & there are more than 1 lines in the model\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\tlet 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\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport * as strings from 'vs/base/common/strings';\nimport { ReplaceCommand, ReplaceCommandWithOffsetCursorState, ReplaceCommandWithoutChangingPosition } from 'vs/editor/common/commands/replaceCommand';\nimport { ShiftCommand } from 'vs/editor/common/commands/shiftCommand';\nimport { SurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand';\nimport { CursorColumns, CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from 'vs/editor/common/controller/cursorCommon';\nimport { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { EnterAction, IndentAction } from 'vs/editor/common/modes/languageConfiguration';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { IElectricAction } from 'vs/editor/common/modes/supports/electricCharacter';\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\tlet 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});\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] {\n\t\tlet 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});\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\tlet 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\tlet commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tlet position = selection.getPosition();\n\n\t\t\tif (pasteOnNewLine && text.indexOf('\\n') !== text.length - 1) {\n\t\t\t\tpasteOnNewLine = false;\n\t\t\t}\n\t\t\tif (pasteOnNewLine && selection.startLineNumber !== selection.endLineNumber) {\n\t\t\t\tpasteOnNewLine = false;\n\t\t\t}\n\t\t\tif (pasteOnNewLine && selection.startColumn === model.getLineMinColumn(selection.startLineNumber) && selection.endColumn === model.getLineMaxColumn(selection.startLineNumber)) {\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\tlet typeSelection = new Range(position.lineNumber, 1, position.lineNumber, 1);\n\t\t\t\tcommands[i] = new ReplaceCommand(typeSelection, text);\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(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\t// Remove trailing \\n if present\n\t\tif (text.charCodeAt(text.length - 1) === CharCode.LineFeed) {\n\t\t\ttext = text.substr(0, text.length - 1);\n\t\t}\n\t\tlet lines = text.split(/\\r\\n|\\r|\\n/);\n\t\tif (lines.length === selections.length) {\n\t\t\treturn lines;\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(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\tlet expectedIndentAction = config.autoIndent ? LanguageConfigurationRegistry.getInheritIndentForLine(model, lineNumber, false) : null;\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\tlet lineText = model.getLineContent(lastLineNumber);\n\t\t\t\tlet 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\tlet maxColumn = model.getLineMaxColumn(lastLineNumber);\n\t\t\tlet expectedEnterAction = LanguageConfigurationRegistry.getEnterAction(model, new Range(lastLineNumber, maxColumn, lastLineNumber, maxColumn));\n\t\t\tif (expectedEnterAction) {\n\t\t\t\tindentation = expectedEnterAction.indentation;\n\t\t\t\taction = expectedEnterAction.enterAction;\n\t\t\t\tif (action) {\n\t\t\t\t\tindentation += action.appendText;\n\t\t\t\t}\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\tlet position = selection.getStartPosition();\n\t\tif (config.insertSpaces) {\n\t\t\tlet visibleColumnFromColumn = CursorColumns.visibleColumnFromColumn2(config, model, position);\n\t\t\tlet indentSize = config.indentSize;\n\t\t\tlet 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\tlet 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\tlet 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\tlet possibleTypeText = config.normalizeIndentation(goodIndent);\n\t\t\t\t\tif (!strings.startsWith(lineText, 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\tlet 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});\n\t\t\t}\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static replacePreviousChar(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], txt: string, replaceCharCnt: number): EditOperationResult {\n\t\tlet commands: Array<ICommand | null> = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\n\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t// looks like https://github.com/Microsoft/vscode/issues/2773\n\t\t\t\t// where a cursor operation occurred before a canceled composition\n\t\t\t\t// => ignore composition\n\t\t\t\tcommands[i] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet pos = selection.getPosition();\n\t\t\tlet startColumn = Math.max(1, pos.column - replaceCharCnt);\n\t\t\tlet range = new Range(pos.lineNumber, startColumn, pos.lineNumber, pos.column);\n\t\t\tcommands[i] = new ReplaceCommand(range, txt);\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Typing, commands, {\n\t\t\tshouldPushStackElementBefore: (prevEditOperationType !== EditOperationType.Typing),\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\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 (!model.isCheapToTokenize(range.getStartPosition().lineNumber)) {\n\t\t\tlet lineText = model.getLineContent(range.startLineNumber);\n\t\t\tlet 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\tlet r = LanguageConfigurationRegistry.getEnterAction(model, range);\n\t\tif (r) {\n\t\t\tlet enterAction = r.enterAction;\n\t\t\tlet indentation = r.indentation;\n\n\t\t\tif (enterAction.indentAction === IndentAction.None) {\n\t\t\t\t// Nothing special\n\t\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition);\n\n\t\t\t} else if (enterAction.indentAction === IndentAction.Indent) {\n\t\t\t\t// Indent once\n\t\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition);\n\n\t\t\t} else if (enterAction.indentAction === IndentAction.IndentOutdent) {\n\t\t\t\t// Ultra special\n\t\t\t\tlet normalIndent = config.normalizeIndentation(indentation);\n\t\t\t\tlet increasedIndent = config.normalizeIndentation(indentation + enterAction.appendText);\n\n\t\t\t\tlet 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 (enterAction.indentAction === IndentAction.Outdent) {\n\t\t\t\tlet actualIndentation = TypeOperations.unshiftIndent(config, indentation);\n\t\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(actualIndentation + enterAction.appendText), keepPosition);\n\t\t\t}\n\t\t}\n\n\t\t// no enter rules applied, we should check indentation rules then.\n\t\tif (!config.autoIndent) {\n\t\t\t// Nothing special\n\t\t\tlet lineText = model.getLineContent(range.startLineNumber);\n\t\t\tlet 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\tlet ir = LanguageConfigurationRegistry.getIndentForEnter(model, range, {\n\t\t\tunshiftIndent: (indent) => {\n\t\t\t\treturn TypeOperations.unshiftIndent(config, indent);\n\t\t\t},\n\t\t\tshiftIndent: (indent) => {\n\t\t\t\treturn TypeOperations.shiftIndent(config, indent);\n\t\t\t},\n\t\t\tnormalizeIndentation: (indent) => {\n\t\t\t\treturn config.normalizeIndentation(indent);\n\t\t\t}\n\t\t}, config.autoIndent);\n\n\t\tlet lineText = model.getLineContent(range.startLineNumber);\n\t\tlet indentation = strings.getLeadingWhitespace(lineText).substring(0, range.startColumn - 1);\n\n\t\tif (ir) {\n\t\t\tlet oldEndViewColumn = CursorColumns.visibleColumnFromColumn2(config, model, range.getEndPosition());\n\t\t\tlet oldEndColumn = range.endColumn;\n\n\t\t\tlet beforeText = '\\n';\n\t\t\tif (indentation !== config.normalizeIndentation(ir.beforeEnter)) {\n\t\t\t\tbeforeText = config.normalizeIndentation(ir.beforeEnter) + lineText.substring(indentation.length, range.startColumn - 1) + '\\n';\n\t\t\t\trange = new Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn);\n\t\t\t}\n\n\t\t\tlet newLineContent = model.getLineContent(range.endLineNumber);\n\t\t\tlet firstNonWhitespace = strings.firstNonWhitespaceIndex(newLineContent);\n\t\t\tif (firstNonWhitespace >= 0) {\n\t\t\t\trange = range.setEndPosition(range.endLineNumber, Math.max(range.endColumn, firstNonWhitespace + 1));\n\t\t\t} else {\n\t\t\t\trange = range.setEndPosition(range.endLineNumber, model.getLineMaxColumn(range.endLineNumber));\n\t\t\t}\n\n\t\t\tif (keepPosition) {\n\t\t\t\treturn new ReplaceCommandWithoutChangingPosition(range, beforeText + config.normalizeIndentation(ir.afterEnter), true);\n\t\t\t} else {\n\t\t\t\tlet offset = 0;\n\t\t\t\tif (oldEndColumn <= firstNonWhitespace + 1) {\n\t\t\t\t\tif (!config.insertSpaces) {\n\t\t\t\t\t\toldEndViewColumn = Math.ceil(oldEndViewColumn / config.indentSize);\n\t\t\t\t\t}\n\t\t\t\t\toffset = Math.min(oldEndViewColumn + 1 - config.normalizeIndentation(ir.afterEnter).length - 1, 0);\n\t\t\t\t}\n\t\t\t\treturn new ReplaceCommandWithOffsetCursorState(range, beforeText + config.normalizeIndentation(ir.afterEnter), 0, offset, true);\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn TypeOperations._typeCommand(range, '\\n' + config.normalizeIndentation(indentation), keepPosition);\n\t\t}\n\t}\n\n\tprivate static _isAutoIndentType(config: CursorConfiguration, model: ITextModel, selections: Selection[]): boolean {\n\t\tif (!config.autoIndent) {\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\tlet currentIndentation = LanguageConfigurationRegistry.getIndentationAtPosition(model, range.startLineNumber, range.startColumn);\n\t\tlet actualIndentation = LanguageConfigurationRegistry.getIndentActionForType(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\tlet 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, 0, 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, 0, 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 _isAutoClosingCloseCharType(config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): boolean {\n\t\tconst autoCloseConfig = isQuote(ch) ? config.autoClosingQuotes : config.autoClosingBrackets;\n\n\t\tif (autoCloseConfig === 'never' || !config.autoClosingPairsClose.hasOwnProperty(ch)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isEqualPair = (ch === config.autoClosingPairsClose[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\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\tif (isEqualPair) {\n\t\t\t\tconst lineTextBeforeCursor = lineText.substr(0, position.column - 1);\n\t\t\t\tconst chCntBefore = this._countNeedlesInHaystack(lineTextBeforeCursor, ch);\n\t\t\t\tif (chCntBefore % 2 === 0) {\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 _countNeedlesInHaystack(haystack: string, needle: string): number {\n\t\tlet cnt = 0;\n\t\tlet lastIndex = -1;\n\t\twhile ((lastIndex = haystack.indexOf(needle, lastIndex + 1)) !== -1) {\n\t\t\tcnt++;\n\t\t}\n\t\treturn cnt;\n\t}\n\n\tprivate static _runAutoClosingCloseCharType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult {\n\t\tlet 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.Typing, commands, {\n\t\t\tshouldPushStackElementBefore: (prevEditOperationType !== EditOperationType.Typing),\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tprivate static _isBeforeClosingBrace(config: CursorConfiguration, ch: string, characterAfter: string) {\n\t\tconst thisBraceIsSymmetric = (config.autoClosingPairsOpen[ch] === ch);\n\t\tlet isBeforeCloseBrace = false;\n\t\tfor (let otherCloseBrace in config.autoClosingPairsClose) {\n\t\t\tconst otherBraceIsSymmetric = (config.autoClosingPairsOpen[otherCloseBrace] === otherCloseBrace);\n\t\t\tif (!thisBraceIsSymmetric && otherBraceIsSymmetric) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (characterAfter === otherCloseBrace) {\n\t\t\t\tisBeforeCloseBrace = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn isBeforeCloseBrace;\n\t}\n\n\tprivate static _isAutoClosingOpenCharType(config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): boolean {\n\t\tconst chIsQuote = isQuote(ch);\n\t\tconst autoCloseConfig = chIsQuote ? config.autoClosingQuotes : config.autoClosingBrackets;\n\n\t\tif (autoCloseConfig === 'never' || !config.autoClosingPairsOpen.hasOwnProperty(ch)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet shouldAutoCloseBefore = chIsQuote ? config.shouldAutoCloseBefore.quote : config.shouldAutoCloseBefore.bracket;\n\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tconst selection = selections[i];\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\n\t\t\t// Do not auto-close ' or \" after a word character\n\t\t\tif ((chIsQuote && position.column > 1) && autoCloseConfig !== 'always') {\n\t\t\t\tconst wordSeparators = getMapForWordSeparators(config.wordSeparators);\n\t\t\t\tconst characterBeforeCode = lineText.charCodeAt(position.column - 2);\n\t\t\t\tconst characterBeforeType = wordSeparators.get(characterBeforeCode);\n\t\t\t\tif (characterBeforeType === WordCharacterClass.Regular) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Only consider auto closing the pair if a space follows or if another autoclosed pair follows\n\t\t\tconst characterAfter = lineText.charAt(position.column - 1);\n\t\t\tif (characterAfter) {\n\t\t\t\tlet isBeforeCloseBrace = TypeOperations._isBeforeClosingBrace(config, ch, characterAfter);\n\n\t\t\t\tif (!isBeforeCloseBrace && !shouldAutoCloseBefore(characterAfter)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!model.isCheapToTokenize(position.lineNumber)) {\n\t\t\t\t// Do not force tokenization\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tmodel.forceTokenization(position.lineNumber);\n\t\t\tconst lineTokens = model.getLineTokens(position.lineNumber);\n\n\t\t\tlet shouldAutoClosePair = false;\n\t\t\ttry {\n\t\t\t\tshouldAutoClosePair = LanguageConfigurationRegistry.shouldAutoClosePair(ch, lineTokens, position.column);\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\n\t\t\tif (!shouldAutoClosePair) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate static _runAutoClosingOpenCharType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult {\n\t\tlet 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.autoClosingPairsOpen[ch];\n\t\t\tcommands[i] = new ReplaceCommandWithOffsetCursorState(selection, ch + closeCharacter, 0, -closeCharacter.length);\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Typing, 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\tlet 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\tlet position = selection.getPosition();\n\t\tmodel.forceTokenization(position.lineNumber);\n\t\tlet lineTokens = model.getLineTokens(position.lineNumber);\n\n\t\tlet electricAction: IElectricAction | null;\n\t\ttry {\n\t\t\telectricAction = LanguageConfigurationRegistry.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.appendText) {\n\t\t\tconst command = new ReplaceCommandWithOffsetCursorState(selection, ch + electricAction.appendText, 0, -electricAction.appendText.length);\n\t\t\treturn new EditOperationResult(EditOperationType.Typing, [command], {\n\t\t\t\tshouldPushStackElementBefore: false,\n\t\t\t\tshouldPushStackElementAfter: true\n\t\t\t});\n\t\t}\n\n\t\tif (electricAction.matchOpenBracket) {\n\t\t\tlet endColumn = (lineTokens.getLineContent() + ch).lastIndexOf(electricAction.matchOpenBracket) + 1;\n\t\t\tlet match = model.findMatchingBracketUp(electricAction.matchOpenBracket, {\n\t\t\t\tlineNumber: position.lineNumber,\n\t\t\t\tcolumn: endColumn\n\t\t\t});\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\tlet matchLine = model.getLineContent(match.startLineNumber);\n\t\t\t\tlet matchLineIndentation = strings.getLeadingWhitespace(matchLine);\n\t\t\t\tlet newIndentation = config.normalizeIndentation(matchLineIndentation);\n\n\t\t\t\tlet lineText = model.getLineContent(position.lineNumber);\n\t\t\t\tlet lineFirstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(position.lineNumber) || position.column;\n\n\t\t\t\tlet prefix = lineText.substring(lineFirstNonBlankColumn - 1, position.column - 1);\n\t\t\t\tlet typeText = newIndentation + prefix + ch;\n\n\t\t\t\tlet 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(EditOperationType.Typing, [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\tpublic static compositionEndWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[]): EditOperationResult | null {\n\t\tif (config.autoClosingQuotes === 'never') {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet commands: ICommand[] = [];\n\n\t\tfor (let i = 0; i < selections.length; i++) {\n\t\t\tif (!selections[i].isEmpty()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst position = selections[i].getPosition();\n\t\t\tconst lineText = model.getLineContent(position.lineNumber);\n\t\t\tconst ch = lineText.charAt(position.column - 2);\n\n\t\t\tif (config.autoClosingPairsClose.hasOwnProperty(ch)) { // first of all, it's a closing tag\n\t\t\t\tif (ch === config.autoClosingPairsClose[ch] /** isEqualPair */) {\n\t\t\t\t\tconst lineTextBeforeCursor = lineText.substr(0, position.column - 2);\n\t\t\t\t\tconst chCntBefore = this._countNeedlesInHaystack(lineTextBeforeCursor, ch);\n\n\t\t\t\t\tif (chCntBefore % 2 === 1) {\n\t\t\t\t\t\tcontinue; // it pairs with the opening tag.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As we are not typing in a new character, so we don't need to run `_runAutoClosingCloseCharType`\n\t\t\t// Next step, let's try to check if it's an open char.\n\t\t\tif (config.autoClosingPairsOpen.hasOwnProperty(ch)) {\n\t\t\t\tif (isQuote(ch) && position.column > 2) {\n\t\t\t\t\tconst wordSeparators = getMapForWordSeparators(config.wordSeparators);\n\t\t\t\t\tconst characterBeforeCode = lineText.charCodeAt(position.column - 3);\n\t\t\t\t\tconst characterBeforeType = wordSeparators.get(characterBeforeCode);\n\t\t\t\t\tif (characterBeforeType === WordCharacterClass.Regular) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst characterAfter = lineText.charAt(position.column - 1);\n\n\t\t\t\tif (characterAfter) {\n\t\t\t\t\tlet isBeforeCloseBrace = TypeOperations._isBeforeClosingBrace(config, ch, characterAfter);\n\t\t\t\t\tlet shouldAutoCloseBefore = isQuote(ch) ? config.shouldAutoCloseBefore.quote : config.shouldAutoCloseBefore.bracket;\n\t\t\t\t\tif (isBeforeCloseBrace) {\n\t\t\t\t\t\t// In normal auto closing logic, we will auto close if the cursor is even before a closing brace intentionally.\n\t\t\t\t\t\t// However for composition mode, we do nothing here as users might clear all the characters for composition and we don't want to do a unnecessary auto close.\n\t\t\t\t\t\t// Related: microsoft/vscode#57250.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!shouldAutoCloseBefore(characterAfter)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!model.isCheapToTokenize(position.lineNumber)) {\n\t\t\t\t\t// Do not force tokenization\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tmodel.forceTokenization(position.lineNumber);\n\t\t\t\tconst lineTokens = model.getLineTokens(position.lineNumber);\n\n\t\t\t\tlet shouldAutoClosePair = false;\n\n\t\t\t\ttry {\n\t\t\t\t\tshouldAutoClosePair = LanguageConfigurationRegistry.shouldAutoClosePair(ch, lineTokens, position.column - 1);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tonUnexpectedError(e);\n\t\t\t\t}\n\n\t\t\t\tif (shouldAutoClosePair) {\n\t\t\t\t\tconst closeCharacter = config.autoClosingPairsOpen[ch];\n\t\t\t\t\tcommands[i] = new ReplaceCommandWithOffsetCursorState(selections[i], closeCharacter, 0, -closeCharacter.length);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new EditOperationResult(EditOperationType.Typing, commands, {\n\t\t\tshouldPushStackElementBefore: true,\n\t\t\tshouldPushStackElementAfter: false\n\t\t});\n\t}\n\n\tpublic static typeWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult {\n\n\t\tif (ch === '\\n') {\n\t\t\tlet 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.Typing, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false,\n\t\t\t});\n\t\t}\n\n\t\tif (this._isAutoIndentType(config, model, selections)) {\n\t\t\tlet 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.Typing, 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 (this._isAutoClosingCloseCharType(config, model, selections, ch)) {\n\t\t\treturn this._runAutoClosingCloseCharType(prevEditOperationType, config, model, selections, ch);\n\t\t}\n\n\t\tif (this._isAutoClosingOpenCharType(config, model, selections, ch)) {\n\t\t\treturn this._runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch);\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 (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\tlet 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\t\tlet shouldPushStackElementBefore = (prevEditOperationType !== EditOperationType.Typing);\n\t\tif (ch === ' ') {\n\t\t\tshouldPushStackElementBefore = true;\n\t\t}\n\t\treturn new EditOperationResult(EditOperationType.Typing, commands, {\n\t\t\tshouldPushStackElementBefore: shouldPushStackElementBefore,\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\tlet 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\treturn new EditOperationResult(EditOperationType.Typing, commands, {\n\t\t\tshouldPushStackElementBefore: (prevEditOperationType !== EditOperationType.Typing),\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\tlet 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\tlet 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\tlet 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\tlet 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\tlet 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { CursorConfiguration, ICursorSimpleModel, SingleCursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { WordCharacterClass, WordCharacterClassifier, getMapForWordSeparators } from 'vs/editor/common/controller/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';\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}\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\tlet 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\tlet chCode = lineContent.charCodeAt(chIndex);\n\t\t\tlet 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\tlet len = lineContent.length;\n\t\tfor (let chIndex = startIndex; chIndex < len; chIndex++) {\n\t\t\tlet chCode = lineContent.charCodeAt(chIndex);\n\t\t\tlet 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\tlet 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\tlet len = lineContent.length;\n\n\t\tfor (let chIndex = position.column - 1; chIndex < len; chIndex++) {\n\t\t\tlet chCode = lineContent.charCodeAt(chIndex);\n\t\t\tlet 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\tlet chCode = lineContent.charCodeAt(chIndex);\n\t\t\tlet 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\t\tlet movedToPreviousLine = false;\n\n\t\tif (column === 1) {\n\t\t\tif (lineNumber > 1) {\n\t\t\t\tmovedToPreviousLine = true;\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\n\t\t\tif (prevWordOnLine && !movedToPreviousLine) {\n\t\t\t\t// Special case for Visual Studio compatibility:\n\t\t\t\t// when starting in the trim whitespace at the end of a line,\n\t\t\t\t// go to the end of the last word\n\t\t\t\tconst lastWhitespaceColumn = model.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\t\tif (lastWhitespaceColumn < column) {\n\t\t\t\t\treturn new Position(lineNumber, prevWordOnLine.end + 1);\n\t\t\t\t}\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.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\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 {\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(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range | null {\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\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\tlet 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 _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\tlet len = str.length;\n\t\tfor (let chIndex = startIndex; chIndex < len; chIndex++) {\n\t\t\tlet 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(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range | null {\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\tlet 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\tpublic static word(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean, position: Position): SingleCursorState {\n\t\tconst wordSeparators = getMapForWordSeparators(config.wordSeparators);\n\t\tlet prevWord = WordOperations._findPreviousWordOnLine(wordSeparators, model, position);\n\t\tlet 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\tlet 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\tlet 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\tlet 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(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, selection: Selection, whitespaceHeuristics: boolean): Range {\n\t\tconst candidates = enforceDefined([\n\t\t\tWordOperations.deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, WordNavigationType.WordStart),\n\t\t\tWordOperations.deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, WordNavigationType.WordEnd),\n\t\t\tWordOperations._deleteWordPartLeft(model, selection)\n\t\t]);\n\t\tcandidates.sort(Range.compareRangesUsingEnds);\n\t\treturn candidates[2];\n\t}\n\n\tpublic static deleteWordPartRight(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, selection: Selection, whitespaceHeuristics: boolean): Range {\n\t\tconst candidates = enforceDefined([\n\t\t\tWordOperations.deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, WordNavigationType.WordStart),\n\t\t\tWordOperations.deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, WordNavigationType.WordEnd),\n\t\t\tWordOperations._deleteWordPartRight(model, 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 * Copyright (c) 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 { CursorContext, CursorState, ICursorSimpleModel, PartialCursorState, SingleCursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { MoveOperations } from 'vs/editor/common/controller/cursorMoveOperations';\nimport { WordOperations } from 'vs/editor/common/controller/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';\n\nexport class CursorMoveCommands {\n\n\tpublic static addCursorDown(context: CursorContext, cursors: CursorState[], useLogicalLine: boolean): PartialCursorState[] {\n\t\tlet result: PartialCursorState[] = [], 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(context.config, context.model, cursor.modelState));\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = CursorState.fromViewState(MoveOperations.translateDown(context.config, context.viewModel, cursor.viewState));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static addCursorUp(context: CursorContext, cursors: CursorState[], useLogicalLine: boolean): PartialCursorState[] {\n\t\tlet result: PartialCursorState[] = [], 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(context.config, context.model, cursor.modelState));\n\t\t\t} else {\n\t\t\t\tresult[resultLen++] = CursorState.fromViewState(MoveOperations.translateUp(context.config, context.viewModel, cursor.viewState));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static moveToBeginningOfLine(context: CursorContext, 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(context, cursor, inSelectionMode);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _moveToLineStart(context: CursorContext, 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 = context.viewModel.getLineFirstNonWhitespaceColumn(currentViewStatelineNumber);\n\t\tconst isBeginningOfViewLine = currentViewStateColumn === firstNonBlankColumn;\n\n\t\tif (!isFirstLineOfWrappedLine && !isBeginningOfViewLine) {\n\t\t\treturn this._moveToLineStartByView(context, cursor, inSelectionMode);\n\t\t} else {\n\t\t\treturn this._moveToLineStartByModel(context, cursor, inSelectionMode);\n\t\t}\n\t}\n\n\tprivate static _moveToLineStartByView(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\treturn CursorState.fromViewState(\n\t\t\tMoveOperations.moveToBeginningOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode)\n\t\t);\n\t}\n\n\tprivate static _moveToLineStartByModel(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\treturn CursorState.fromModelState(\n\t\t\tMoveOperations.moveToBeginningOfLine(context.config, context.model, cursor.modelState, inSelectionMode)\n\t\t);\n\t}\n\n\tpublic static moveToEndOfLine(context: CursorContext, 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._moveToLineEnd(context, cursor, inSelectionMode);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate static _moveToLineEnd(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\tconst viewStatePosition = cursor.viewState.position;\n\t\tconst viewModelMaxColumn = context.viewModel.getLineMaxColumn(viewStatePosition.lineNumber);\n\t\tconst isEndOfViewLine = viewStatePosition.column === viewModelMaxColumn;\n\n\t\tconst modelStatePosition = cursor.modelState.position;\n\t\tconst modelMaxColumn = context.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(context, cursor, inSelectionMode);\n\t\t} else {\n\t\t\treturn this._moveToLineEndByView(context, cursor, inSelectionMode);\n\t\t}\n\t}\n\n\tprivate static _moveToLineEndByView(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\treturn CursorState.fromViewState(\n\t\t\tMoveOperations.moveToEndOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode)\n\t\t);\n\t}\n\n\tprivate static _moveToLineEndByModel(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): PartialCursorState {\n\t\treturn CursorState.fromModelState(\n\t\t\tMoveOperations.moveToEndOfLine(context.config, context.model, cursor.modelState, inSelectionMode)\n\t\t);\n\t}\n\n\tpublic static expandLineSelection(context: CursorContext, cursors: CursorState[]): 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\n\t\t\tconst viewSelection = cursor.viewState.selection;\n\t\t\tconst startLineNumber = viewSelection.startLineNumber;\n\t\t\tconst lineCount = context.viewModel.getLineCount();\n\n\t\t\tlet endLineNumber = viewSelection.endLineNumber;\n\t\t\tlet endColumn: number;\n\t\t\tif (endLineNumber === lineCount) {\n\t\t\t\tendColumn = context.viewModel.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.fromViewState(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(context: CursorContext, 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] = CursorState.fromModelState(MoveOperations.moveToBeginningOfBuffer(context.config, context.model, cursor.modelState, inSelectionMode));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static moveToEndOfBuffer(context: CursorContext, 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] = CursorState.fromModelState(MoveOperations.moveToEndOfBuffer(context.config, context.model, cursor.modelState, inSelectionMode));\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static selectAll(context: CursorContext, cursor: CursorState): PartialCursorState {\n\t\tconst lineCount = context.model.getLineCount();\n\t\tconst maxColumn = context.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(context: CursorContext, cursor: CursorState, inSelectionMode: boolean, _position: IPosition, _viewPosition: IPosition): PartialCursorState {\n\t\tconst position = context.model.validatePosition(_position);\n\t\tconst viewPosition = (\n\t\t\t_viewPosition\n\t\t\t\t? context.validateViewPosition(new Position(_viewPosition.lineNumber, _viewPosition.column), position)\n\t\t\t\t: context.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 = context.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 = context.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 = context.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 = context.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(context: CursorContext, cursor: CursorState, inSelectionMode: boolean, _position: IPosition): PartialCursorState {\n\t\tconst position = context.model.validatePosition(_position);\n\t\treturn CursorState.fromModelState(WordOperations.word(context.config, context.model, cursor.modelState, inSelectionMode, position));\n\t}\n\n\tpublic static cancelSelection(context: CursorContext, 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(context: CursorContext, cursor: CursorState, inSelectionMode: boolean, _position: IPosition, _viewPosition: IPosition): PartialCursorState {\n\t\tconst position = context.model.validatePosition(_position);\n\t\tconst viewPosition = (\n\t\t\t_viewPosition\n\t\t\t\t? context.validateViewPosition(new Position(_viewPosition.lineNumber, _viewPosition.column), position)\n\t\t\t\t: context.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 move(context: CursorContext, cursors: CursorState[], args: CursorMove.ParsedArguments): PartialCursorState[] | null {\n\t\tconst inSelectionMode = args.select;\n\t\tconst value = args.value;\n\n\t\tswitch (args.direction) {\n\t\t\tcase CursorMove.Direction.Left: {\n\t\t\t\tif (args.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(context, 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(context, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.Right: {\n\t\t\t\tif (args.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(context, 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(context, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.Up: {\n\t\t\t\tif (args.unit === CursorMove.Unit.WrappedLine) {\n\t\t\t\t\t// Move up by view lines\n\t\t\t\t\treturn this._moveUpByViewLines(context, 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(context, cursors, inSelectionMode, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase CursorMove.Direction.Down: {\n\t\t\t\tif (args.unit === CursorMove.Unit.WrappedLine) {\n\t\t\t\t\t// Move down by view lines\n\t\t\t\t\treturn this._moveDownByViewLines(context, 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(context, cursors, inSelectionMode, value);\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(context, 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(context, 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(context, 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(context, 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(context, cursors, inSelectionMode);\n\t\t\t}\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 cursor = cursors[0];\n\t\t\t\tconst visibleModelRange = context.getCompletelyVisibleModelRange();\n\t\t\t\tconst modelLineNumber = this._firstLineNumberInRange(context.model, visibleModelRange, value);\n\t\t\t\tconst modelColumn = context.model.getLineFirstNonWhitespaceColumn(modelLineNumber);\n\t\t\t\treturn [this._moveToModelPosition(context, cursor, 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 cursor = cursors[0];\n\t\t\t\tconst visibleModelRange = context.getCompletelyVisibleModelRange();\n\t\t\t\tconst modelLineNumber = this._lastLineNumberInRange(context.model, visibleModelRange, value);\n\t\t\t\tconst modelColumn = context.model.getLineFirstNonWhitespaceColumn(modelLineNumber);\n\t\t\t\treturn [this._moveToModelPosition(context, cursor, 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 cursor = cursors[0];\n\t\t\t\tconst visibleModelRange = context.getCompletelyVisibleModelRange();\n\t\t\t\tconst modelLineNumber = Math.round((visibleModelRange.startLineNumber + visibleModelRange.endLineNumber) / 2);\n\t\t\t\tconst modelColumn = context.model.getLineFirstNonWhitespaceColumn(modelLineNumber);\n\t\t\t\treturn [this._moveToModelPosition(context, cursor, 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 visibleViewRange = context.getCompletelyVisibleViewRange();\n\t\t\t\tlet 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(context, cursor, visibleViewRange, inSelectionMode);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\n\tpublic static findPositionInViewportIfOutside(context: CursorContext, cursor: CursorState, visibleViewRange: Range, inSelectionMode: boolean): PartialCursorState {\n\t\tlet 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\tif (viewLineNumber > visibleViewRange.endLineNumber - 1) {\n\t\t\t\tviewLineNumber = visibleViewRange.endLineNumber - 1;\n\t\t\t}\n\t\t\tif (viewLineNumber < visibleViewRange.startLineNumber) {\n\t\t\t\tviewLineNumber = visibleViewRange.startLineNumber;\n\t\t\t}\n\t\t\tconst viewColumn = context.viewModel.getLineFirstNonWhitespaceColumn(viewLineNumber);\n\t\t\treturn this._moveToViewPosition(context, cursor, inSelectionMode, viewLineNumber, viewColumn);\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(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean, noOfColumns: number): 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\n\t\t\tlet newViewState = MoveOperations.moveLeft(context.config, context.viewModel, cursor.viewState, inSelectionMode, noOfColumns);\n\n\t\t\tif (noOfColumns === 1 && newViewState.position.lineNumber !== cursor.viewState.position.lineNumber) {\n\t\t\t\t// moved over to the previous view line\n\t\t\t\tconst newViewModelPosition = context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(newViewState.position);\n\t\t\t\tif (newViewModelPosition.lineNumber === cursor.modelState.position.lineNumber) {\n\t\t\t\t\t// stayed on the same model line => pass wrapping point where 2 view positions map to a single model position\n\t\t\t\t\tnewViewState = MoveOperations.moveLeft(context.config, context.viewModel, newViewState, inSelectionMode, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult[i] = CursorState.fromViewState(newViewState);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveHalfLineLeft(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst halfLine = Math.round(context.viewModel.getLineContent(viewLineNumber).length / 2);\n\t\t\tresult[i] = CursorState.fromViewState(MoveOperations.moveLeft(context.config, context.viewModel, cursor.viewState, inSelectionMode, halfLine));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveRight(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean, noOfColumns: number): 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\tlet newViewState = MoveOperations.moveRight(context.config, context.viewModel, cursor.viewState, inSelectionMode, noOfColumns);\n\n\t\t\tif (noOfColumns === 1 && newViewState.position.lineNumber !== cursor.viewState.position.lineNumber) {\n\t\t\t\t// moved over to the next view line\n\t\t\t\tconst newViewModelPosition = context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(newViewState.position);\n\t\t\t\tif (newViewModelPosition.lineNumber === cursor.modelState.position.lineNumber) {\n\t\t\t\t\t// stayed on the same model line => pass wrapping point where 2 view positions map to a single model position\n\t\t\t\t\tnewViewState = MoveOperations.moveRight(context.config, context.viewModel, newViewState, inSelectionMode, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult[i] = CursorState.fromViewState(newViewState);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveHalfLineRight(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst halfLine = Math.round(context.viewModel.getLineContent(viewLineNumber).length / 2);\n\t\t\tresult[i] = CursorState.fromViewState(MoveOperations.moveRight(context.config, context.viewModel, cursor.viewState, inSelectionMode, halfLine));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveDownByViewLines(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): 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] = CursorState.fromViewState(MoveOperations.moveDown(context.config, context.viewModel, cursor.viewState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveDownByModelLines(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): 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] = CursorState.fromModelState(MoveOperations.moveDown(context.config, context.model, cursor.modelState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveUpByViewLines(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): 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] = CursorState.fromViewState(MoveOperations.moveUp(context.config, context.viewModel, cursor.viewState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveUpByModelLines(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean, linesCount: number): 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] = CursorState.fromModelState(MoveOperations.moveUp(context.config, context.model, cursor.modelState, inSelectionMode, linesCount));\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewPosition(context: CursorContext, 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(context: CursorContext, 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(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = context.viewModel.getLineMinColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(context, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewFirstNonWhitespaceColumn(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = context.viewModel.getLineFirstNonWhitespaceColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(context, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewCenterColumn(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = Math.round((context.viewModel.getLineMaxColumn(viewLineNumber) + context.viewModel.getLineMinColumn(viewLineNumber)) / 2);\n\t\t\tresult[i] = this._moveToViewPosition(context, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewMaxColumn(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = context.viewModel.getLineMaxColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(context, cursor, inSelectionMode, viewLineNumber, viewColumn);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _moveToViewLastNonWhitespaceColumn(context: CursorContext, 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\tconst viewLineNumber = cursor.viewState.position.lineNumber;\n\t\t\tconst viewColumn = context.viewModel.getLineLastNonWhitespaceColumn(viewLineNumber);\n\t\t\tresult[i] = this._moveToViewPosition(context, 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\tlet 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'\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', '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\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.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 const enum Direction {\n\t\tLeft,\n\t\tRight,\n\t\tUp,\n\t\tDown,\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 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 { CursorContext, CursorState, SingleCursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport { TrackedRangeStickiness } from 'vs/editor/common/model';\n\nexport class OneCursor {\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\tif (this.modelState.selection.getDirection() === SelectionDirection.LTR) {\n\t\t\treturn new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t\t}\n\t\treturn new Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);\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 _setState(context: CursorContext, modelState: SingleCursorState | null, viewState: SingleCursorState | null): void {\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.convertViewRangeToModelRange(viewState.selectionStart)\n\t\t\t);\n\n\t\t\tconst position = context.model.validatePosition(\n\t\t\t\tcontext.convertViewPositionToModelPosition(viewState.position.lineNumber, viewState.position.column)\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.convertModelPositionToViewPosition(new Position(modelState.selectionStart.startLineNumber, modelState.selectionStart.startColumn));\n\t\t\tconst viewSelectionStart2 = context.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.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.validateViewRange(viewState.selectionStart, modelState.selectionStart);\n\t\t\tconst viewPosition = context.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 { CursorContext, CursorState, PartialCursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { OneCursor } from 'vs/editor/common/controller/oneCursor';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ISelection, Selection } from 'vs/editor/common/core/selection';\n\nexport class CursorCollection {\n\n\tprivate context: CursorContext;\n\n\tprivate primaryCursor: OneCursor;\n\tprivate secondaryCursors: OneCursor[];\n\n\t// An index which identifies the last cursor that was added / moved (think Ctrl+drag)\n\tprivate lastAddedCursorIndex: number;\n\n\tconstructor(context: CursorContext) {\n\t\tthis.context = context;\n\t\tthis.primaryCursor = new OneCursor(context);\n\t\tthis.secondaryCursors = [];\n\t\tthis.lastAddedCursorIndex = 0;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.primaryCursor.dispose(this.context);\n\t\tthis.killSecondaryCursors();\n\t}\n\n\tpublic startTrackingSelections(): void {\n\t\tthis.primaryCursor.startTrackingSelection(this.context);\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tthis.secondaryCursors[i].startTrackingSelection(this.context);\n\t\t}\n\t}\n\n\tpublic stopTrackingSelections(): void {\n\t\tthis.primaryCursor.stopTrackingSelection(this.context);\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tthis.secondaryCursors[i].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\tthis.primaryCursor.ensureValidState(this.context);\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tthis.secondaryCursors[i].ensureValidState(this.context);\n\t\t}\n\t}\n\n\tpublic readSelectionFromMarkers(): Selection[] {\n\t\tlet result: Selection[] = [];\n\t\tresult[0] = this.primaryCursor.readSelectionFromMarkers(this.context);\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tresult[i + 1] = this.secondaryCursors[i].readSelectionFromMarkers(this.context);\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getAll(): CursorState[] {\n\t\tlet result: CursorState[] = [];\n\t\tresult[0] = this.primaryCursor.asCursorState();\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tresult[i + 1] = this.secondaryCursors[i].asCursorState();\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getViewPositions(): Position[] {\n\t\tlet result: Position[] = [];\n\t\tresult[0] = this.primaryCursor.viewState.position;\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tresult[i + 1] = this.secondaryCursors[i].viewState.position;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getSelections(): Selection[] {\n\t\tlet result: Selection[] = [];\n\t\tresult[0] = this.primaryCursor.modelState.selection;\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tresult[i + 1] = this.secondaryCursors[i].modelState.selection;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getViewSelections(): Selection[] {\n\t\tlet result: Selection[] = [];\n\t\tresult[0] = this.primaryCursor.viewState.selection;\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tresult[i + 1] = this.secondaryCursors[i].viewState.selection;\n\t\t}\n\t\treturn result;\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.primaryCursor.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.primaryCursor.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.secondaryCursors.length;\n\t\tconst secondaryStatesLength = secondaryStates.length;\n\n\t\tif (secondaryCursorsLength < secondaryStatesLength) {\n\t\t\tlet 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\tlet removeCnt = secondaryCursorsLength - secondaryStatesLength;\n\t\t\tfor (let i = 0; i < removeCnt; i++) {\n\t\t\t\tthis._removeSecondaryCursor(this.secondaryCursors.length - 1);\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < secondaryStatesLength; i++) {\n\t\t\tthis.secondaryCursors[i].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.secondaryCursors.push(new OneCursor(this.context));\n\t\tthis.lastAddedCursorIndex = this.secondaryCursors.length;\n\t}\n\n\tpublic getLastAddedCursorIndex(): number {\n\t\tif (this.secondaryCursors.length === 0 || 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.secondaryCursors[removeIndex].dispose(this.context);\n\t\tthis.secondaryCursors.splice(removeIndex, 1);\n\t}\n\n\tprivate _getAll(): OneCursor[] {\n\t\tlet result: OneCursor[] = [];\n\t\tresult[0] = this.primaryCursor;\n\t\tfor (let i = 0, len = this.secondaryCursors.length; i < len; i++) {\n\t\t\tresult[i + 1] = this.secondaryCursors[i];\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic normalize(): void {\n\t\tif (this.secondaryCursors.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tlet cursors = this._getAll();\n\n\t\tinterface SortedCursor {\n\t\t\tindex: number;\n\t\t\tselection: Selection;\n\t\t}\n\t\tlet 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\t\tsortedCursors.sort((a, b) => {\n\t\t\tif (a.selection.startLineNumber === b.selection.startLineNumber) {\n\t\t\t\treturn a.selection.startColumn - b.selection.startColumn;\n\t\t\t}\n\t\t\treturn a.selection.startLineNumber - b.selection.startLineNumber;\n\t\t});\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.config.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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport * as strings from 'vs/base/common/strings';\nimport { CursorCollection } from 'vs/editor/common/controller/cursorCollection';\nimport { CursorColumns, CursorConfiguration, CursorContext, CursorState, EditOperationResult, EditOperationType, IColumnSelectData, ICursors, PartialCursorState, RevealTarget } from 'vs/editor/common/controller/cursorCommon';\nimport { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperations';\nimport { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';\nimport { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } 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 { IIdentifiedSingleEditOperation, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { RawContentChangedType } from 'vs/editor/common/model/textModelEvents';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { IViewModel } from 'vs/editor/common/viewModel/viewModel';\n\nfunction containsLineMappingChanged(events: viewEvents.ViewEvent[]): boolean {\n\tfor (let i = 0, len = events.length; i < len; i++) {\n\t\tif (events[i].type === viewEvents.ViewEventType.ViewLineMappingChanged) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nexport class CursorStateChangedEvent {\n\t/**\n\t * The new selections.\n\t * The primary selection is always at index 0.\n\t */\n\treadonly selections: Selection[];\n\t/**\n\t * Source of the call that caused the event.\n\t */\n\treadonly source: string;\n\t/**\n\t * Reason.\n\t */\n\treadonly reason: CursorChangeReason;\n\n\tconstructor(selections: Selection[], source: string, reason: CursorChangeReason) {\n\t\tthis.selections = selections;\n\t\tthis.source = source;\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * A snapshot of the cursor and the model state\n */\nexport class CursorModelState {\n\n\tpublic readonly modelVersionId: number;\n\tpublic readonly cursorState: CursorState[];\n\n\tconstructor(model: ITextModel, cursor: Cursor) {\n\t\tthis.modelVersionId = model.getVersionId();\n\t\tthis.cursorState = cursor.getAll();\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\nexport class Cursor extends viewEvents.ViewEventEmitter implements ICursors {\n\n\tpublic static MAX_CURSOR_COUNT = 10000;\n\n\tprivate readonly _onDidReachMaxCursorCount: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onDidReachMaxCursorCount: Event<void> = this._onDidReachMaxCursorCount.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 _onDidChange: Emitter<CursorStateChangedEvent> = this._register(new Emitter<CursorStateChangedEvent>());\n\tpublic readonly onDidChange: Event<CursorStateChangedEvent> = this._onDidChange.event;\n\n\tprivate readonly _configuration: editorCommon.IConfiguration;\n\tprivate readonly _model: ITextModel;\n\tprivate _knownModelVersionId: number;\n\tprivate readonly _viewModel: IViewModel;\n\tpublic context: CursorContext;\n\tprivate _cursors: CursorCollection;\n\n\tprivate _isHandling: boolean;\n\tprivate _isDoingComposition: boolean;\n\tprivate _columnSelectData: IColumnSelectData | null;\n\tprivate _prevEditOperationType: EditOperationType;\n\n\tconstructor(configuration: editorCommon.IConfiguration, model: ITextModel, viewModel: IViewModel) {\n\t\tsuper();\n\t\tthis._configuration = configuration;\n\t\tthis._model = model;\n\t\tthis._knownModelVersionId = this._model.getVersionId();\n\t\tthis._viewModel = viewModel;\n\t\tthis.context = new CursorContext(this._configuration, this._model, this._viewModel);\n\t\tthis._cursors = new CursorCollection(this.context);\n\n\t\tthis._isHandling = false;\n\t\tthis._isDoingComposition = false;\n\t\tthis._columnSelectData = null;\n\t\tthis._prevEditOperationType = EditOperationType.Other;\n\n\t\tthis._register(this._model.onDidChangeRawContent((e) => {\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\tlet hadFlushEvent = e.containsEvent(RawContentChangedType.Flush);\n\t\t\tthis._onModelContentChanged(hadFlushEvent);\n\t\t}));\n\n\t\tthis._register(viewModel.addEventListener((events: viewEvents.ViewEvent[]) => {\n\t\t\tif (!containsLineMappingChanged(events)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this._knownModelVersionId !== this._model.getVersionId()) {\n\t\t\t\t// There are model change events that I didn't yet receive.\n\t\t\t\t//\n\t\t\t\t// This can happen when editing the model, and the view model receives the change events first,\n\t\t\t\t// and the view model emits line mapping changed events, all before the cursor gets a chance to\n\t\t\t\t// recover from markers.\n\t\t\t\t//\n\t\t\t\t// The model change listener above will be called soon and we'll ensure a valid cursor state there.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Ensure valid state\n\t\t\tthis.setStates('viewModel', CursorChangeReason.NotSet, this.getAll());\n\t\t}));\n\n\t\tconst updateCursorContext = () => {\n\t\t\tthis.context = new CursorContext(this._configuration, this._model, this._viewModel);\n\t\t\tthis._cursors.updateContext(this.context);\n\t\t};\n\t\tthis._register(this._model.onDidChangeLanguage((e) => {\n\t\t\tupdateCursorContext();\n\t\t}));\n\t\tthis._register(this._model.onDidChangeLanguageConfiguration(() => {\n\t\t\tupdateCursorContext();\n\t\t}));\n\t\tthis._register(this._model.onDidChangeOptions(() => {\n\t\t\tupdateCursorContext();\n\t\t}));\n\t\tthis._register(this._configuration.onDidChange((e) => {\n\t\t\tif (CursorConfiguration.shouldRecreate(e)) {\n\t\t\t\tupdateCursorContext();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._cursors.dispose();\n\t\tsuper.dispose();\n\t}\n\n\t// ------ some getters/setters\n\n\tpublic getPrimaryCursor(): 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 getAll(): CursorState[] {\n\t\treturn this._cursors.getAll();\n\t}\n\n\tpublic setStates(source: string, reason: CursorChangeReason, states: PartialCursorState[] | null): void {\n\t\tif (states !== null && states.length > Cursor.MAX_CURSOR_COUNT) {\n\t\t\tstates = states.slice(0, Cursor.MAX_CURSOR_COUNT);\n\t\t\tthis._onDidReachMaxCursorCount.fire(undefined);\n\t\t}\n\n\t\tconst oldState = new CursorModelState(this._model, this);\n\n\t\tthis._cursors.setStates(states);\n\t\tthis._cursors.normalize();\n\t\tthis._columnSelectData = null;\n\n\t\tthis._emitStateChangedIfNecessary(source, reason, oldState);\n\t}\n\n\tpublic setColumnSelectData(columnSelectData: IColumnSelectData): void {\n\t\tthis._columnSelectData = columnSelectData;\n\t}\n\n\tpublic reveal(horizontal: boolean, target: RevealTarget, scrollType: editorCommon.ScrollType): void {\n\t\tthis._revealRange(target, viewEvents.VerticalRevealType.Simple, horizontal, scrollType);\n\t}\n\n\tpublic revealRange(revealHorizontal: boolean, viewRange: Range, verticalType: viewEvents.VerticalRevealType, scrollType: editorCommon.ScrollType) {\n\t\tthis.emitCursorRevealRange(viewRange, verticalType, revealHorizontal, scrollType);\n\t}\n\n\tpublic scrollTo(desiredScrollTop: number): void {\n\t\tthis._viewModel.viewLayout.setScrollPositionSmooth({\n\t\t\tscrollTop: desiredScrollTop\n\t\t});\n\t}\n\n\tpublic saveState(): editorCommon.ICursorState[] {\n\n\t\tlet 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(states: editorCommon.ICursorState[]): void {\n\n\t\tlet 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('restoreState', CursorChangeReason.NotSet, CursorState.fromModelSelections(desiredSelections));\n\t\tthis.reveal(true, RevealTarget.Primary, editorCommon.ScrollType.Immediate);\n\t}\n\n\tprivate _onModelContentChanged(hadFlushEvent: boolean): void {\n\n\t\tthis._prevEditOperationType = EditOperationType.Other;\n\n\t\tif (hadFlushEvent) {\n\t\t\t// a model.setValue() was called\n\t\t\tthis._cursors.dispose();\n\t\t\tthis._cursors = new CursorCollection(this.context);\n\n\t\t\tthis._emitStateChangedIfNecessary('model', CursorChangeReason.ContentFlush, null);\n\t\t} else {\n\t\t\tconst selectionsFromMarkers = this._cursors.readSelectionFromMarkers();\n\t\t\tthis.setStates('modelChange', CursorChangeReason.RecoverFromMarkers, CursorState.fromModelSelections(selectionsFromMarkers));\n\t\t}\n\t}\n\n\tpublic getSelection(): Selection {\n\t\treturn this._cursors.getPrimaryCursor().modelState.selection;\n\t}\n\n\tpublic getColumnSelectData(): 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 primaryPos = primaryCursor.viewState.position;\n\t\treturn {\n\t\t\ttoViewLineNumber: primaryPos.lineNumber,\n\t\t\ttoViewVisualColumn: CursorColumns.visibleColumnFromColumn2(this.context.config, this.context.viewModel, primaryPos)\n\t\t};\n\t}\n\n\tpublic getSelections(): Selection[] {\n\t\treturn this._cursors.getSelections();\n\t}\n\n\tpublic getViewSelections(): Selection[] {\n\t\treturn this._cursors.getViewSelections();\n\t}\n\n\tpublic getPosition(): Position {\n\t\treturn this._cursors.getPrimaryCursor().modelState.position;\n\t}\n\n\tpublic setSelections(source: string, selections: ISelection[]): void {\n\t\tthis.setStates(source, CursorChangeReason.NotSet, 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 _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\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(source: string, reason: CursorChangeReason, oldState: CursorModelState | null): boolean {\n\t\tconst newState = new CursorModelState(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\ttry {\n\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\teventsCollector.emit(new viewEvents.ViewCursorStateChangedEvent(viewSelections));\n\t\t} finally {\n\t\t\tthis._endEmit();\n\t\t}\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\tthis._onDidChange.fire(new CursorStateChangedEvent(selections, source || 'keyboard', reason));\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _revealRange(revealTarget: RevealTarget, verticalType: viewEvents.VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType): void {\n\t\tconst viewPositions = this._cursors.getViewPositions();\n\n\t\tlet viewPosition = viewPositions[0];\n\n\t\tif (revealTarget === RevealTarget.TopMost) {\n\t\t\tfor (let i = 1; i < viewPositions.length; i++) {\n\t\t\t\tif (viewPositions[i].isBefore(viewPosition)) {\n\t\t\t\t\tviewPosition = viewPositions[i];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (revealTarget === RevealTarget.BottomMost) {\n\t\t\tfor (let i = 1; i < viewPositions.length; i++) {\n\t\t\t\tif (viewPosition.isBeforeOrEqual(viewPositions[i])) {\n\t\t\t\t\tviewPosition = viewPositions[i];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (viewPositions.length > 1) {\n\t\t\t\t// no revealing!\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst viewRange = new Range(viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column);\n\t\tthis.emitCursorRevealRange(viewRange, verticalType, revealHorizontal, scrollType);\n\t}\n\n\tpublic emitCursorRevealRange(viewRange: Range, verticalType: viewEvents.VerticalRevealType, revealHorizontal: boolean, scrollType: editorCommon.ScrollType) {\n\t\ttry {\n\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\teventsCollector.emit(new viewEvents.ViewRevealRangeRequestEvent(viewRange, verticalType, revealHorizontal, scrollType));\n\t\t} finally {\n\t\t\tthis._endEmit();\n\t\t}\n\t}\n\n\t// -----------------------------------------------------------------------------------------------------------\n\t// ----- handlers beyond this point\n\n\tpublic trigger(source: string, handlerId: string, payload: any): void {\n\t\tconst H = editorCommon.Handler;\n\n\t\tif (handlerId === H.CompositionStart) {\n\t\t\tthis._isDoingComposition = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (handlerId === H.CompositionEnd) {\n\t\t\tthis._isDoingComposition = false;\n\t\t}\n\n\t\tif (this._configuration.editor.readOnly) {\n\t\t\t// All the remaining handlers will try to edit the model,\n\t\t\t// but we cannot edit when read only...\n\t\t\tthis._onDidAttemptReadOnlyEdit.fire(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldState = new CursorModelState(this._model, this);\n\t\tlet cursorChangeReason = CursorChangeReason.NotSet;\n\n\t\tif (handlerId !== H.Undo && handlerId !== H.Redo) {\n\t\t\t// TODO@Alex: if the undo/redo stack contains non-null selections\n\t\t\t// it would also be OK to stop tracking selections here\n\t\t\tthis._cursors.stopTrackingSelections();\n\t\t}\n\n\t\t// ensure valid state on all cursors\n\t\tthis._cursors.ensureValidState();\n\n\t\tthis._isHandling = true;\n\n\t\ttry {\n\t\t\tswitch (handlerId) {\n\t\t\t\tcase H.Type:\n\t\t\t\t\tthis._type(source, <string>payload.text);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.ReplacePreviousChar:\n\t\t\t\t\tthis._replacePreviousChar(<string>payload.text, <number>payload.replaceCharCnt);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.Paste:\n\t\t\t\t\tcursorChangeReason = CursorChangeReason.Paste;\n\t\t\t\t\tthis._paste(<string>payload.text, <boolean>payload.pasteOnNewLine, <string[]>payload.multicursorText);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.Cut:\n\t\t\t\t\tthis._cut();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.Undo:\n\t\t\t\t\tcursorChangeReason = CursorChangeReason.Undo;\n\t\t\t\t\tthis._interpretCommandResult(this._model.undo());\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.Redo:\n\t\t\t\t\tcursorChangeReason = CursorChangeReason.Redo;\n\t\t\t\t\tthis._interpretCommandResult(this._model.redo());\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.ExecuteCommand:\n\t\t\t\t\tthis._externalExecuteCommand(<editorCommon.ICommand>payload);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.ExecuteCommands:\n\t\t\t\t\tthis._externalExecuteCommands(<editorCommon.ICommand[]>payload);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase H.CompositionEnd:\n\t\t\t\t\tthis._interpretCompositionEnd(source);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tonUnexpectedError(err);\n\t\t}\n\n\t\tthis._isHandling = false;\n\n\t\tif (handlerId !== H.Undo && handlerId !== H.Redo) {\n\t\t\tthis._cursors.startTrackingSelections();\n\t\t}\n\n\t\tif (this._emitStateChangedIfNecessary(source, cursorChangeReason, oldState)) {\n\t\t\tthis._revealRange(RevealTarget.Primary, viewEvents.VerticalRevealType.Simple, true, editorCommon.ScrollType.Smooth);\n\t\t}\n\t}\n\n\tprivate _interpretCompositionEnd(source: string) {\n\t\tif (!this._isDoingComposition && source === 'keyboard') {\n\t\t\t// composition finishes, let's check if we need to auto complete if necessary.\n\t\t\tthis._executeEditOperation(TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType, this.context.config, this.context.model, this.getSelections()));\n\t\t}\n\t}\n\n\tprivate _type(source: string, text: string): void {\n\t\tif (!this._isDoingComposition && source === 'keyboard') {\n\t\t\t// If this event is coming straight from the keyboard, look for electric characters and enter\n\n\t\t\tfor (let i = 0, len = text.length; i < len; i++) {\n\t\t\t\tlet charCode = text.charCodeAt(i);\n\t\t\t\tlet chr: string;\n\t\t\t\tif (strings.isHighSurrogate(charCode) && i + 1 < len) {\n\t\t\t\t\tchr = text.charAt(i) + text.charAt(i + 1);\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tchr = text.charAt(i);\n\t\t\t\t}\n\n\t\t\t\t// Here we must interpret each typed character individually, that's why we create a new context\n\t\t\t\tthis._executeEditOperation(TypeOperations.typeWithInterceptors(this._prevEditOperationType, this.context.config, this.context.model, this.getSelections(), chr));\n\t\t\t}\n\n\t\t} else {\n\t\t\tthis._executeEditOperation(TypeOperations.typeWithoutInterceptors(this._prevEditOperationType, this.context.config, this.context.model, this.getSelections(), text));\n\t\t}\n\t}\n\n\tprivate _replacePreviousChar(text: string, replaceCharCnt: number): void {\n\t\tthis._executeEditOperation(TypeOperations.replacePreviousChar(this._prevEditOperationType, this.context.config, this.context.model, this.getSelections(), text, replaceCharCnt));\n\t}\n\n\tprivate _paste(text: string, pasteOnNewLine: boolean, multicursorText: string[]): void {\n\t\tthis._executeEditOperation(TypeOperations.paste(this.context.config, this.context.model, this.getSelections(), text, pasteOnNewLine, multicursorText));\n\t}\n\n\tprivate _cut(): void {\n\t\tthis._executeEditOperation(DeleteOperations.cut(this.context.config, this.context.model, this.getSelections()));\n\t}\n\n\tprivate _externalExecuteCommand(command: editorCommon.ICommand): void {\n\t\tthis._cursors.killSecondaryCursors();\n\n\t\tthis._executeEditOperation(new EditOperationResult(EditOperationType.Other, [command], {\n\t\t\tshouldPushStackElementBefore: false,\n\t\t\tshouldPushStackElementAfter: false\n\t\t}));\n\t}\n\n\tprivate _externalExecuteCommands(commands: editorCommon.ICommand[]): void {\n\t\tthis._executeEditOperation(new EditOperationResult(EditOperationType.Other, commands, {\n\t\t\tshouldPushStackElementBefore: false,\n\t\t\tshouldPushStackElementAfter: false\n\t\t}));\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\tlet 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: IIdentifiedSingleEditOperation[]): Selection[] => {\n\t\t\tlet groupedInverseEditOperations: IIdentifiedSingleEditOperation[][] = [];\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: IIdentifiedSingleEditOperation, b: IIdentifiedSingleEditOperation) => {\n\t\t\t\treturn a.identifier!.minor - b.identifier!.minor;\n\t\t\t};\n\t\t\tlet 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\tlet 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\tlet operations: IIdentifiedSingleEditOperation[] = [];\n\t\tlet operationMinor = 0;\n\n\t\tconst addEditOperation = (selection: Range, text: string | null) => {\n\t\t\tif (selection.isEmpty() && 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: selection,\n\t\t\t\ttext: text,\n\t\t\t\tforceMoveMarkers: false,\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: Range, text: string | null) => {\n\t\t\thadTrackedEditOperation = true;\n\t\t\taddEditOperation(selection, text);\n\t\t};\n\n\t\tconst trackSelection = (selection: Selection, trackPreviousOnEmpty?: boolean) => {\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\tlet 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 (previousOp.range.getStartPosition().isBefore(currentOp.range.getEndPosition())) {\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 { IViewLineTokens, LineTokens } from 'vs/editor/common/core/lineTokens';\nimport { TokenizationResult2 } from 'vs/editor/common/core/token';\nimport { IState, LanguageId } from 'vs/editor/common/modes';\nimport { NULL_STATE, nullTokenize2 } from 'vs/editor/common/modes/nullMode';\n\nexport interface IReducedTokenizationSupport {\n\tgetInitialState(): IState;\n\ttokenize2(line: string, state: IState, offsetDelta: number): TokenizationResult2;\n}\n\nconst fallback: IReducedTokenizationSupport = {\n\tgetInitialState: () => NULL_STATE,\n\ttokenize2: (buffer: string, state: IState, deltaOffset: number) => nullTokenize2(LanguageId.Null, buffer, state, deltaOffset)\n};\n\nexport function tokenizeToString(text: string, tokenizationSupport: IReducedTokenizationSupport = fallback): string {\n\treturn _tokenizeToString(text, tokenizationSupport || fallback);\n}\n\nexport function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens, colorMap: string[], startOffset: number, endOffset: number, tabSize: number): string {\n\tlet result = `<div>`;\n\tlet charIndex = startOffset;\n\tlet tabsCharDelta = 0;\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\tpartContent += ' ';\n\t\t\t\t\t\tinsertSpacesCount--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CharCode.LessThan:\n\t\t\t\t\tpartContent += '<';\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\tbreak;\n\n\t\t\t\tcase CharCode.Ampersand:\n\t\t\t\t\tpartContent += '&';\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\tbreak;\n\n\t\t\t\tcase CharCode.UTF8_BOM:\n\t\t\t\tcase CharCode.LINE_SEPARATOR_2028:\n\t\t\t\t\tpartContent += '\\ufffd';\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\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tpartContent += String.fromCharCode(charCode);\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\nfunction _tokenizeToString(text: string, tokenizationSupport: IReducedTokenizationSupport): string {\n\tlet result = `<div class=\"monaco-tokenized-source\">`;\n\tlet lines = text.split(/\\r\\n|\\r|\\n/);\n\tlet currentState = tokenizationSupport.getInitialState();\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tlet line = lines[i];\n\n\t\tif (i > 0) {\n\t\t\tresult += `<br/>`;\n\t\t}\n\n\t\tlet tokenizationResult = tokenizationSupport.tokenize2(line, currentState, 0);\n\t\tLineTokens.convertToEndOffset(tokenizationResult.tokens, line.length);\n\t\tlet lineTokens = new LineTokens(tokenizationResult.tokens, line);\n\t\tlet 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 { 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\t_serviceBrand: any;\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 ITextResourceConfigurationService {\n\n\t_serviceBrand: any;\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 postion - 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\t_serviceBrand: any;\n\n\t/**\n\t * Returns the End of Line characters for the given resource\n\t */\n\tgetEOL(resource: URI | undefined, language?: string): string;\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { RGBA8 } from 'vs/editor/common/core/rgba';\nimport { ColorId, TokenizationRegistry } from 'vs/editor/common/modes';\n\nexport class MinimapTokensColorTracker {\n\tprivate static _INSTANCE: MinimapTokensColorTracker | null = null;\n\tpublic static getInstance(): MinimapTokensColorTracker {\n\t\tif (!this._INSTANCE) {\n\t\t\tthis._INSTANCE = new MinimapTokensColorTracker();\n\t\t}\n\t\treturn this._INSTANCE;\n\t}\n\n\tprivate _colors: RGBA8[];\n\tprivate _backgroundIsLight: boolean;\n\n\tprivate _onDidChange = new Emitter<void>();\n\tpublic readonly onDidChange: Event<void> = this._onDidChange.event;\n\n\tprivate constructor() {\n\t\tthis._updateColorMap();\n\t\tTokenizationRegistry.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\tlet 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\nexport const enum Constants {\n\tSTART_CH_CODE = 32, // Space\n\tEND_CH_CODE = 126, // Tilde (~)\n\tCHAR_COUNT = END_CH_CODE - START_CH_CODE + 1,\n\n\tSAMPLED_CHAR_HEIGHT = 16,\n\tSAMPLED_CHAR_WIDTH = 10,\n\tSAMPLED_HALF_CHAR_WIDTH = SAMPLED_CHAR_WIDTH / 2,\n\n\tx2_CHAR_HEIGHT = 4,\n\tx2_CHAR_WIDTH = 2,\n\n\tx1_CHAR_HEIGHT = 2,\n\tx1_CHAR_WIDTH = 1,\n\n\tRGBA_CHANNELS_CNT = 4,\n}\n\nexport class MinimapCharRenderer {\n\n\t_minimapCharRendererBrand: void;\n\n\tpublic readonly x2charData: Uint8ClampedArray;\n\tpublic readonly x1charData: Uint8ClampedArray;\n\n\tpublic readonly x2charDataLight: Uint8ClampedArray;\n\tpublic readonly x1charDataLight: Uint8ClampedArray;\n\n\tconstructor(x2CharData: Uint8ClampedArray, x1CharData: Uint8ClampedArray) {\n\t\tconst x2ExpectedLen = Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH * Constants.CHAR_COUNT;\n\t\tif (x2CharData.length !== x2ExpectedLen) {\n\t\t\tthrow new Error('Invalid x2CharData');\n\t\t}\n\t\tconst x1ExpectedLen = Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH * Constants.CHAR_COUNT;\n\t\tif (x1CharData.length !== x1ExpectedLen) {\n\t\t\tthrow new Error('Invalid x1CharData');\n\t\t}\n\t\tthis.x2charData = x2CharData;\n\t\tthis.x1charData = x1CharData;\n\n\t\tthis.x2charDataLight = MinimapCharRenderer.soften(x2CharData, 12 / 15);\n\t\tthis.x1charDataLight = MinimapCharRenderer.soften(x1CharData, 50 / 60);\n\t}\n\n\tprivate static soften(input: Uint8ClampedArray, ratio: number): Uint8ClampedArray {\n\t\tlet result = new Uint8ClampedArray(input.length);\n\t\tfor (let i = 0, len = input.length; i < len; i++) {\n\t\t\tresult[i] = input[i] * ratio;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static _getChIndex(chCode: number): number {\n\t\tchCode -= Constants.START_CH_CODE;\n\t\tif (chCode < 0) {\n\t\t\tchCode += Constants.CHAR_COUNT;\n\t\t}\n\t\treturn (chCode % Constants.CHAR_COUNT);\n\t}\n\n\tpublic x2RenderChar(target: ImageData, dx: number, dy: number, chCode: number, color: RGBA8, backgroundColor: RGBA8, useLighterFont: boolean): void {\n\t\tif (dx + Constants.x2_CHAR_WIDTH > target.width || dy + Constants.x2_CHAR_HEIGHT > target.height) {\n\t\t\tconsole.warn('bad render request outside image data');\n\t\t\treturn;\n\t\t}\n\t\tconst x2CharData = useLighterFont ? this.x2charDataLight : this.x2charData;\n\t\tconst chIndex = MinimapCharRenderer._getChIndex(chCode);\n\n\t\tconst outWidth = 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 dest = target.data;\n\t\tconst sourceOffset = chIndex * Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH;\n\t\tlet destOffset = dy * outWidth + dx * Constants.RGBA_CHANNELS_CNT;\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset] / 255;\n\t\t\tdest[destOffset + 0] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 1] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 2] = backgroundB + deltaB * c;\n\t\t}\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 1] / 255;\n\t\t\tdest[destOffset + 4] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 5] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 6] = backgroundB + deltaB * c;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 2] / 255;\n\t\t\tdest[destOffset + 0] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 1] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 2] = backgroundB + deltaB * c;\n\t\t}\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 3] / 255;\n\t\t\tdest[destOffset + 4] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 5] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 6] = backgroundB + deltaB * c;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 4] / 255;\n\t\t\tdest[destOffset + 0] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 1] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 2] = backgroundB + deltaB * c;\n\t\t}\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 5] / 255;\n\t\t\tdest[destOffset + 4] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 5] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 6] = backgroundB + deltaB * c;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 6] / 255;\n\t\t\tdest[destOffset + 0] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 1] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 2] = backgroundB + deltaB * c;\n\t\t}\n\t\t{\n\t\t\tconst c = x2CharData[sourceOffset + 7] / 255;\n\t\t\tdest[destOffset + 4] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 5] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 6] = backgroundB + deltaB * c;\n\t\t}\n\t}\n\n\tpublic x1RenderChar(target: ImageData, dx: number, dy: number, chCode: number, color: RGBA8, backgroundColor: RGBA8, useLighterFont: boolean): void {\n\t\tif (dx + Constants.x1_CHAR_WIDTH > target.width || dy + Constants.x1_CHAR_HEIGHT > target.height) {\n\t\t\tconsole.warn('bad render request outside image data');\n\t\t\treturn;\n\t\t}\n\t\tconst x1CharData = useLighterFont ? this.x1charDataLight : this.x1charData;\n\t\tconst chIndex = MinimapCharRenderer._getChIndex(chCode);\n\n\t\tconst outWidth = 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 dest = target.data;\n\t\tconst sourceOffset = chIndex * Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH;\n\t\tlet destOffset = dy * outWidth + dx * Constants.RGBA_CHANNELS_CNT;\n\t\t{\n\t\t\tconst c = x1CharData[sourceOffset] / 255;\n\t\t\tdest[destOffset + 0] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 1] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 2] = backgroundB + deltaB * c;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tconst c = x1CharData[sourceOffset + 1] / 255;\n\t\t\tdest[destOffset + 0] = backgroundR + deltaR * c;\n\t\t\tdest[destOffset + 1] = backgroundG + deltaG * c;\n\t\t\tdest[destOffset + 2] = backgroundB + deltaB * c;\n\t\t}\n\t}\n\n\tpublic x2BlockRenderChar(target: ImageData, dx: number, dy: number, color: RGBA8, backgroundColor: RGBA8, useLighterFont: boolean): void {\n\t\tif (dx + Constants.x2_CHAR_WIDTH > target.width || dy + Constants.x2_CHAR_HEIGHT > target.height) {\n\t\t\tconsole.warn('bad render request outside image data');\n\t\t\treturn;\n\t\t}\n\n\t\tconst outWidth = target.width * Constants.RGBA_CHANNELS_CNT;\n\n\t\tconst c = 0.5;\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 dest = target.data;\n\t\tlet destOffset = dy * outWidth + dx * Constants.RGBA_CHANNELS_CNT;\n\t\t{\n\t\t\tdest[destOffset + 0] = colorR;\n\t\t\tdest[destOffset + 1] = colorG;\n\t\t\tdest[destOffset + 2] = colorB;\n\t\t}\n\t\t{\n\t\t\tdest[destOffset + 4] = colorR;\n\t\t\tdest[destOffset + 5] = colorG;\n\t\t\tdest[destOffset + 6] = colorB;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tdest[destOffset + 0] = colorR;\n\t\t\tdest[destOffset + 1] = colorG;\n\t\t\tdest[destOffset + 2] = colorB;\n\t\t}\n\t\t{\n\t\t\tdest[destOffset + 4] = colorR;\n\t\t\tdest[destOffset + 5] = colorG;\n\t\t\tdest[destOffset + 6] = colorB;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tdest[destOffset + 0] = colorR;\n\t\t\tdest[destOffset + 1] = colorG;\n\t\t\tdest[destOffset + 2] = colorB;\n\t\t}\n\t\t{\n\t\t\tdest[destOffset + 4] = colorR;\n\t\t\tdest[destOffset + 5] = colorG;\n\t\t\tdest[destOffset + 6] = colorB;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tdest[destOffset + 0] = colorR;\n\t\t\tdest[destOffset + 1] = colorG;\n\t\t\tdest[destOffset + 2] = colorB;\n\t\t}\n\t\t{\n\t\t\tdest[destOffset + 4] = colorR;\n\t\t\tdest[destOffset + 5] = colorG;\n\t\t\tdest[destOffset + 6] = colorB;\n\t\t}\n\t}\n\n\tpublic x1BlockRenderChar(target: ImageData, dx: number, dy: number, color: RGBA8, backgroundColor: RGBA8, useLighterFont: boolean): void {\n\t\tif (dx + Constants.x1_CHAR_WIDTH > target.width || dy + Constants.x1_CHAR_HEIGHT > target.height) {\n\t\t\tconsole.warn('bad render request outside image data');\n\t\t\treturn;\n\t\t}\n\n\t\tconst outWidth = target.width * Constants.RGBA_CHANNELS_CNT;\n\n\t\tconst c = 0.5;\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 dest = target.data;\n\n\t\tlet destOffset = dy * outWidth + dx * Constants.RGBA_CHANNELS_CNT;\n\t\t{\n\t\t\tdest[destOffset + 0] = colorR;\n\t\t\tdest[destOffset + 1] = colorG;\n\t\t\tdest[destOffset + 2] = colorB;\n\t\t}\n\n\t\tdestOffset += outWidth;\n\t\t{\n\t\t\tdest[destOffset + 0] = colorR;\n\t\t\tdest[destOffset + 1] = colorG;\n\t\t\tdest[destOffset + 2] = colorB;\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/common/view/minimapCharRenderer';\n\nfunction toUint8ClampedArrat(arr: number[]): Uint8ClampedArray {\n\tlet r = new Uint8ClampedArray(arr.length);\n\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\tr[i] = arr[i];\n\t}\n\treturn r;\n}\n\nlet minimapCharRenderer: MinimapCharRenderer | null = null;\nexport function getOrCreateMinimapCharRenderer(): MinimapCharRenderer {\n\tif (!minimapCharRenderer) {\n\t\tlet _x1Data = toUint8ClampedArrat(x1Data!);\n\t\tx1Data = null;\n\n\t\tlet _x2Data = toUint8ClampedArrat(x2Data!);\n\t\tx2Data = null;\n\t\tminimapCharRenderer = new MinimapCharRenderer(_x2Data, _x1Data);\n\t}\n\treturn minimapCharRenderer;\n}\n\nlet x2Data: number[] | null = [\n\n\t//\n\t0, 0,\n\t0, 0,\n\t0, 0,\n\t0, 0,\n\n\t// !\n\t39, 14,\n\t39, 14,\n\t14, 5,\n\t29, 10,\n\n\t// \"\n\t96, 96,\n\t29, 29,\n\t0, 0,\n\t0, 0,\n\n\t// #\n\t49, 113,\n\t195, 214,\n\t227, 166,\n\t135, 42,\n\n\t// $\n\t40, 29,\n\t194, 38,\n\t75, 148,\n\t197, 187,\n\n\t// %\n\t145, 0,\n\t160, 61,\n\t75, 143,\n\t2, 183,\n\n\t// &\n\t138, 58,\n\t163, 6,\n\t177, 223,\n\t197, 227,\n\n\t// '\n\t38, 13,\n\t11, 4,\n\t0, 0,\n\t0, 0,\n\n\t// (\n\t10, 54,\n\t52, 8,\n\t62, 4,\n\t71, 122,\n\n\t// )\n\t73, 2,\n\t19, 40,\n\t10, 50,\n\t155, 36,\n\n\t// *\n\t79, 70,\n\t145, 121,\n\t7, 5,\n\t0, 0,\n\n\t// +\n\t2, 1,\n\t36, 12,\n\t204, 166,\n\t16, 5,\n\n\t// ,\n\t0, 0,\n\t0, 0,\n\t1, 0,\n\t154, 34,\n\n\t// -\n\t0, 0,\n\t0, 0,\n\t96, 83,\n\t0, 0,\n\n\t// .\n\t0, 0,\n\t0, 0,\n\t0, 0,\n\t46, 34,\n\n\t// /\n\t0, 82,\n\t2, 56,\n\t53, 3,\n\t146, 0,\n\n\t// 0\n\t146, 119,\n\t152, 132,\n\t152, 131,\n\t145, 119,\n\n\t// 1\n\t170, 42,\n\t15, 42,\n\t15, 42,\n\t172, 194,\n\n\t// 2\n\t131, 132,\n\t0, 139,\n\t80, 28,\n\t227, 143,\n\n\t// 3\n\t159, 135,\n\t15, 118,\n\t11, 126,\n\t171, 144,\n\n\t// 4\n\t20, 124,\n\t88, 106,\n\t217, 196,\n\t0, 106,\n\n\t// 5\n\t189, 92,\n\t168, 43,\n\t5, 130,\n\t164, 133,\n\n\t// 6\n\t130, 115,\n\t183, 65,\n\t134, 120,\n\t141, 141,\n\n\t// 7\n\t170, 196,\n\t2, 106,\n\t31, 32,\n\t105, 2,\n\n\t// 8\n\t145, 130,\n\t116, 114,\n\t132, 135,\n\t138, 140,\n\n\t// 9\n\t138, 113,\n\t147, 137,\n\t81, 183,\n\t129, 94,\n\n\t// :\n\t0, 0,\n\t21, 16,\n\t4, 3,\n\t46, 34,\n\n\t// ;\n\t0, 0,\n\t45, 34,\n\t1, 0,\n\t160, 49,\n\n\t// <\n\t0, 0,\n\t43, 143,\n\t203, 23,\n\t1, 76,\n\n\t// =\n\t0, 0,\n\t38, 28,\n\t131, 96,\n\t38, 28,\n\n\t// >\n\t0, 0,\n\t168, 31,\n\t29, 191,\n\t98, 0,\n\n\t// ?\n\t118, 139,\n\t5, 113,\n\t45, 13,\n\t37, 6,\n\n\t// @\n\t97, 115,\n\t161, 179,\n\t204, 105,\n\t223, 224,\n\n\t// A\n\t83, 52,\n\t111, 100,\n\t184, 186,\n\t120, 132,\n\n\t// B\n\t212, 145,\n\t180, 139,\n\t174, 161,\n\t212, 182,\n\n\t// C\n\t104, 162,\n\t131, 0,\n\t131, 0,\n\t104, 161,\n\n\t// D\n\t219, 120,\n\t110, 116,\n\t110, 116,\n\t219, 120,\n\n\t// E\n\t207, 154,\n\t163, 40,\n\t147, 22,\n\t207, 154,\n\n\t// F\n\t202, 159,\n\t161, 47,\n\t145, 23,\n\t111, 0,\n\n\t// G\n\t139, 154,\n\t144, 30,\n\t144, 135,\n\t139, 187,\n\n\t// H\n\t110, 110,\n\t168, 161,\n\t150, 145,\n\t110, 110,\n\n\t// I\n\t185, 162,\n\t43, 16,\n\t43, 16,\n\t185, 162,\n\n\t// J\n\t73, 129,\n\t0, 110,\n\t0, 110,\n\t191, 87,\n\n\t// K\n\t149, 149,\n\t236, 48,\n\t195, 91,\n\t146, 149,\n\n\t// L\n\t146, 0,\n\t146, 0,\n\t146, 0,\n\t187, 173,\n\n\t// M\n\t200, 201,\n\t222, 215,\n\t172, 147,\n\t95, 95,\n\n\t// N\n\t193, 97,\n\t224, 129,\n\t159, 206,\n\t97, 192,\n\n\t// O\n\t155, 139,\n\t153, 115,\n\t153, 115,\n\t156, 140,\n\n\t// P\n\t189, 158,\n\t123, 136,\n\t190, 64,\n\t111, 0,\n\n\t// Q\n\t155, 139,\n\t153, 115,\n\t153, 114,\n\t156, 241,\n\n\t// R\n\t197, 148,\n\t150, 152,\n\t170, 116,\n\t110, 157,\n\n\t// S\n\t156, 128,\n\t169, 14,\n\t13, 159,\n\t158, 149,\n\n\t// T\n\t212, 189,\n\t43, 16,\n\t43, 16,\n\t43, 16,\n\n\t// U\n\t148, 110,\n\t148, 110,\n\t147, 109,\n\t182, 151,\n\n\t// V\n\t133, 121,\n\t106, 118,\n\t114, 103,\n\t89, 66,\n\n\t// W\n\t94, 94,\n\t211, 188,\n\t205, 207,\n\t139, 168,\n\n\t// X\n\t151, 152,\n\t87, 76,\n\t101, 79,\n\t151, 152,\n\n\t// Y\n\t130, 156,\n\t125, 116,\n\t47, 29,\n\t43, 16,\n\n\t// Z\n\t169, 228,\n\t11, 103,\n\t120, 6,\n\t230, 176,\n\n\t// [\n\t55, 49,\n\t55, 6,\n\t55, 6,\n\t193, 102,\n\n\t// \\\n\t92, 0,\n\t71, 0,\n\t13, 30,\n\t0, 147,\n\n\t// ]\n\t63, 43,\n\t12, 43,\n\t12, 43,\n\t142, 152,\n\n\t// ^\n\t71, 53,\n\t61, 61,\n\t0, 0,\n\t0, 0,\n\n\t// _\n\t0, 0,\n\t0, 0,\n\t0, 0,\n\t158, 146,\n\n\t// `\n\t25, 2,\n\t0, 0,\n\t0, 0,\n\t0, 0,\n\n\t// a\n\t0, 0,\n\t107, 130,\n\t170, 194,\n\t176, 188,\n\n\t// b\n\t109, 0,\n\t203, 159,\n\t113, 111,\n\t202, 158,\n\n\t// c\n\t0, 0,\n\t135, 135,\n\t114, 0,\n\t136, 135,\n\n\t// d\n\t0, 109,\n\t187, 190,\n\t148, 126,\n\t177, 187,\n\n\t// e\n\t0, 0,\n\t149, 130,\n\t218, 105,\n\t169, 135,\n\n\t// f\n\t37, 113,\n\t146, 113,\n\t49, 13,\n\t49, 13,\n\n\t// g\n\t0, 0,\n\t178, 195,\n\t147, 114,\n\t255, 255,\n\n\t// h\n\t109, 0,\n\t193, 149,\n\t110, 109,\n\t109, 109,\n\n\t// i\n\t12, 15,\n\t125, 41,\n\t33, 41,\n\t144, 188,\n\n\t// j\n\t1, 6,\n\t75, 53,\n\t10, 53,\n\t210, 161,\n\n\t// k\n\t110, 0,\n\t152, 148,\n\t210, 60,\n\t110, 156,\n\n\t// l\n\t213, 5,\n\t63, 5,\n\t63, 5,\n\t45, 111,\n\n\t// m\n\t0, 0,\n\t232, 172,\n\t190, 168,\n\t190, 169,\n\n\t// n\n\t0, 0,\n\t190, 144,\n\t109, 109,\n\t109, 109,\n\n\t// o\n\t0, 0,\n\t168, 140,\n\t148, 111,\n\t168, 140,\n\n\t// p\n\t0, 0,\n\t200, 151,\n\t113, 110,\n\t255, 158,\n\n\t// q\n\t0, 0,\n\t184, 188,\n\t147, 139,\n\t186, 255,\n\n\t// r\n\t0, 0,\n\t122, 130,\n\t111, 0,\n\t109, 0,\n\n\t// s\n\t0, 0,\n\t132, 69,\n\t109, 93,\n\t110, 136,\n\n\t// t\n\t51, 5,\n\t205, 103,\n\t61, 6,\n\t47, 106,\n\n\t// u\n\t0, 0,\n\t110, 109,\n\t110, 122,\n\t155, 179,\n\n\t// v\n\t0, 0,\n\t132, 120,\n\t113, 114,\n\t84, 63,\n\n\t// w\n\t0, 0,\n\t124, 108,\n\t202, 189,\n\t160, 174,\n\n\t// x\n\t0, 0,\n\t144, 142,\n\t79, 57,\n\t159, 146,\n\n\t// y\n\t0, 0,\n\t138, 138,\n\t119, 117,\n\t255, 69,\n\n\t// z\n\t0, 0,\n\t97, 198,\n\t47, 38,\n\t208, 84,\n\n\t// {\n\t23, 112,\n\t41, 14,\n\t157, 7,\n\t121, 192,\n\n\t// |\n\t35, 11,\n\t35, 11,\n\t35, 11,\n\t160, 61,\n\n\t// }\n\t129, 9,\n\t40, 19,\n\t20, 139,\n\t236, 44,\n\n\t// ~\n\t0, 0,\n\t15, 3,\n\t97, 93,\n\t0, 0,\n\n];\n\nlet x1Data: number[] | null = [\n\n\t//\n\t0,\n\t0,\n\n\t// !\n\t23,\n\t12,\n\n\t// \"\n\t53,\n\t0,\n\n\t// #\n\t130,\n\t127,\n\n\t// $\n\t58,\n\t149,\n\n\t// %\n\t67,\n\t77,\n\n\t// &\n\t72,\n\t198,\n\n\t// '\n\t13,\n\t0,\n\n\t// (\n\t25,\n\t51,\n\n\t// )\n\t25,\n\t49,\n\n\t// *\n\t94,\n\t2,\n\n\t// +\n\t8,\n\t64,\n\n\t// ,\n\t0,\n\t24,\n\n\t// -\n\t0,\n\t21,\n\n\t// .\n\t0,\n\t9,\n\n\t// /\n\t19,\n\t27,\n\n\t// 0\n\t126,\n\t126,\n\n\t// 1\n\t51,\n\t80,\n\n\t// 2\n\t72,\n\t105,\n\n\t// 3\n\t87,\n\t98,\n\n\t// 4\n\t73,\n\t93,\n\n\t// 5\n\t106,\n\t85,\n\n\t// 6\n\t111,\n\t123,\n\n\t// 7\n\t87,\n\t30,\n\n\t// 8\n\t116,\n\t126,\n\n\t// 9\n\t123,\n\t110,\n\n\t// :\n\t4,\n\t16,\n\n\t// ;\n\t9,\n\t28,\n\n\t// <\n\t21,\n\t53,\n\n\t// =\n\t8,\n\t62,\n\n\t// >\n\t23,\n\t52,\n\n\t// ?\n\t73,\n\t21,\n\n\t// @\n\t132,\n\t183,\n\n\t// A\n\t78,\n\t142,\n\n\t// B\n\t168,\n\t175,\n\n\t// C\n\t70,\n\t70,\n\n\t// D\n\t128,\n\t128,\n\n\t// E\n\t123,\n\t110,\n\n\t// F\n\t125,\n\t43,\n\n\t// G\n\t100,\n\t139,\n\n\t// H\n\t125,\n\t119,\n\n\t// I\n\t78,\n\t78,\n\n\t// J\n\t54,\n\t77,\n\n\t// K\n\t139,\n\t139,\n\n\t// L\n\t33,\n\t87,\n\n\t// M\n\t201,\n\t117,\n\n\t// N\n\t162,\n\t149,\n\n\t// O\n\t130,\n\t130,\n\n\t// P\n\t138,\n\t60,\n\n\t// Q\n\t130,\n\t172,\n\n\t// R\n\t149,\n\t127,\n\n\t// S\n\t95,\n\t98,\n\n\t// T\n\t95,\n\t25,\n\n\t// U\n\t118,\n\t135,\n\n\t// V\n\t110,\n\t85,\n\n\t// W\n\t147,\n\t175,\n\n\t// X\n\t105,\n\t110,\n\n\t// Y\n\t121,\n\t30,\n\n\t// Z\n\t101,\n\t113,\n\n\t// [\n\t34,\n\t68,\n\n\t// \\\n\t20,\n\t26,\n\n\t// ]\n\t34,\n\t68,\n\n\t// ^\n\t56,\n\t0,\n\n\t// _\n\t0,\n\t44,\n\n\t// `\n\t3,\n\t0,\n\n\t// a\n\t27,\n\t175,\n\n\t// b\n\t80,\n\t133,\n\n\t// c\n\t31,\n\t66,\n\n\t// d\n\t85,\n\t147,\n\n\t// e\n\t32,\n\t150,\n\n\t// f\n\t90,\n\t25,\n\n\t// g\n\t45,\n\t230,\n\n\t// h\n\t77,\n\t101,\n\n\t// i\n\t36,\n\t83,\n\n\t// j\n\t22,\n\t84,\n\n\t// k\n\t71,\n\t118,\n\n\t// l\n\t44,\n\t44,\n\n\t// m\n\t52,\n\t172,\n\n\t// n\n\t38,\n\t101,\n\n\t// o\n\t35,\n\t130,\n\n\t// p\n\t40,\n\t197,\n\n\t// q\n\t43,\n\t197,\n\n\t// r\n\t29,\n\t26,\n\n\t// s\n\t23,\n\t103,\n\n\t// t\n\t67,\n\t44,\n\n\t// u\n\t25,\n\t129,\n\n\t// v\n\t29,\n\t85,\n\n\t// w\n\t27,\n\t177,\n\n\t// x\n\t33,\n\t97,\n\n\t// y\n\t32,\n\t145,\n\n\t// z\n\t33,\n\t77,\n\n\t// {\n\t38,\n\t96,\n\n\t// |\n\t20,\n\t55,\n\n\t// }\n\t36,\n\t95,\n\n\t// ~\n\t2,\n\t22,\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 { WrappingIndent } from 'vs/editor/common/config/editorOptions';\nimport { LineTokens } from 'vs/editor/common/core/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { EndOfLinePreference, IActiveIndentGuideInfo, IModelDecoration, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';\nimport { ModelDecorationOptions, ModelDecorationOverviewRulerOptions } from 'vs/editor/common/model/textModel';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { PrefixSumComputerWithCache } from 'vs/editor/common/viewModel/prefixSumComputer';\nimport { ICoordinatesConverter, IOverviewRulerDecorations, ViewLineData } from 'vs/editor/common/viewModel/viewModel';\nimport { ITheme } from 'vs/platform/theme/common/themeService';\n\nexport class OutputPosition {\n\t_outputPositionBrand: void;\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\nexport interface ILineMapping {\n\tgetOutputLineCount(): number;\n\tgetWrappedLinesIndent(): string;\n\tgetInputOffsetOfOutputPosition(outputLineIndex: number, outputOffset: number): number;\n\tgetOutputPositionOfInputOffset(inputOffset: number): OutputPosition;\n}\n\nexport interface ILineMapperFactory {\n\tcreateLineMapping(lineText: string, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): ILineMapping | 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 interface ISplitLine {\n\tisVisible(): boolean;\n\tsetVisible(isVisible: boolean): ISplitLine;\n\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, fromOuputLineIndex: number, toOutputLineIndex: number, globalStartIndex: number, needed: boolean[], result: Array<ViewLineData | null>): void;\n\n\tgetModelColumnOfViewPosition(outputLineIndex: number, outputColumn: number): number;\n\tgetViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number): Position;\n\tgetViewLineNumberOfModelPosition(deltaLineNumber: number, inputColumn: number): number;\n}\n\nexport interface IViewModelLinesCollection {\n\tcreateCoordinatesConverter(): ICoordinatesConverter;\n\n\tdispose(): void;\n\n\tsetWrappingSettings(wrappingIndent: WrappingIndent, wrappingColumn: number, columnsForFullWidthChar: number): boolean;\n\tsetTabSize(newTabSize: number): boolean;\n\tgetHiddenAreas(): Range[];\n\tsetHiddenAreas(_ranges: Range[]): boolean;\n\n\tonModelFlushed(): void;\n\tonModelLinesDeleted(versionId: number, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null;\n\tonModelLinesInserted(versionId: number, fromLineNumber: number, toLineNumber: number, text: string[]): viewEvents.ViewLinesInsertedEvent | null;\n\tonModelLineChanged(versionId: number, lineNumber: number, newText: string): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null];\n\tacceptVersionId(versionId: number): void;\n\n\tgetViewLineCount(): number;\n\twarmUpLookupCache(viewStartLineNumber: number, viewEndLineNumber: number): void;\n\tgetActiveIndentGuide(viewLineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo;\n\tgetViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[];\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\tgetAllOverviewRulerDecorations(ownerId: number, filterOutValidation: boolean, theme: ITheme): IOverviewRulerDecorations;\n\tgetDecorationsInRange(range: Range, ownerId: number, filterOutValidation: boolean): IModelDecoration[];\n}\n\nexport class CoordinatesConverter implements ICoordinatesConverter {\n\n\tprivate readonly _lines: SplitLinesCollection;\n\n\tconstructor(lines: SplitLinesCollection) {\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\tlet start = this._lines.convertViewPositionToModelPosition(viewRange.startLineNumber, viewRange.startColumn);\n\t\tlet end = this._lines.convertViewPositionToModelPosition(viewRange.endLineNumber, viewRange.endColumn);\n\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\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\tconst validViewStart = this._lines.validateViewPosition(viewRange.startLineNumber, viewRange.startColumn, expectedModelRange.getStartPosition());\n\t\tconst validViewEnd = this._lines.validateViewPosition(viewRange.endLineNumber, viewRange.endColumn, expectedModelRange.getEndPosition());\n\t\treturn new Range(validViewStart.lineNumber, validViewStart.column, validViewEnd.lineNumber, validViewEnd.column);\n\t}\n\n\t// Model -> View conversion and related methods\n\n\tpublic convertModelPositionToViewPosition(modelPosition: Position): Position {\n\t\treturn this._lines.convertModelPositionToViewPosition(modelPosition.lineNumber, modelPosition.column);\n\t}\n\n\tpublic convertModelRangeToViewRange(modelRange: Range): Range {\n\t\tlet start = this._lines.convertModelPositionToViewPosition(modelRange.startLineNumber, modelRange.startColumn);\n\t\tlet end = this._lines.convertModelPositionToViewPosition(modelRange.endLineNumber, modelRange.endColumn);\n\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t}\n\n\tpublic modelPositionIsVisible(modelPosition: Position): boolean {\n\t\treturn this._lines.modelPositionIsVisible(modelPosition.lineNumber, modelPosition.column);\n\t}\n\n}\n\nconst enum IndentGuideRepeatOption {\n\tBlockNone = 0,\n\tBlockSubsequent = 1,\n\tBlockAll = 2\n}\n\nexport class SplitLinesCollection implements IViewModelLinesCollection {\n\n\tprivate readonly model: ITextModel;\n\tprivate _validModelVersionId: number;\n\n\tprivate wrappingColumn: number;\n\tprivate columnsForFullWidthChar: number;\n\tprivate wrappingIndent: WrappingIndent;\n\tprivate tabSize: number;\n\tprivate lines: ISplitLine[];\n\n\tprivate prefixSumComputer: PrefixSumComputerWithCache;\n\n\tprivate readonly linePositionMapperFactory: ILineMapperFactory;\n\n\tprivate hiddenAreasIds: string[];\n\n\tconstructor(model: ITextModel, linePositionMapperFactory: ILineMapperFactory, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent) {\n\t\tthis.model = model;\n\t\tthis._validModelVersionId = -1;\n\t\tthis.tabSize = tabSize;\n\t\tthis.wrappingColumn = wrappingColumn;\n\t\tthis.columnsForFullWidthChar = columnsForFullWidthChar;\n\t\tthis.wrappingIndent = wrappingIndent;\n\t\tthis.linePositionMapperFactory = linePositionMapperFactory;\n\n\t\tthis._constructLines(true);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, []);\n\t}\n\n\tpublic createCoordinatesConverter(): ICoordinatesConverter {\n\t\treturn new CoordinatesConverter(this);\n\t}\n\n\tprivate _ensureValidState(): void {\n\t\tlet modelVersion = this.model.getVersionId();\n\t\tif (modelVersion !== this._validModelVersionId) {\n\t\t\t// This is pretty bad, it means we lost track of the model...\n\t\t\tthrow new Error(`ViewModel is out of sync with Model!`);\n\t\t}\n\t\tif (this.lines.length !== this.model.getLineCount()) {\n\t\t\t// This is pretty bad, it means we lost track of the model...\n\t\t\tthis._constructLines(false);\n\t\t}\n\t}\n\n\tprivate _constructLines(resetHiddenAreas: boolean): void {\n\t\tthis.lines = [];\n\n\t\tif (resetHiddenAreas) {\n\t\t\tthis.hiddenAreasIds = [];\n\t\t}\n\n\t\tlet linesContent = this.model.getLinesContent();\n\t\tlet lineCount = linesContent.length;\n\t\tlet values = new Uint32Array(lineCount);\n\n\t\tlet hiddenAreas = this.hiddenAreasIds.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\tlet 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\tlet isInHiddenArea = (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd);\n\t\t\tlet line = createSplitLine(this.linePositionMapperFactory, linesContent[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea);\n\t\t\tvalues[i] = line.getViewLineCount();\n\t\t\tthis.lines[i] = line;\n\t\t}\n\n\t\tthis._validModelVersionId = this.model.getVersionId();\n\n\t\tthis.prefixSumComputer = new PrefixSumComputerWithCache(values);\n\t}\n\n\tpublic getHiddenAreas(): Range[] {\n\t\treturn this.hiddenAreasIds.map((decId) => {\n\t\t\treturn this.model.getDecorationRange(decId)!;\n\t\t});\n\t}\n\n\tprivate _reduceRanges(_ranges: Range[]): Range[] {\n\t\tif (_ranges.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tlet ranges = _ranges.map(r => this.model.validateRange(r)).sort(Range.compareRangesUsingStarts);\n\n\t\tlet result: Range[] = [];\n\t\tlet currentRangeStart = ranges[0].startLineNumber;\n\t\tlet currentRangeEnd = ranges[0].endLineNumber;\n\n\t\tfor (let i = 1, len = ranges.length; i < len; i++) {\n\t\t\tlet range = ranges[i];\n\n\t\t\tif (range.startLineNumber > currentRangeEnd + 1) {\n\t\t\t\tresult.push(new Range(currentRangeStart, 1, currentRangeEnd, 1));\n\t\t\t\tcurrentRangeStart = range.startLineNumber;\n\t\t\t\tcurrentRangeEnd = range.endLineNumber;\n\t\t\t} else if (range.endLineNumber > currentRangeEnd) {\n\t\t\t\tcurrentRangeEnd = range.endLineNumber;\n\t\t\t}\n\t\t}\n\t\tresult.push(new Range(currentRangeStart, 1, currentRangeEnd, 1));\n\t\treturn result;\n\t}\n\n\tpublic setHiddenAreas(_ranges: Range[]): boolean {\n\n\t\tlet newRanges = this._reduceRanges(_ranges);\n\n\t\t// BEGIN TODO@Martin: Please stop calling this method on each model change!\n\t\tlet oldRanges = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)!).sort(Range.compareRangesUsingStarts);\n\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\t\t// END TODO@Martin: Please stop calling this method on each model change!\n\n\t\tlet newDecorations: IModelDeltaDecoration[] = [];\n\t\tfor (const newRange of newRanges) {\n\t\t\tnewDecorations.push({\n\t\t\t\trange: newRange,\n\t\t\t\toptions: ModelDecorationOptions.EMPTY\n\t\t\t});\n\t\t}\n\n\t\tthis.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, newDecorations);\n\n\t\tlet 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.lines.length + 2;\n\n\t\tlet hasVisibleLine = false;\n\t\tfor (let i = 0; i < this.lines.length; i++) {\n\t\t\tlet 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.lines.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.lines[i].isVisible()) {\n\t\t\t\t\tthis.lines[i] = this.lines[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.lines[i].isVisible()) {\n\t\t\t\t\tthis.lines[i] = this.lines[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\tlet newOutputLineCount = this.lines[i].getViewLineCount();\n\t\t\t\tthis.prefixSumComputer.changeValue(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.lines.length) {\n\t\t\t// invalid arguments\n\t\t\treturn false;\n\t\t}\n\t\treturn this.lines[modelLineNumber - 1].isVisible();\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(false);\n\n\t\treturn true;\n\t}\n\n\tpublic setWrappingSettings(wrappingIndent: WrappingIndent, wrappingColumn: number, columnsForFullWidthChar: number): boolean {\n\t\tif (this.wrappingIndent === wrappingIndent && this.wrappingColumn === wrappingColumn && this.columnsForFullWidthChar === columnsForFullWidthChar) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.wrappingIndent = wrappingIndent;\n\t\tthis.wrappingColumn = wrappingColumn;\n\t\tthis.columnsForFullWidthChar = columnsForFullWidthChar;\n\n\t\tthis._constructLines(false);\n\n\t\treturn true;\n\t}\n\n\tpublic onModelFlushed(): void {\n\t\tthis._constructLines(true);\n\t}\n\n\tpublic onModelLinesDeleted(versionId: number, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null {\n\t\tif (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\tlet outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1);\n\t\tlet outputToLineNumber = this.prefixSumComputer.getAccumulatedValue(toLineNumber - 1);\n\n\t\tthis.lines.splice(fromLineNumber - 1, toLineNumber - fromLineNumber + 1);\n\t\tthis.prefixSumComputer.removeValues(fromLineNumber - 1, toLineNumber - fromLineNumber + 1);\n\n\t\treturn new viewEvents.ViewLinesDeletedEvent(outputFromLineNumber, outputToLineNumber);\n\t}\n\n\tpublic onModelLinesInserted(versionId: number, fromLineNumber: number, _toLineNumber: number, text: string[]): viewEvents.ViewLinesInsertedEvent | null {\n\t\tif (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\tlet hiddenAreas = this.getHiddenAreas();\n\t\tlet isInHiddenArea = false;\n\t\tlet testPosition = new Position(fromLineNumber, 1);\n\t\tfor (const hiddenArea of hiddenAreas) {\n\t\t\tif (hiddenArea.containsPosition(testPosition)) {\n\t\t\t\tisInHiddenArea = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1);\n\n\t\tlet totalOutputLineCount = 0;\n\t\tlet insertLines: ISplitLine[] = [];\n\t\tlet insertPrefixSumValues = new Uint32Array(text.length);\n\n\t\tfor (let i = 0, len = text.length; i < len; i++) {\n\t\t\tlet line = createSplitLine(this.linePositionMapperFactory, text[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea);\n\t\t\tinsertLines.push(line);\n\n\t\t\tlet 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.lines = this.lines.slice(0, fromLineNumber - 1).concat(insertLines).concat(this.lines.slice(fromLineNumber - 1));\n\n\t\tthis.prefixSumComputer.insertValues(fromLineNumber - 1, insertPrefixSumValues);\n\n\t\treturn new viewEvents.ViewLinesInsertedEvent(outputFromLineNumber, outputFromLineNumber + totalOutputLineCount - 1);\n\t}\n\n\tpublic onModelLineChanged(versionId: number, lineNumber: number, newText: string): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] {\n\t\tif (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\tlet lineIndex = lineNumber - 1;\n\n\t\tlet oldOutputLineCount = this.lines[lineIndex].getViewLineCount();\n\t\tlet isVisible = this.lines[lineIndex].isVisible();\n\t\tlet line = createSplitLine(this.linePositionMapperFactory, newText, this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, isVisible);\n\t\tthis.lines[lineIndex] = line;\n\t\tlet newOutputLineCount = this.lines[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 = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 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 = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 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 = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1);\n\t\t\tchangeTo = changeFrom + newOutputLineCount - 1;\n\t\t}\n\n\t\tthis.prefixSumComputer.changeValue(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.lines.length === 1 && !this.lines[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\tthis._ensureValidState();\n\t\treturn this.prefixSumComputer.getTotalValue();\n\t}\n\n\tprivate _toValidViewLineNumber(viewLineNumber: number): number {\n\t\tif (viewLineNumber < 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tlet viewLineCount = this.getViewLineCount();\n\t\tif (viewLineNumber > viewLineCount) {\n\t\t\treturn viewLineCount;\n\t\t}\n\t\treturn viewLineNumber;\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 warmUpLookupCache(viewStartLineNumber: number, viewEndLineNumber: number): void {\n\t\tthis.prefixSumComputer.warmUpCache(viewStartLineNumber - 1, viewEndLineNumber - 1);\n\t}\n\n\tpublic getActiveIndentGuide(viewLineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo {\n\t\tthis._ensureValidState();\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.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\tpublic getViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[] {\n\t\tthis._ensureValidState();\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\tlet resultRepeatCount: number[] = [];\n\t\tlet 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.lines[modelLineIndex];\n\t\t\tif (line.isVisible()) {\n\t\t\t\tlet viewLineStartIndex = line.getViewLineNumberOfModelPosition(0, modelLineIndex === modelStartLineIndex ? modelStart.column : 1);\n\t\t\t\tlet viewLineEndIndex = line.getViewLineNumberOfModelPosition(0, this.model.getLineMaxColumn(modelLineIndex + 1));\n\t\t\t\tlet 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.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.getLinesIndentGuides(reqStart.lineNumber, modelEnd.lineNumber));\n\t\t\treqStart = null;\n\t\t}\n\n\t\tconst viewLineCount = viewEndLineNumber - viewStartLineNumber + 1;\n\t\tlet 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\tlet count = Math.min(viewLineCount - currIndex, resultRepeatCount[i]);\n\t\t\tlet 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\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\treturn this.lines[lineIndex].getViewLineContent(this.model, lineIndex + 1, remainder);\n\t}\n\n\tpublic getViewLineLength(viewLineNumber: number): number {\n\t\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\treturn this.lines[lineIndex].getViewLineLength(this.model, lineIndex + 1, remainder);\n\t}\n\n\tpublic getViewLineMinColumn(viewLineNumber: number): number {\n\t\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\treturn this.lines[lineIndex].getViewLineMinColumn(this.model, lineIndex + 1, remainder);\n\t}\n\n\tpublic getViewLineMaxColumn(viewLineNumber: number): number {\n\t\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\treturn this.lines[lineIndex].getViewLineMaxColumn(this.model, lineIndex + 1, remainder);\n\t}\n\n\tpublic getViewLineData(viewLineNumber: number): ViewLineData {\n\t\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\treturn this.lines[lineIndex].getViewLineData(this.model, lineIndex + 1, remainder);\n\t}\n\n\tpublic getViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): ViewLineData[] {\n\t\tthis._ensureValidState();\n\n\t\tviewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber);\n\t\tviewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber);\n\n\t\tlet start = this.prefixSumComputer.getIndexOf(viewStartLineNumber - 1);\n\t\tlet viewLineNumber = viewStartLineNumber;\n\t\tlet startModelLineIndex = start.index;\n\t\tlet startRemainder = start.remainder;\n\n\t\tlet result: ViewLineData[] = [];\n\t\tfor (let modelLineIndex = startModelLineIndex, len = this.model.getLineCount(); modelLineIndex < len; modelLineIndex++) {\n\t\t\tlet line = this.lines[modelLineIndex];\n\t\t\tif (!line.isVisible()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet 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\t\t\tlet toViewLineIndex = fromViewLineIndex + remainingViewLineCount;\n\n\t\t\tline.getViewLinesData(this.model, modelLineIndex + 1, fromViewLineIndex, toViewLineIndex, 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\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\tlet line = this.lines[lineIndex];\n\n\t\tlet minColumn = line.getViewLineMinColumn(this.model, lineIndex + 1, remainder);\n\t\tlet 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\tlet computedModelColumn = line.getModelColumnOfViewPosition(remainder, viewColumn);\n\t\tlet 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 convertViewPositionToModelPosition(viewLineNumber: number, viewColumn: number): Position {\n\t\tthis._ensureValidState();\n\t\tviewLineNumber = this._toValidViewLineNumber(viewLineNumber);\n\n\t\tlet r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);\n\t\tlet lineIndex = r.index;\n\t\tlet remainder = r.remainder;\n\n\t\tlet inputColumn = this.lines[lineIndex].getModelColumnOfViewPosition(remainder, viewColumn);\n\t\t// console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn);\n\t\treturn this.model.validatePosition(new Position(lineIndex + 1, inputColumn));\n\t}\n\n\tpublic convertModelPositionToViewPosition(_modelLineNumber: number, _modelColumn: number): Position {\n\t\tthis._ensureValidState();\n\n\t\tlet validPosition = this.model.validatePosition(new Position(_modelLineNumber, _modelColumn));\n\t\tlet inputLineNumber = validPosition.lineNumber;\n\t\tlet inputColumn = validPosition.column;\n\n\t\tlet lineIndex = inputLineNumber - 1, lineIndexChanged = false;\n\t\twhile (lineIndex > 0 && !this.lines[lineIndex].isVisible()) {\n\t\t\tlineIndex--;\n\t\t\tlineIndexChanged = true;\n\t\t}\n\t\tif (lineIndex === 0 && !this.lines[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\tlet deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1));\n\n\t\tlet r: Position;\n\t\tif (lineIndexChanged) {\n\t\t\tr = this.lines[lineIndex].getViewPositionOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1));\n\t\t} else {\n\t\t\tr = this.lines[inputLineNumber - 1].getViewPositionOfModelPosition(deltaLineNumber, inputColumn);\n\t\t}\n\n\t\t// console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + r.lineNumber + ',' + r);\n\t\treturn r;\n\t}\n\n\tprivate _getViewLineNumberForModelPosition(inputLineNumber: number, inputColumn: number): number {\n\t\tlet lineIndex = inputLineNumber - 1;\n\t\tif (this.lines[lineIndex].isVisible()) {\n\t\t\t// this model line is visible\n\t\t\tconst deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1));\n\t\t\treturn this.lines[lineIndex].getViewLineNumberOfModelPosition(deltaLineNumber, inputColumn);\n\t\t}\n\n\t\t// this model line is not visible\n\t\twhile (lineIndex > 0 && !this.lines[lineIndex].isVisible()) {\n\t\t\tlineIndex--;\n\t\t}\n\t\tif (lineIndex === 0 && !this.lines[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 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1));\n\t\treturn this.lines[lineIndex].getViewLineNumberOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1));\n\t}\n\n\tpublic getAllOverviewRulerDecorations(ownerId: number, filterOutValidation: boolean, theme: ITheme): IOverviewRulerDecorations {\n\t\tconst decorations = this.model.getOverviewRulerDecorations(ownerId, filterOutValidation);\n\t\tconst result = new OverviewRulerDecorations();\n\t\tfor (const decoration of decorations) {\n\t\t\tconst opts = <ModelDecorationOverviewRulerOptions>decoration.options.overviewRuler;\n\t\t\tconst lane = opts ? opts.position : 0;\n\t\t\tif (lane === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst color = opts.getColor(theme);\n\t\t\tconst viewStartLineNumber = this._getViewLineNumberForModelPosition(decoration.range.startLineNumber, decoration.range.startColumn);\n\t\t\tconst viewEndLineNumber = this._getViewLineNumberForModelPosition(decoration.range.endLineNumber, decoration.range.endColumn);\n\n\t\t\tresult.accept(color, viewStartLineNumber, viewEndLineNumber, lane);\n\t\t}\n\t\treturn result.result;\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.lines[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\nclass VisibleIdentitySplitLine implements ISplitLine {\n\n\tpublic static readonly INSTANCE = new VisibleIdentitySplitLine();\n\n\tprivate constructor() { }\n\n\tpublic isVisible(): boolean {\n\t\treturn true;\n\t}\n\n\tpublic setVisible(isVisible: boolean): ISplitLine {\n\t\tif (isVisible) {\n\t\t\treturn this;\n\t\t}\n\t\treturn InvisibleIdentitySplitLine.INSTANCE;\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\tlet lineTokens = model.getLineTokens(modelLineNumber);\n\t\tlet 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\tlineTokens.inflate()\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\nclass InvisibleIdentitySplitLine implements ISplitLine {\n\n\tpublic static readonly INSTANCE = new InvisibleIdentitySplitLine();\n\n\tprivate constructor() { }\n\n\tpublic isVisible(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic setVisible(isVisible: boolean): ISplitLine {\n\t\tif (!isVisible) {\n\t\t\treturn this;\n\t\t}\n\t\treturn VisibleIdentitySplitLine.INSTANCE;\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\nexport class SplitLine implements ISplitLine {\n\n\tprivate readonly positionMapper: ILineMapping;\n\tprivate readonly outputLineCount: number;\n\n\tprivate readonly wrappedIndent: string;\n\tprivate readonly wrappedIndentLength: number;\n\tprivate _isVisible: boolean;\n\n\tconstructor(positionMapper: ILineMapping, isVisible: boolean) {\n\t\tthis.positionMapper = positionMapper;\n\t\tthis.wrappedIndent = this.positionMapper.getWrappedLinesIndent();\n\t\tthis.wrappedIndentLength = this.wrappedIndent.length;\n\t\tthis.outputLineCount = this.positionMapper.getOutputLineCount();\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): ISplitLine {\n\t\tthis._isVisible = isVisible;\n\t\treturn this;\n\t}\n\n\tpublic getViewLineCount(): number {\n\t\tif (!this._isVisible) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this.outputLineCount;\n\t}\n\n\tprivate getInputStartOffsetOfOutputLineIndex(outputLineIndex: number): number {\n\t\treturn this.positionMapper.getInputOffsetOfOutputPosition(outputLineIndex, 0);\n\t}\n\n\tprivate getInputEndOffsetOfOutputLineIndex(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number {\n\t\tif (outputLineIndex + 1 === this.outputLineCount) {\n\t\t\treturn model.getLineMaxColumn(modelLineNumber) - 1;\n\t\t}\n\t\treturn this.positionMapper.getInputOffsetOfOutputPosition(outputLineIndex + 1, 0);\n\t}\n\n\tpublic getViewLineContent(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): string {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tlet startOffset = this.getInputStartOffsetOfOutputLineIndex(outputLineIndex);\n\t\tlet endOffset = this.getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex);\n\t\tlet r = model.getValueInRange({\n\t\t\tstartLineNumber: modelLineNumber,\n\t\t\tstartColumn: startOffset + 1,\n\t\t\tendLineNumber: modelLineNumber,\n\t\t\tendColumn: endOffset + 1\n\t\t});\n\n\t\tif (outputLineIndex > 0) {\n\t\t\tr = this.wrappedIndent + r;\n\t\t}\n\n\t\treturn r;\n\t}\n\n\tpublic getViewLineLength(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tlet startOffset = this.getInputStartOffsetOfOutputLineIndex(outputLineIndex);\n\t\tlet endOffset = this.getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex);\n\t\tlet r = endOffset - startOffset;\n\n\t\tif (outputLineIndex > 0) {\n\t\t\tr = this.wrappedIndent.length + r;\n\t\t}\n\n\t\treturn r;\n\t}\n\n\tpublic getViewLineMinColumn(_model: ITextModel, _modelLineNumber: number, outputLineIndex: number): number {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tif (outputLineIndex > 0) {\n\t\t\treturn this.wrappedIndentLength + 1;\n\t\t}\n\t\treturn 1;\n\t}\n\n\tpublic getViewLineMaxColumn(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\treturn this.getViewLineContent(model, modelLineNumber, outputLineIndex).length + 1;\n\t}\n\n\tpublic getViewLineData(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): ViewLineData {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\n\t\tlet startOffset = this.getInputStartOffsetOfOutputLineIndex(outputLineIndex);\n\t\tlet endOffset = this.getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex);\n\n\t\tlet lineContent = model.getValueInRange({\n\t\t\tstartLineNumber: modelLineNumber,\n\t\t\tstartColumn: startOffset + 1,\n\t\t\tendLineNumber: modelLineNumber,\n\t\t\tendColumn: endOffset + 1\n\t\t});\n\n\t\tif (outputLineIndex > 0) {\n\t\t\tlineContent = this.wrappedIndent + lineContent;\n\t\t}\n\n\t\tlet minColumn = (outputLineIndex > 0 ? this.wrappedIndentLength + 1 : 1);\n\t\tlet maxColumn = lineContent.length + 1;\n\n\t\tlet continuesWithWrappedLine = (outputLineIndex + 1 < this.getViewLineCount());\n\n\t\tlet deltaStartIndex = 0;\n\t\tif (outputLineIndex > 0) {\n\t\t\tdeltaStartIndex = this.wrappedIndentLength;\n\t\t}\n\t\tlet lineTokens = model.getLineTokens(modelLineNumber);\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\tlineTokens.sliceAndInflate(startOffset, endOffset, deltaStartIndex)\n\t\t);\n\t}\n\n\tpublic getViewLinesData(model: ITextModel, modelLineNumber: number, fromOuputLineIndex: number, toOutputLineIndex: number, globalStartIndex: number, needed: boolean[], result: Array<ViewLineData | null>): void {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\n\t\tfor (let outputLineIndex = fromOuputLineIndex; outputLineIndex < toOutputLineIndex; outputLineIndex++) {\n\t\t\tlet globalIndex = globalStartIndex + outputLineIndex - fromOuputLineIndex;\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(model, modelLineNumber, outputLineIndex);\n\t\t}\n\t}\n\n\tpublic getModelColumnOfViewPosition(outputLineIndex: number, outputColumn: number): number {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tlet adjustedColumn = outputColumn - 1;\n\t\tif (outputLineIndex > 0) {\n\t\t\tif (adjustedColumn < this.wrappedIndentLength) {\n\t\t\t\tadjustedColumn = 0;\n\t\t\t} else {\n\t\t\t\tadjustedColumn -= this.wrappedIndentLength;\n\t\t\t}\n\t\t}\n\t\treturn this.positionMapper.getInputOffsetOfOutputPosition(outputLineIndex, adjustedColumn) + 1;\n\t}\n\n\tpublic getViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number): Position {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tlet r = this.positionMapper.getOutputPositionOfInputOffset(inputColumn - 1);\n\t\tlet outputLineIndex = r.outputLineIndex;\n\t\tlet outputColumn = r.outputOffset + 1;\n\n\t\tif (outputLineIndex > 0) {\n\t\t\toutputColumn += this.wrappedIndentLength;\n\t\t}\n\n\t\t//\t\tconsole.log('in -> out ' + deltaLineNumber + ',' + inputColumn + ' ===> ' + (deltaLineNumber+outputLineIndex) + ',' + outputColumn);\n\t\treturn new Position(deltaLineNumber + outputLineIndex, outputColumn);\n\t}\n\n\tpublic getViewLineNumberOfModelPosition(deltaLineNumber: number, inputColumn: number): number {\n\t\tif (!this._isVisible) {\n\t\t\tthrow new Error('Not supported');\n\t\t}\n\t\tconst r = this.positionMapper.getOutputPositionOfInputOffset(inputColumn - 1);\n\t\treturn (deltaLineNumber + r.outputLineIndex);\n\t}\n}\n\nfunction createSplitLine(linePositionMapperFactory: ILineMapperFactory, text: string, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent, isVisible: boolean): ISplitLine {\n\tlet positionMapper = linePositionMapperFactory.createLineMapping(text, tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent);\n\tif (positionMapper === null) {\n\t\t// No mapping needed\n\t\tif (isVisible) {\n\t\t\treturn VisibleIdentitySplitLine.INSTANCE;\n\t\t}\n\t\treturn InvisibleIdentitySplitLine.INSTANCE;\n\t} else {\n\t\treturn new SplitLine(positionMapper, isVisible);\n\t}\n}\n\nexport class IdentityCoordinatesConverter implements ICoordinatesConverter {\n\n\tprivate readonly _lines: IdentityLinesCollection;\n\n\tconstructor(lines: IdentityLinesCollection) {\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}\n\nexport class IdentityLinesCollection implements IViewModelLinesCollection {\n\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(_wrappingIndent: WrappingIndent, _wrappingColumn: number, _columnsForFullWidthChar: number): boolean {\n\t\treturn false;\n\t}\n\n\tpublic onModelFlushed(): void {\n\t}\n\n\tpublic onModelLinesDeleted(_versionId: number, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null {\n\t\treturn new viewEvents.ViewLinesDeletedEvent(fromLineNumber, toLineNumber);\n\t}\n\n\tpublic onModelLinesInserted(_versionId: number, fromLineNumber: number, toLineNumber: number, _text: string[]): viewEvents.ViewLinesInsertedEvent | null {\n\t\treturn new viewEvents.ViewLinesInsertedEvent(fromLineNumber, toLineNumber);\n\t}\n\n\tpublic onModelLineChanged(_versionId: number, lineNumber: number, _newText: string): [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 warmUpLookupCache(_viewStartLineNumber: number, _viewEndLineNumber: number): void {\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 getViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[] {\n\t\tconst viewLineCount = viewEndLineNumber - viewStartLineNumber + 1;\n\t\tlet 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\tlet lineTokens = this.model.getLineTokens(viewLineNumber);\n\t\tlet 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\tlineTokens.inflate()\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\tlet result: Array<ViewLineData | null> = [];\n\t\tfor (let lineNumber = viewStartLineNumber; lineNumber <= viewEndLineNumber; lineNumber++) {\n\t\t\tlet idx = lineNumber - viewStartLineNumber;\n\t\t\tif (!needed[idx]) {\n\t\t\t\tresult[idx] = null;\n\t\t\t}\n\t\t\tresult[idx] = this.getViewLineData(lineNumber);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic getAllOverviewRulerDecorations(ownerId: number, filterOutValidation: boolean, theme: ITheme): IOverviewRulerDecorations {\n\t\tconst decorations = this.model.getOverviewRulerDecorations(ownerId, filterOutValidation);\n\t\tconst result = new OverviewRulerDecorations();\n\t\tfor (const decoration of decorations) {\n\t\t\tconst opts = <ModelDecorationOverviewRulerOptions>decoration.options.overviewRuler;\n\t\t\tconst lane = opts ? opts.position : 0;\n\t\t\tif (lane === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst color = opts.getColor(theme);\n\t\t\tconst viewStartLineNumber = decoration.range.startLineNumber;\n\t\t\tconst viewEndLineNumber = decoration.range.endLineNumber;\n\n\t\t\tresult.accept(color, viewStartLineNumber, viewEndLineNumber, lane);\n\t\t}\n\t\treturn result.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\nclass OverviewRulerDecorations {\n\n\treadonly result: IOverviewRulerDecorations = Object.create(null);\n\n\tconstructor() {\n\t}\n\n\tpublic accept(color: string, startLineNumber: number, endLineNumber: number, lane: number): void {\n\t\tlet prev = this.result[color];\n\n\t\tif (prev) {\n\t\t\tconst prevLane = prev[prev.length - 3];\n\t\t\tconst prevEndLineNumber = prev[prev.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\tprev[prev.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\tprev.push(lane, startLineNumber, endLineNumber);\n\t\t} else {\n\t\t\tthis.result[color] = [lane, startLineNumber, endLineNumber];\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 { WrappingIndent } from 'vs/editor/common/config/editorOptions';\nimport { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\nimport { toUint32Array } from 'vs/editor/common/core/uint';\nimport { PrefixSumComputer } from 'vs/editor/common/viewModel/prefixSumComputer';\nimport { ILineMapperFactory, ILineMapping, OutputPosition } from 'vs/editor/common/viewModel/splitLinesCollection';\n\nconst enum CharacterClass {\n\tNONE = 0,\n\tBREAK_BEFORE = 1,\n\tBREAK_AFTER = 2,\n\tBREAK_OBTRUSIVE = 3,\n\tBREAK_IDEOGRAPHIC = 4 // for Han and Kana.\n}\n\nclass WrappingCharacterClassifier extends CharacterClassifier<CharacterClass> {\n\n\tconstructor(BREAK_BEFORE: string, BREAK_AFTER: string, BREAK_OBTRUSIVE: 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\n\t\tfor (let i = 0; i < BREAK_OBTRUSIVE.length; i++) {\n\t\t\tthis.set(BREAK_OBTRUSIVE.charCodeAt(i), CharacterClass.BREAK_OBTRUSIVE);\n\t\t}\n\t}\n\n\tpublic get(charCode: number): CharacterClass {\n\t\t// Initialize CharacterClass.BREAK_IDEOGRAPHIC for these Unicode ranges:\n\t\t// 1. CJK Unified Ideographs (0x4E00 -- 0x9FFF)\n\t\t// 2. CJK Unified Ideographs Extension A (0x3400 -- 0x4DBF)\n\t\t// 3. Hiragana and Katakana (0x3040 -- 0x30FF)\n\t\tif (\n\t\t\t(charCode >= 0x3040 && charCode <= 0x30FF)\n\t\t\t|| (charCode >= 0x3400 && charCode <= 0x4DBF)\n\t\t\t|| (charCode >= 0x4E00 && charCode <= 0x9FFF)\n\t\t) {\n\t\t\treturn CharacterClass.BREAK_IDEOGRAPHIC;\n\t\t}\n\n\t\treturn super.get(charCode);\n\t}\n}\n\nexport class CharacterHardWrappingLineMapperFactory implements ILineMapperFactory {\n\n\tprivate readonly classifier: WrappingCharacterClassifier;\n\n\tconstructor(breakBeforeChars: string, breakAfterChars: string, breakObtrusiveChars: string) {\n\t\tthis.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars, breakObtrusiveChars);\n\t}\n\n\t// TODO@Alex -> duplicated in lineCommentCommand\n\tprivate static nextVisibleColumn(currentVisibleColumn: number, tabSize: number, isTab: boolean, columnSize: number): number {\n\t\tcurrentVisibleColumn = +currentVisibleColumn; //@perf\n\t\ttabSize = +tabSize; //@perf\n\t\tcolumnSize = +columnSize; //@perf\n\n\t\tif (isTab) {\n\t\t\treturn currentVisibleColumn + (tabSize - (currentVisibleColumn % tabSize));\n\t\t}\n\t\treturn currentVisibleColumn + columnSize;\n\t}\n\n\tpublic createLineMapping(lineText: string, tabSize: number, breakingColumn: number, columnsForFullWidthChar: number, hardWrappingIndent: WrappingIndent): ILineMapping | null {\n\t\tif (breakingColumn === -1) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttabSize = +tabSize; //@perf\n\t\tbreakingColumn = +breakingColumn; //@perf\n\t\tcolumnsForFullWidthChar = +columnsForFullWidthChar; //@perf\n\t\thardWrappingIndent = +hardWrappingIndent; //@perf\n\n\t\tlet wrappedTextIndentVisibleColumn = 0;\n\t\tlet wrappedTextIndent = '';\n\n\t\tlet firstNonWhitespaceIndex = -1;\n\t\tif (hardWrappingIndent !== WrappingIndent.None) {\n\t\t\tfirstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineText);\n\t\t\tif (firstNonWhitespaceIndex !== -1) {\n\t\t\t\t// Track existing indent\n\t\t\t\twrappedTextIndent = lineText.substring(0, firstNonWhitespaceIndex);\n\t\t\t\tfor (let i = 0; i < firstNonWhitespaceIndex; i++) {\n\t\t\t\t\twrappedTextIndentVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(wrappedTextIndentVisibleColumn, tabSize, lineText.charCodeAt(i) === CharCode.Tab, 1);\n\t\t\t\t}\n\n\t\t\t\t// Increase indent of continuation lines, if desired\n\t\t\t\tlet numberOfAdditionalTabs = 0;\n\t\t\t\tif (hardWrappingIndent === WrappingIndent.Indent) {\n\t\t\t\t\tnumberOfAdditionalTabs = 1;\n\t\t\t\t} else if (hardWrappingIndent === WrappingIndent.DeepIndent) {\n\t\t\t\t\tnumberOfAdditionalTabs = 2;\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < numberOfAdditionalTabs; i++) {\n\t\t\t\t\twrappedTextIndent += '\\t';\n\t\t\t\t\twrappedTextIndentVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(wrappedTextIndentVisibleColumn, tabSize, true, 1);\n\t\t\t\t}\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 (wrappedTextIndentVisibleColumn + columnsForFullWidthChar > breakingColumn) {\n\t\t\t\t\twrappedTextIndent = '';\n\t\t\t\t\twrappedTextIndentVisibleColumn = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet classifier = this.classifier;\n\t\tlet lastBreakingOffset = 0; // Last 0-based offset in the lineText at which a break happened\n\t\tlet breakingLengths: number[] = []; // The length of each broken-up line text\n\t\tlet breakingLengthsIndex: number = 0; // The count of breaks already done\n\t\tlet visibleColumn = 0; // Visible column since the beginning of the current line\n\t\tlet niceBreakOffset = -1; // Last index of a character that indicates a break should happen before it (more desirable)\n\t\tlet niceBreakVisibleColumn = 0; // visible column if a break were to be later introduced before `niceBreakOffset`\n\t\tlet obtrusiveBreakOffset = -1; // Last index of a character that indicates a break should happen before it (less desirable)\n\t\tlet obtrusiveBreakVisibleColumn = 0; // visible column if a break were to be later introduced before `obtrusiveBreakOffset`\n\t\tlet len = lineText.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\t// At this point, there is a certainty that the character before `i` fits on the current line,\n\t\t\t// but the character at `i` might not fit\n\n\t\t\tlet charCode = lineText.charCodeAt(i);\n\t\t\tlet charCodeIsTab = (charCode === CharCode.Tab);\n\t\t\tlet charCodeClass = classifier.get(charCode);\n\n\t\t\tif (charCodeClass === CharacterClass.BREAK_BEFORE) {\n\t\t\t\t// This is a character that indicates that a break should happen before it\n\t\t\t\t// Since we are certain the character before `i` fits, there's no extra checking needed,\n\t\t\t\t// just mark it as a nice breaking opportunity\n\t\t\t\tniceBreakOffset = i;\n\t\t\t\tniceBreakVisibleColumn = wrappedTextIndentVisibleColumn;\n\t\t\t}\n\n\t\t\t// CJK breaking : before break\n\t\t\tif (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && i > 0) {\n\t\t\t\tlet prevCode = lineText.charCodeAt(i - 1);\n\t\t\t\tlet prevClass = classifier.get(prevCode);\n\t\t\t\tif (prevClass !== CharacterClass.BREAK_BEFORE) { // Kinsoku Shori: Don't break after a leading character, like an open bracket\n\t\t\t\t\tniceBreakOffset = i;\n\t\t\t\t\tniceBreakVisibleColumn = wrappedTextIndentVisibleColumn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet charColumnSize = 1;\n\t\t\tif (strings.isFullWidthCharacter(charCode)) {\n\t\t\t\tcharColumnSize = columnsForFullWidthChar;\n\t\t\t}\n\n\t\t\t// Advance visibleColumn with character at `i`\n\t\t\tvisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(visibleColumn, tabSize, charCodeIsTab, charColumnSize);\n\n\t\t\tif (visibleColumn > breakingColumn && i !== 0) {\n\t\t\t\t// We need to break at least before character at `i`:\n\t\t\t\t// - break before niceBreakLastOffset if it exists (and re-establish a correct visibleColumn by using niceBreakVisibleColumn + charAt(i))\n\t\t\t\t// - otherwise, break before obtrusiveBreakLastOffset if it exists (and re-establish a correct visibleColumn by using obtrusiveBreakVisibleColumn + charAt(i))\n\t\t\t\t// - otherwise, break before i (and re-establish a correct visibleColumn by charAt(i))\n\n\t\t\t\tlet breakBeforeOffset: number;\n\t\t\t\tlet restoreVisibleColumnFrom: number;\n\n\t\t\t\tif (niceBreakOffset !== -1 && niceBreakVisibleColumn <= breakingColumn) {\n\n\t\t\t\t\t// We will break before `niceBreakLastOffset`\n\t\t\t\t\tbreakBeforeOffset = niceBreakOffset;\n\t\t\t\t\trestoreVisibleColumnFrom = niceBreakVisibleColumn;\n\n\t\t\t\t} else if (obtrusiveBreakOffset !== -1 && obtrusiveBreakVisibleColumn <= breakingColumn) {\n\n\t\t\t\t\t// We will break before `obtrusiveBreakLastOffset`\n\t\t\t\t\tbreakBeforeOffset = obtrusiveBreakOffset;\n\t\t\t\t\trestoreVisibleColumnFrom = obtrusiveBreakVisibleColumn;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// We will break before `i`\n\t\t\t\t\tbreakBeforeOffset = i;\n\t\t\t\t\trestoreVisibleColumnFrom = wrappedTextIndentVisibleColumn;\n\n\t\t\t\t}\n\n\t\t\t\t// Break before character at `breakBeforeOffset`\n\t\t\t\tbreakingLengths[breakingLengthsIndex++] = breakBeforeOffset - lastBreakingOffset;\n\t\t\t\tlastBreakingOffset = breakBeforeOffset;\n\n\t\t\t\t// Re-establish visibleColumn by taking character at `i` into account\n\t\t\t\tvisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(restoreVisibleColumnFrom, tabSize, charCodeIsTab, charColumnSize);\n\n\t\t\t\t// Reset markers\n\t\t\t\tniceBreakOffset = -1;\n\t\t\t\tniceBreakVisibleColumn = 0;\n\t\t\t\tobtrusiveBreakOffset = -1;\n\t\t\t\tobtrusiveBreakVisibleColumn = 0;\n\t\t\t}\n\n\t\t\t// At this point, there is a certainty that the character at `i` fits on the current line\n\n\t\t\tif (niceBreakOffset !== -1) {\n\t\t\t\t// Advance niceBreakVisibleColumn\n\t\t\t\tniceBreakVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(niceBreakVisibleColumn, tabSize, charCodeIsTab, charColumnSize);\n\t\t\t}\n\t\t\tif (obtrusiveBreakOffset !== -1) {\n\t\t\t\t// Advance obtrusiveBreakVisibleColumn\n\t\t\t\tobtrusiveBreakVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(obtrusiveBreakVisibleColumn, tabSize, charCodeIsTab, charColumnSize);\n\t\t\t}\n\n\t\t\tif (charCodeClass === CharacterClass.BREAK_AFTER && (hardWrappingIndent === WrappingIndent.None || i >= firstNonWhitespaceIndex)) {\n\t\t\t\t// This is a character that indicates that a break should happen after it\n\t\t\t\tniceBreakOffset = i + 1;\n\t\t\t\tniceBreakVisibleColumn = wrappedTextIndentVisibleColumn;\n\t\t\t}\n\n\t\t\t// CJK breaking : after break\n\t\t\tif (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && i < len - 1) {\n\t\t\t\tlet nextCode = lineText.charCodeAt(i + 1);\n\t\t\t\tlet nextClass = classifier.get(nextCode);\n\t\t\t\tif (nextClass !== CharacterClass.BREAK_AFTER) { // Kinsoku Shori: Don't break before a trailing character, like a period\n\t\t\t\t\tniceBreakOffset = i + 1;\n\t\t\t\t\tniceBreakVisibleColumn = wrappedTextIndentVisibleColumn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (charCodeClass === CharacterClass.BREAK_OBTRUSIVE) {\n\t\t\t\t// This is an obtrusive character that indicates that a break should happen after it\n\t\t\t\tobtrusiveBreakOffset = i + 1;\n\t\t\t\tobtrusiveBreakVisibleColumn = wrappedTextIndentVisibleColumn;\n\t\t\t}\n\t\t}\n\n\t\tif (breakingLengthsIndex === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Add last segment\n\t\tbreakingLengths[breakingLengthsIndex++] = len - lastBreakingOffset;\n\n\t\treturn new CharacterHardWrappingLineMapping(\n\t\t\tnew PrefixSumComputer(toUint32Array(breakingLengths)),\n\t\t\twrappedTextIndent\n\t\t);\n\t}\n}\n\nexport class CharacterHardWrappingLineMapping implements ILineMapping {\n\n\tprivate readonly _prefixSums: PrefixSumComputer;\n\tprivate readonly _wrappedLinesIndent: string;\n\n\tconstructor(prefixSums: PrefixSumComputer, wrappedLinesIndent: string) {\n\t\tthis._prefixSums = prefixSums;\n\t\tthis._wrappedLinesIndent = wrappedLinesIndent;\n\t}\n\n\tpublic getOutputLineCount(): number {\n\t\treturn this._prefixSums.getCount();\n\t}\n\n\tpublic getWrappedLinesIndent(): string {\n\t\treturn this._wrappedLinesIndent;\n\t}\n\n\tpublic getInputOffsetOfOutputPosition(outputLineIndex: number, outputOffset: number): number {\n\t\tif (outputLineIndex === 0) {\n\t\t\treturn outputOffset;\n\t\t} else {\n\t\t\treturn this._prefixSums.getAccumulatedValue(outputLineIndex - 1) + outputOffset;\n\t\t}\n\t}\n\n\tpublic getOutputPositionOfInputOffset(inputOffset: number): OutputPosition {\n\t\tlet r = this._prefixSums.getIndexOf(inputOffset);\n\t\treturn new OutputPosition(r.index, r.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 { Color } from 'vs/base/common/color';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { IConfigurationChangedEvent } 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 * as editorCommon from 'vs/editor/common/editorCommon';\nimport { EndOfLinePreference, IActiveIndentGuideInfo, ITextModel, TrackedRangeStickiness, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { ModelDecorationOverviewRulerOptions } from 'vs/editor/common/model/textModel';\nimport * as textModelEvents from 'vs/editor/common/model/textModelEvents';\nimport { ColorId, LanguageId, TokenizationRegistry } from 'vs/editor/common/modes';\nimport { tokenizeLineToHTML } from 'vs/editor/common/modes/textToHtmlTokenizer';\nimport { MinimapTokensColorTracker } from 'vs/editor/common/view/minimapCharRenderer';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewLayout } from 'vs/editor/common/viewLayout/viewLayout';\nimport { CharacterHardWrappingLineMapperFactory } from 'vs/editor/common/viewModel/characterHardWrappingLineMapper';\nimport { IViewModelLinesCollection, IdentityLinesCollection, SplitLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection';\nimport { ICoordinatesConverter, IOverviewRulerDecorations, IViewModel, MinimapLinesRenderingData, ViewLineData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel';\nimport { ViewModelDecorations } from 'vs/editor/common/viewModel/viewModelDecorations';\nimport { ITheme } from 'vs/platform/theme/common/themeService';\nimport { RunOnceScheduler } from 'vs/base/common/async';\n\nconst USE_IDENTITY_LINES_COLLECTION = true;\n\nexport class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel {\n\n\tprivate readonly editorId: number;\n\tprivate readonly configuration: editorCommon.IConfiguration;\n\tprivate readonly model: ITextModel;\n\tprivate readonly _tokenizeViewportSoon: RunOnceScheduler;\n\tprivate hasFocus: boolean;\n\tprivate viewportStartLine: number;\n\tprivate viewportStartLineTrackedRange: string | null;\n\tprivate viewportStartLineDelta: number;\n\tprivate readonly lines: IViewModelLinesCollection;\n\tpublic readonly coordinatesConverter: ICoordinatesConverter;\n\tpublic readonly viewLayout: ViewLayout;\n\tprivate readonly decorations: ViewModelDecorations;\n\n\tconstructor(editorId: number, configuration: editorCommon.IConfiguration, model: ITextModel, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) {\n\t\tsuper();\n\n\t\tthis.editorId = editorId;\n\t\tthis.configuration = configuration;\n\t\tthis.model = model;\n\t\tthis._tokenizeViewportSoon = this._register(new RunOnceScheduler(() => this.tokenizeViewport(), 50));\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 IdentityLinesCollection(this.model);\n\n\t\t} else {\n\t\t\tconst conf = this.configuration.editor;\n\n\t\t\tlet hardWrappingLineMapperFactory = new CharacterHardWrappingLineMapperFactory(\n\t\t\t\tconf.wrappingInfo.wordWrapBreakBeforeCharacters,\n\t\t\t\tconf.wrappingInfo.wordWrapBreakAfterCharacters,\n\t\t\t\tconf.wrappingInfo.wordWrapBreakObtrusiveCharacters\n\t\t\t);\n\n\t\t\tthis.lines = new SplitLinesCollection(\n\t\t\t\tthis.model,\n\t\t\t\thardWrappingLineMapperFactory,\n\t\t\t\tthis.model.getOptions().tabSize,\n\t\t\t\tconf.wrappingInfo.wrappingColumn,\n\t\t\t\tconf.fontInfo.typicalFullwidthCharacterWidth / conf.fontInfo.typicalHalfwidthCharacterWidth,\n\t\t\t\tconf.wrappingInfo.wrappingIndent\n\t\t\t);\n\t\t}\n\n\t\tthis.coordinatesConverter = this.lines.createCoordinatesConverter();\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\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\teventsCollector.emit(new viewEvents.ViewScrollChangedEvent(e));\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\n\t\t\t}\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.onDidChange((e) => {\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\tthis._onConfigurationChanged(eventsCollector, e);\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(MinimapTokensColorTracker.getInstance().onDidChange(() => {\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\teventsCollector.emit(new viewEvents.ViewTokensColorsChangedEvent());\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic 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}\n\n\tpublic tokenizeViewport(): void {\n\t\tconst linesViewportData = this.viewLayout.getLinesViewportData();\n\t\tconst startPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(linesViewportData.startLineNumber, 1));\n\t\tconst endPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(linesViewportData.endLineNumber, 1));\n\t\tthis.model.tokenizeViewport(startPosition.lineNumber, endPosition.lineNumber);\n\t}\n\n\tpublic setHasFocus(hasFocus: boolean): void {\n\t\tthis.hasFocus = hasFocus;\n\t}\n\n\tprivate _onConfigurationChanged(eventsCollector: viewEvents.ViewEventsCollector, e: IConfigurationChangedEvent): 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\tlet 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 conf = this.configuration.editor;\n\n\t\tif (this.lines.setWrappingSettings(conf.wrappingInfo.wrappingIndent, conf.wrappingInfo.wrappingColumn, conf.fontInfo.typicalFullwidthCharacterWidth / conf.fontInfo.typicalHalfwidthCharacterWidth)) {\n\t\t\teventsCollector.emit(new viewEvents.ViewFlushedEvent());\n\t\t\teventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\teventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());\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\t\t}\n\n\t\tif (e.readOnly) {\n\t\t\t// Must read again all decorations due to readOnly filtering\n\t\t\tthis.decorations.reset();\n\t\t\teventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());\n\t\t}\n\n\t\teventsCollector.emit(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.setScrollPositionNow({ scrollTop: viewPositionTop + this.viewportStartLineDelta });\n\t\t}\n\t}\n\n\tprivate _registerModelEvents(): void {\n\n\t\tthis._register(this.model.onDidChangeRawContentFast((e) => {\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\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.versionId;\n\n\t\t\t\tfor (let j = 0, lenJ = changes.length; j < lenJ; j++) {\n\t\t\t\t\tconst change = changes[j];\n\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.emit(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.emit(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 linesInsertedEvent = this.lines.onModelLinesInserted(versionId, change.fromLineNumber, change.toLineNumber, change.detail);\n\t\t\t\t\t\t\tif (linesInsertedEvent !== null) {\n\t\t\t\t\t\t\t\teventsCollector.emit(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 [lineMappingChanged, linesChangedEvent, linesInsertedEvent, linesDeletedEvent] = this.lines.onModelLineChanged(versionId, change.lineNumber, change.detail);\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.emit(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.emit(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.emit(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\t\t\t\tthis.lines.acceptVersionId(versionId);\n\t\t\t\tthis.viewLayout.onHeightMaybeChanged();\n\n\t\t\t\tif (!hadOtherModelChange && hadModelLineChangeThatChangedLineMapping) {\n\t\t\t\t\teventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\t\t\teventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());\n\t\t\t\t\tthis.decorations.onLineMappingChanged();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\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.setMaxLineNumber(this.model.getLineCount());\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.setScrollPositionNow({ scrollTop: viewPositionTop + this.viewportStartLineDelta });\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeTokens((e) => {\n\t\t\tlet 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\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\teventsCollector.emit(new viewEvents.ViewTokensChangedEvent(viewRanges));\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\n\t\t\t}\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\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\teventsCollector.emit(new viewEvents.ViewLanguageConfigurationEvent());\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\n\t\t\t}\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\tthis.decorations.onLineMappingChanged();\n\t\t\t\tthis.viewLayout.onFlushed(this.getLineCount());\n\t\t\t\ttry {\n\t\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\t\teventsCollector.emit(new viewEvents.ViewFlushedEvent());\n\t\t\t\t\teventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\t\t\teventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());\n\t\t\t\t} finally {\n\t\t\t\t\tthis._endEmit();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.model.onDidChangeDecorations((e) => {\n\t\t\tthis.decorations.onModelDecorationsChanged();\n\t\t\ttry {\n\t\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\t\teventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());\n\t\t\t} finally {\n\t\t\t\tthis._endEmit();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic setHiddenAreas(ranges: Range[]): void {\n\t\ttry {\n\t\t\tconst eventsCollector = this._beginEmit();\n\t\t\tlet lineMappingChanged = this.lines.setHiddenAreas(ranges);\n\t\t\tif (lineMappingChanged) {\n\t\t\t\teventsCollector.emit(new viewEvents.ViewFlushedEvent());\n\t\t\t\teventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent());\n\t\t\t\teventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent());\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._endEmit();\n\t\t}\n\t}\n\n\tpublic getVisibleRanges(): Range[] {\n\t\tconst visibleViewRange = this.getCompletelyVisibleViewRange();\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\tlet result: Range[] = [], resultLen = 0;\n\t\tlet startLineNumber = visibleRange.startLineNumber;\n\t\tlet startColumn = visibleRange.startColumn;\n\t\tlet endLineNumber = visibleRange.endLineNumber;\n\t\tlet 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(): editorCommon.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: editorCommon.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: editorCommon.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 getOptions(): TextModelResolvedOptions {\n\t\treturn this.model.getOptions();\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.lines.warmUpLookupCache(startLineNumber, endLineNumber);\n\n\t\tthis.viewportStartLine = startLineNumber;\n\t\tlet 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 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 getViewLineRenderingData(visibleRange: Range, lineNumber: number): ViewLineRenderingData {\n\t\tlet mightContainRTL = this.model.mightContainRTL();\n\t\tlet mightContainNonBasicASCII = this.model.mightContainNonBasicASCII();\n\t\tlet tabSize = this.getTabSize();\n\t\tlet lineData = this.lines.getViewLineData(lineNumber);\n\t\tlet allInlineDecorations = this.decorations.getDecorationsViewportData(visibleRange).inlineDecorations;\n\t\tlet inlineDecorations = allInlineDecorations[lineNumber - visibleRange.startLineNumber];\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);\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\tlet 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: ITheme): IOverviewRulerDecorations {\n\t\treturn this.lines.getAllOverviewRulerDecorations(this.editorId, this.configuration.editor.readOnly, theme);\n\t}\n\n\tpublic invalidateOverviewRulerColorCache(): void {\n\t\tconst decorations = this.model.getOverviewRulerDecorations();\n\t\tfor (const decoration of decorations) {\n\t\t\tconst opts = <ModelDecorationOverviewRulerOptions>decoration.options.overviewRuler;\n\t\t\tif (opts) {\n\t\t\t\topts.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 getModelLineMaxColumn(modelLineNumber: number): number {\n\t\treturn this.model.getLineMaxColumn(modelLineNumber);\n\t}\n\n\tpublic validateModelPosition(position: IPosition): Position {\n\t\treturn this.model.validatePosition(position);\n\t}\n\n\tpublic validateModelRange(range: IRange): Range {\n\t\treturn this.model.validateRange(range);\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 getEOL(): string {\n\t\treturn this.model.getEOL();\n\t}\n\n\tpublic getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[] {\n\t\tconst newLineCharacter = forceCRLF ? '\\r\\n' : this.model.getEOL();\n\n\t\tranges = ranges.slice(0);\n\t\tranges.sort(Range.compareRangesUsingStarts);\n\t\tconst nonEmptyRanges = ranges.filter((r) => !r.isEmpty());\n\n\t\tif (nonEmptyRanges.length === 0) {\n\t\t\tif (!emptySelectionClipboard) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst modelLineNumbers = ranges.map((r) => {\n\t\t\t\tconst viewLineStart = new Position(r.startLineNumber, 1);\n\t\t\t\treturn this.coordinatesConverter.convertViewPositionToModelPosition(viewLineStart).lineNumber;\n\t\t\t});\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\tlet result: string[] = [];\n\t\tfor (const nonEmptyRange of nonEmptyRanges) {\n\t\t\tresult.push(this.getValueInRange(nonEmptyRange, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined));\n\t\t}\n\t\treturn result.length === 1 ? result[0] : result;\n\t}\n\n\tpublic getHTMLToCopy(viewRanges: Range[], emptySelectionClipboard: boolean): string | null {\n\t\tif (this.model.getLanguageIdentifier().id === LanguageId.PlainText) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (viewRanges.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 = this.coordinatesConverter.convertViewRangeToModelRange(viewRanges[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\tlet 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.editor.fontInfo;\n\t\tconst colorMap = this._getColorMap();\n\n\t\treturn (\n\t\t\t`<div style=\"`\n\t\t\t+ `color: ${colorMap[ColorId.DefaultForeground]};`\n\t\t\t+ `background-color: ${colorMap[ColorId.DefaultBackground]};`\n\t\t\t+ `font-family: ${fontInfo.fontFamily};`\n\t\t\t+ `font-weight: ${fontInfo.fontWeight};`\n\t\t\t+ `font-size: ${fontInfo.fontSize}px;`\n\t\t\t+ `line-height: ${fontInfo.lineHeight}px;`\n\t\t\t+ `white-space: pre;`\n\t\t\t+ `\">`\n\t\t\t+ this._getHTMLToCopy(range, colorMap)\n\t\t\t+ '</div>'\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);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _getColorMap(): string[] {\n\t\tlet colorMap = TokenizationRegistry.getColorMap();\n\t\tlet 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { TrackedRangeStickiness, IModelDeltaDecoration, IModelDecorationsChangeAccessor } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IDecorationProvider } from 'vs/editor/contrib/folding/foldingModel';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\n\nexport class FoldingDecorationProvider implements IDecorationProvider {\n\n\tprivate static COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tafterContentClassName: 'inline-folded',\n\t\tlinesDecorationsClassName: 'folding collapsed'\n\t});\n\n\tprivate static EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tlinesDecorationsClassName: 'folding'\n\t});\n\n\tprivate static EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tlinesDecorationsClassName: 'folding alwaysShowFoldIcons'\n\t});\n\n\tpublic autoHideFoldingControls: boolean = true;\n\n\tconstructor(private readonly editor: ICodeEditor) {\n\t}\n\n\tgetDecorationOption(isCollapsed: boolean): ModelDecorationOptions {\n\t\tif (isCollapsed) {\n\t\t\treturn 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 { ITextModel } from 'vs/editor/common/model';\nimport { FoldingMarkers } from 'vs/editor/common/modes/languageConfiguration';\nimport { FoldingRegions, MAX_LINE_NUMBER } from 'vs/editor/contrib/folding/foldingRanges';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { RangeProvider } from './folding';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { CancellationToken } from 'vs/base/common/cancellation';\n\nconst MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT = 5000;\n\nexport const ID_INDENT_PROVIDER = 'indent';\n\nexport class IndentRangeProvider implements RangeProvider {\n\treadonly id = ID_INDENT_PROVIDER;\n\n\tconstructor(private readonly editorModel: ITextModel) {\n\t}\n\n\tdispose() {\n\t}\n\n\tcompute(cancelationToken: CancellationToken): Promise<FoldingRegions> {\n\t\tlet foldingRules = LanguageConfigurationRegistry.getFoldingRules(this.editorModel.getLanguageIdentifier().id);\n\t\tlet offSide = foldingRules && !!foldingRules.offSide;\n\t\tlet markers = foldingRules && foldingRules.markers;\n\t\treturn Promise.resolve(computeRanges(this.editorModel, offSide, markers));\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) {\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\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 = TextModel.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 { indent: number; line: number; marker: boolean; }\n\nexport function computeRanges(model: ITextModel, offSide: boolean, markers?: FoldingMarkers, foldingRangesLimit = MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT): FoldingRegions {\n\tconst tabSize = model.getOptions().tabSize;\n\tlet result = new RangesCollector(foldingRangesLimit);\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\tpreviousRegions.push({ indent: -1, line: model.getLineCount() + 1, marker: false }); // 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 = TextModel.computeIndentLevel(lineContent, tabSize);\n\t\tlet previous = previousRegions[previousRegions.length - 1];\n\t\tif (indent === -1) {\n\t\t\tif (offSide && !previous.marker) {\n\t\t\t\t// for offSide languages, empty lines are associated to the next block\n\t\t\t\tprevious.line = 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].marker) {\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.marker = false;\n\t\t\t\t\tprevious.indent = indent;\n\t\t\t\t\tprevious.line = 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, line, marker: true });\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.line - 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.line = line;\n\t\t} else { // previous.indent < indent\n\t\t\t// new region with a bigger indent\n\t\t\tpreviousRegions.push({ indent, line, marker: false });\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 * as strings from 'vs/base/common/strings';\nimport { ShiftCommand } from 'vs/editor/common/commands/shiftCommand';\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 { IndentAction } from 'vs/editor/common/modes/languageConfiguration';\nimport { IIndentConverter, LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { IndentConsts } from 'vs/editor/common/modes/supports/indentRules';\nimport * as indentUtils from 'vs/editor/contrib/indentation/indentUtils';\n\nexport class MoveLinesCommand implements ICommand {\n\n\tprivate readonly _selection: Selection;\n\tprivate readonly _isMovingDown: boolean;\n\tprivate readonly _autoIndent: boolean;\n\n\tprivate _selectionId: string;\n\tprivate _moveEndPositionDown?: boolean;\n\tprivate _moveEndLineSelectionShrink: boolean;\n\n\tconstructor(selection: Selection, isMovingDown: boolean, autoIndent: boolean) {\n\t\tthis._selection = selection;\n\t\tthis._isMovingDown = isMovingDown;\n\t\tthis._autoIndent = autoIndent;\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\treturn;\n\t\t}\n\t\tif (!this._isMovingDown && this._selection.startLineNumber === 1) {\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\tgetLanguageIdentifier: () => {\n\t\t\t\treturn model.getLanguageIdentifier();\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(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.matchEnterRule(model, indentConverter, tabSize, s.startLineNumber, s.startLineNumber, insertingText);\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(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(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 matchEnterRule(model: ITextModel, indentConverter: IIndentConverter, tabSize: number, line: number, oneLineAbove: number, oneLineAboveText?: 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 && oneLineAboveText !== undefined) {\n\t\t\t\tlineContent = oneLineAboveText;\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(model, new Range(validPrecedingLine, maxColumn, validPrecedingLine, maxColumn));\n\n\t\tif (enter) {\n\t\t\tlet enterPrefix = enter.indentation;\n\t\t\tlet enterAction = enter.enterAction;\n\n\t\t\tif (enterAction.indentAction === IndentAction.None) {\n\t\t\t\tenterPrefix = enter.indentation + enterAction.appendText;\n\t\t\t} else if (enterAction.indentAction === IndentAction.Indent) {\n\t\t\t\tenterPrefix = enter.indentation + enterAction.appendText;\n\t\t\t} else if (enterAction.indentAction === IndentAction.IndentOutdent) {\n\t\t\t\tenterPrefix = enter.indentation;\n\t\t\t} else if (enterAction.indentAction === IndentAction.Outdent) {\n\t\t\t\tenterPrefix = indentConverter.unshiftIndent(enter.indentation) + enterAction.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\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) {\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 'vs/css!./zoneWidget';\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 { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport * as objects from 'vs/base/common/objects';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser';\nimport { EditorLayoutInfo } 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\tpublic domNode: HTMLElement;\n\tpublic id: number;\n\tpublic afterLineNumber: number;\n\tpublic afterColumn: number;\n\tpublic heightInLines: 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\tpublic onDomNodeTop(top: number): void {\n\t\tthis._onDomNodeTop(top);\n\t}\n\n\tpublic onComputedHeight(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\tpublic getId(): string {\n\t\treturn this._id;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic getPosition(): 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;\n\tprivate _height: number;\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\t\tthis._decorations = this._editor.deltaDecorations(\n\t\t\tthis._decorations,\n\t\t\t[{ range: Range.fromPositions(where), options: { 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;\n\tprivate _overlayWidget: OverlayWidgetDelegate | null;\n\tprivate _resizeSash: Sash;\n\tprivate _positionMarkerId: string[] = [];\n\n\tprotected _viewZone: ViewZoneDelegate | null;\n\tprotected _disposables: IDisposable[] = [];\n\n\tpublic container: HTMLElement;\n\tpublic domNode: HTMLElement;\n\tpublic editor: ICodeEditor;\n\tpublic options: 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.push(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\tpublic dispose(): void {\n\n\t\tdispose(this._disposables);\n\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\t}\n\n\tpublic create(): void {\n\n\t\tdom.addClass(this.domNode, 'zone-widget');\n\t\tif (this.options.className) {\n\t\t\tdom.addClass(this.domNode, this.options.className);\n\t\t}\n\n\t\tthis.container = document.createElement('div');\n\t\tdom.addClass(this.container, '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.push(this._arrow);\n\t\t}\n\t\tthis._fillContainer(this.container);\n\t\tthis._initSash();\n\t\tthis._applyStyles();\n\t}\n\n\tpublic style(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.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.minimapWidth > 0 && info.minimapLeft === 0) {\n\t\t\treturn info.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\tlet containerHeight = height - this._decoratingElementsHeight();\n\t\tthis.container.style.height = `${containerHeight}px`;\n\t\tconst layoutInfo = this.editor.getLayoutInfo();\n\t\tthis._doLayout(containerHeight, this._getWidth(layoutInfo));\n\n\t\tthis._resizeSash.layout();\n\t}\n\n\tpublic get 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\tpublic show(rangeOrPos: IRange | IPosition, heightInLines: number): void {\n\t\tconst range = Range.isIRange(rangeOrPos)\n\t\t\t? rangeOrPos\n\t\t\t: new Range(rangeOrPos.lineNumber, rangeOrPos.column, rangeOrPos.lineNumber, rangeOrPos.column);\n\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\tpublic hide(): 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.getConfiguration().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: IRange, heightInLines: number): void {\n\t\tconst position = {\n\t\t\tlineNumber: where.startLineNumber,\n\t\t\tcolumn: where.startColumn\n\t\t};\n\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.getConfiguration().lineHeight;\n\n\t\t// adjust heightInLines to viewport\n\t\tconst maxHeightInLines = (this.editor.getLayoutInfo().height / lineHeight) * 0.8;\n\t\tif (heightInLines >= maxHeightInLines) {\n\t\t\theightInLines = maxHeightInLines;\n\t\t}\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.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.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\t\tthis.container.style.top = arrowHeight + 'px';\n\t\tthis.container.style.height = containerHeight + 'px';\n\t\tthis.container.style.overflow = 'hidden';\n\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\t// Reveal the line above or below the zone widget, to get the zone widget in the viewport\n\t\t\tconst revealLineNumber = Math.min(model.getLineCount(), Math.max(1, where.endLineNumber + 1));\n\t\t\tthis.revealLine(revealLineNumber);\n\t\t}\n\t}\n\n\tprotected revealLine(lineNumber: number) {\n\t\tthis.editor.revealLine(lineNumber, ScrollType.Smooth);\n\t}\n\n\tprotected setCssClass(className: string, classToReplace?: string): void {\n\t\tif (classToReplace) {\n\t\t\tthis.container.classList.remove(classToReplace);\n\t\t}\n\n\t\tdom.addClass(this.container, 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\tthis._resizeSash = new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL });\n\n\t\tif (!this.options.isResizeable) {\n\t\t\tthis._resizeSash.hide();\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.push(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.push(this._resizeSash.onDidEnd(() => {\n\t\t\tdata = undefined;\n\t\t}));\n\n\t\tthis._disposables.push(this._resizeSash.onDidChange((evt: ISashEvent) => {\n\t\t\tif (data) {\n\t\t\t\tlet lineDelta = (evt.currentY - data.startY) / this.editor.getConfiguration().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.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\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 { Token, TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token';\nimport * as modes from 'vs/editor/common/modes';\nimport { NULL_MODE_ID, NULL_STATE } from 'vs/editor/common/modes/nullMode';\nimport { TokenTheme } from 'vs/editor/common/modes/supports/tokenization';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\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 EmbeddedModeData {\n\tpublic readonly modeId: string;\n\tpublic readonly state: modes.IState;\n\n\tconstructor(modeId: string, state: modes.IState) {\n\t\tthis.modeId = modeId;\n\t\tthis.state = state;\n\t}\n\n\tpublic equals(other: EmbeddedModeData): boolean {\n\t\treturn (\n\t\t\tthis.modeId === other.modeId\n\t\t\t&& this.state.equals(other.state)\n\t\t);\n\t}\n\n\tpublic clone(): EmbeddedModeData {\n\t\tlet 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 EmbeddedModeData(this.modeId, 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, embeddedModeData: EmbeddedModeData | null): MonarchLineState {\n\t\treturn this._INSTANCE.create(stack, embeddedModeData);\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, embeddedModeData: EmbeddedModeData | null): MonarchLineState {\n\t\tif (embeddedModeData !== null) {\n\t\t\t// no caching when embedding\n\t\t\treturn new MonarchLineState(stack, embeddedModeData);\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, embeddedModeData);\n\t\t}\n\t\tlet 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 modes.IState {\n\n\tpublic readonly stack: MonarchStackElement;\n\tpublic readonly embeddedModeData: EmbeddedModeData | null;\n\n\tconstructor(\n\t\tstack: MonarchStackElement,\n\t\tembeddedModeData: EmbeddedModeData | null\n\t) {\n\t\tthis.stack = stack;\n\t\tthis.embeddedModeData = embeddedModeData;\n\t}\n\n\tpublic clone(): modes.IState {\n\t\tlet embeddedModeDataClone = this.embeddedModeData ? this.embeddedModeData.clone() : null;\n\t\t// save an object\n\t\tif (embeddedModeDataClone === this.embeddedModeData) {\n\t\t\treturn this;\n\t\t}\n\t\treturn MonarchLineStateFactory.create(this.stack, this.embeddedModeData);\n\t}\n\n\tpublic equals(other: modes.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.embeddedModeData === null && other.embeddedModeData === null) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this.embeddedModeData === null || other.embeddedModeData === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.embeddedModeData.equals(other.embeddedModeData);\n\t}\n}\n\nconst hasOwnProperty = Object.hasOwnProperty;\n\ninterface IMonarchTokensCollector {\n\tenterMode(startOffset: number, modeId: string): void;\n\temit(startOffset: number, type: string): void;\n\tnestedModeTokenize(embeddedModeLine: string, embeddedModeData: EmbeddedModeData, offsetDelta: number): modes.IState;\n}\n\nclass MonarchClassicTokensCollector implements IMonarchTokensCollector {\n\n\tprivate _tokens: Token[];\n\tprivate _language: string | null;\n\tprivate _lastTokenType: string | null;\n\tprivate _lastTokenLanguage: string | null;\n\n\tconstructor() {\n\t\tthis._tokens = [];\n\t\tthis._language = null;\n\t\tthis._lastTokenType = null;\n\t\tthis._lastTokenLanguage = null;\n\t}\n\n\tpublic enterMode(startOffset: number, modeId: string): void {\n\t\tthis._language = modeId;\n\t}\n\n\tpublic emit(startOffset: number, type: string): void {\n\t\tif (this._lastTokenType === type && this._lastTokenLanguage === this._language) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lastTokenType = type;\n\t\tthis._lastTokenLanguage = this._language;\n\t\tthis._tokens.push(new Token(startOffset, type, this._language!));\n\t}\n\n\tpublic nestedModeTokenize(embeddedModeLine: string, embeddedModeData: EmbeddedModeData, offsetDelta: number): modes.IState {\n\t\tconst nestedModeId = embeddedModeData.modeId;\n\t\tconst embeddedModeState = embeddedModeData.state;\n\n\t\tconst nestedModeTokenizationSupport = modes.TokenizationRegistry.get(nestedModeId);\n\t\tif (!nestedModeTokenizationSupport) {\n\t\t\tthis.enterMode(offsetDelta, nestedModeId);\n\t\t\tthis.emit(offsetDelta, '');\n\t\t\treturn embeddedModeState;\n\t\t}\n\n\t\tlet nestedResult = nestedModeTokenizationSupport.tokenize(embeddedModeLine, embeddedModeState, offsetDelta);\n\t\tthis._tokens = this._tokens.concat(nestedResult.tokens);\n\t\tthis._lastTokenType = null;\n\t\tthis._lastTokenLanguage = null;\n\t\tthis._language = null;\n\t\treturn nestedResult.endState;\n\t}\n\n\tpublic finalize(endState: MonarchLineState): TokenizationResult {\n\t\treturn new TokenizationResult(this._tokens, endState);\n\t}\n}\n\nclass MonarchModernTokensCollector implements IMonarchTokensCollector {\n\n\tprivate readonly _modeService: IModeService;\n\tprivate readonly _theme: TokenTheme;\n\tprivate _prependTokens: Uint32Array | null;\n\tprivate _tokens: number[];\n\tprivate _currentLanguageId: modes.LanguageId;\n\tprivate _lastTokenMetadata: number;\n\n\tconstructor(modeService: IModeService, theme: TokenTheme) {\n\t\tthis._modeService = modeService;\n\t\tthis._theme = theme;\n\t\tthis._prependTokens = null;\n\t\tthis._tokens = [];\n\t\tthis._currentLanguageId = modes.LanguageId.Null;\n\t\tthis._lastTokenMetadata = 0;\n\t}\n\n\tpublic enterMode(startOffset: number, modeId: string): void {\n\t\tthis._currentLanguageId = this._modeService.getLanguageIdentifier(modeId)!.id;\n\t}\n\n\tpublic emit(startOffset: number, type: string): void {\n\t\tlet 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\tlet aLen = (a !== null ? a.length : 0);\n\t\tlet bLen = b.length;\n\t\tlet 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\tlet 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 nestedModeTokenize(embeddedModeLine: string, embeddedModeData: EmbeddedModeData, offsetDelta: number): modes.IState {\n\t\tconst nestedModeId = embeddedModeData.modeId;\n\t\tconst embeddedModeState = embeddedModeData.state;\n\n\t\tconst nestedModeTokenizationSupport = modes.TokenizationRegistry.get(nestedModeId);\n\t\tif (!nestedModeTokenizationSupport) {\n\t\t\tthis.enterMode(offsetDelta, nestedModeId);\n\t\t\tthis.emit(offsetDelta, '');\n\t\t\treturn embeddedModeState;\n\t\t}\n\n\t\tlet nestedResult = nestedModeTokenizationSupport.tokenize2(embeddedModeLine, embeddedModeState, offsetDelta);\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): TokenizationResult2 {\n\t\treturn new TokenizationResult2(\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 modes.ITokenizationSupport {\n\n\tprivate readonly _modeService: IModeService;\n\tprivate readonly _standaloneThemeService: IStandaloneThemeService;\n\tprivate readonly _modeId: string;\n\tprivate readonly _lexer: monarchCommon.ILexer;\n\tprivate readonly _embeddedModes: { [modeId: string]: boolean; };\n\tpublic embeddedLoaded: Promise<void>;\n\tprivate readonly _tokenizationRegistryListener: IDisposable;\n\n\tconstructor(modeService: IModeService, standaloneThemeService: IStandaloneThemeService, modeId: string, lexer: monarchCommon.ILexer) {\n\t\tthis._modeService = modeService;\n\t\tthis._standaloneThemeService = standaloneThemeService;\n\t\tthis._modeId = modeId;\n\t\tthis._lexer = lexer;\n\t\tthis._embeddedModes = 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 = modes.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\tlet language = e.changedLanguages[i];\n\t\t\t\tif (this._embeddedModes[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\tmodes.TokenizationRegistry.fire([this._modeId]);\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\tlet promises: Thenable<any>[] = [];\n\t\tfor (let nestedModeId in this._embeddedModes) {\n\t\t\tconst tokenizationSupport = modes.TokenizationRegistry.get(nestedModeId);\n\t\t\tif (tokenizationSupport) {\n\t\t\t\t// The nested mode 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\tconst tokenizationSupportPromise = modes.TokenizationRegistry.getPromise(nestedModeId);\n\t\t\tif (tokenizationSupportPromise) {\n\t\t\t\t// The nested mode is in the process of being loaded\n\t\t\t\tpromises.push(tokenizationSupportPromise);\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(): modes.IState {\n\t\tlet rootState = MonarchStackElementFactory.create(null, this._lexer.start!);\n\t\treturn MonarchLineStateFactory.create(rootState, null);\n\t}\n\n\tpublic tokenize(line: string, lineState: modes.IState, offsetDelta: number): TokenizationResult {\n\t\tlet tokensCollector = new MonarchClassicTokensCollector();\n\t\tlet endLineState = this._tokenize(line, <MonarchLineState>lineState, offsetDelta, tokensCollector);\n\t\treturn tokensCollector.finalize(endLineState);\n\t}\n\n\tpublic tokenize2(line: string, lineState: modes.IState, offsetDelta: number): TokenizationResult2 {\n\t\tlet tokensCollector = new MonarchModernTokensCollector(this._modeService, this._standaloneThemeService.getTheme().tokenTheme);\n\t\tlet endLineState = this._tokenize(line, <MonarchLineState>lineState, offsetDelta, tokensCollector);\n\t\treturn tokensCollector.finalize(endLineState);\n\t}\n\n\tprivate _tokenize(line: string, lineState: MonarchLineState, offsetDelta: number, collector: IMonarchTokensCollector): MonarchLineState {\n\t\tif (lineState.embeddedModeData) {\n\t\t\treturn this._nestedTokenize(line, lineState, offsetDelta, collector);\n\t\t} else {\n\t\t\treturn this._myTokenize(line, lineState, offsetDelta, collector);\n\t\t}\n\t}\n\n\tprivate _findLeavingNestedModeOffset(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 (let idx in rules) {\n\t\t\tif (!hasOwnProperty.call(rules, idx)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet rule: monarchCommon.IRule = rules[idx];\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\tlet regexSource = rule.regex.source;\n\t\t\tif (regexSource.substr(0, 4) === '^(?:' && regexSource.substr(regexSource.length - 1, 1) === ')') {\n\t\t\t\tregex = new RegExp(regexSource.substr(4, regexSource.length - 5), regex.ignoreCase ? 'i' : '');\n\t\t\t}\n\n\t\t\tlet result = line.search(regex);\n\t\t\tif (result === -1) {\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, lineState: MonarchLineState, offsetDelta: number, tokensCollector: IMonarchTokensCollector): MonarchLineState {\n\n\t\tlet popOffset = this._findLeavingNestedModeOffset(line, lineState);\n\n\t\tif (popOffset === -1) {\n\t\t\t// tokenization will not leave nested mode\n\t\t\tlet nestedEndState = tokensCollector.nestedModeTokenize(line, lineState.embeddedModeData!, offsetDelta);\n\t\t\treturn MonarchLineStateFactory.create(lineState.stack, new EmbeddedModeData(lineState.embeddedModeData!.modeId, nestedEndState));\n\t\t}\n\n\t\tlet nestedModeLine = line.substring(0, popOffset);\n\t\tif (nestedModeLine.length > 0) {\n\t\t\t// tokenize with the nested mode\n\t\t\ttokensCollector.nestedModeTokenize(nestedModeLine, lineState.embeddedModeData!, offsetDelta);\n\t\t}\n\n\t\tlet restOfTheLine = line.substring(popOffset);\n\t\treturn this._myTokenize(restOfTheLine, 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(line: string, lineState: MonarchLineState, offsetDelta: number, tokensCollector: IMonarchTokensCollector): MonarchLineState {\n\t\ttokensCollector.enterMode(offsetDelta, this._modeId);\n\n\t\tconst lineLength = line.length;\n\n\t\tlet embeddedModeData = lineState.embeddedModeData;\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 enteringEmbeddedMode: 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 (let idx in rules) {\n\t\t\t\t\tif (hasOwnProperty.call(rules, idx)) {\n\t\t\t\t\t\tlet rule: monarchCommon.IRule = rules[idx];\n\t\t\t\t\t\tif (pos === 0 || !rule.matchOnlyAtLineStart) {\n\t\t\t\t\t\t\tmatches = restOfLine.match(rule.regex);\n\t\t\t\t\t\t\tif (matches) {\n\t\t\t\t\t\t\t\tmatched = matches[0];\n\t\t\t\t\t\t\t\taction = rule.action;\n\t\t\t\t\t\t\t\tbreak;\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\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 mode?\n\t\t\t\tif (action.nextEmbedded) {\n\t\t\t\t\tif (action.nextEmbedded === '@pop') {\n\t\t\t\t\t\tif (!embeddedModeData) {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'cannot pop embedded mode if not inside one');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tembeddedModeData = null;\n\t\t\t\t\t} else if (embeddedModeData) {\n\t\t\t\t\t\tthrow monarchCommon.createError(this._lexer, 'cannot enter embedded mode from within an embedded mode');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tenteringEmbeddedMode = 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\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\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\tlet rest = result.substr('@brackets'.length);\n\t\t\t\t\tlet 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\tlet 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\ttokensCollector.emit(pos0 + offsetDelta, tokenType);\n\t\t\t}\n\n\t\t\tif (enteringEmbeddedMode !== null) {\n\t\t\t\t// substitute language alias to known modes to support syntax highlighting\n\t\t\t\tlet enteringEmbeddedModeId = this._modeService.getModeIdForLanguageName(enteringEmbeddedMode);\n\t\t\t\tif (enteringEmbeddedModeId) {\n\t\t\t\t\tenteringEmbeddedMode = enteringEmbeddedModeId;\n\t\t\t\t}\n\n\t\t\t\tlet embeddedModeData = this._getNestedEmbeddedModeData(enteringEmbeddedMode);\n\n\t\t\t\tif (pos < lineLength) {\n\t\t\t\t\t// there is content from the embedded mode on this line\n\t\t\t\t\tlet restOfLine = line.substr(pos);\n\t\t\t\t\treturn this._nestedTokenize(restOfLine, MonarchLineStateFactory.create(stack, embeddedModeData), offsetDelta + pos, tokensCollector);\n\t\t\t\t} else {\n\t\t\t\t\treturn MonarchLineStateFactory.create(stack, embeddedModeData);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn MonarchLineStateFactory.create(stack, embeddedModeData);\n\t}\n\n\tprivate _getNestedEmbeddedModeData(mimetypeOrModeId: string): EmbeddedModeData {\n\t\tlet nestedModeId = this._locateMode(mimetypeOrModeId);\n\t\tif (nestedModeId) {\n\t\t\tlet tokenizationSupport = modes.TokenizationRegistry.get(nestedModeId);\n\t\t\tif (tokenizationSupport) {\n\t\t\t\treturn new EmbeddedModeData(nestedModeId, tokenizationSupport.getInitialState());\n\t\t\t}\n\t\t}\n\n\t\treturn new EmbeddedModeData(nestedModeId || NULL_MODE_ID, NULL_STATE);\n\t}\n\n\tprivate _locateMode(mimetypeOrModeId: string): string | null {\n\t\tif (!mimetypeOrModeId || !this._modeService.isRegisteredMode(mimetypeOrModeId)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet modeId = this._modeService.getModeId(mimetypeOrModeId);\n\n\t\tif (modeId) {\n\t\t\t// Fire mode loading event\n\t\t\tthis._modeService.triggerMode(modeId);\n\t\t\tthis._embeddedModes[modeId] = true;\n\t\t}\n\n\t\treturn modeId;\n\t}\n\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\tlet 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\nexport function createTokenizationSupport(modeService: IModeService, standaloneThemeService: IStandaloneThemeService, modeId: string, lexer: monarchCommon.ILexer): modes.ITokenizationSupport {\n\treturn new MonarchTokenizer(modeService, standaloneThemeService, modeId, 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\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport * as strings from 'vs/base/common/strings';\nimport { IViewLineTokens, LineTokens } from 'vs/editor/common/core/lineTokens';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ColorId, FontStyle, ITokenizationSupport, MetadataConsts, TokenizationRegistry } from 'vs/editor/common/modes';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { RenderLineInput, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { ViewLineRenderingData } from 'vs/editor/common/viewModel/viewModel';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\nimport { MonarchTokenizer } from 'vs/editor/standalone/common/monarch/monarchLexer';\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, modeService: IModeService, domNode: HTMLElement, options: IColorizerElementOptions): Promise<void> {\n\t\toptions = options || {};\n\t\tlet theme = options.theme || 'vs';\n\t\tlet 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\n\t\tthemeService.setTheme(theme);\n\n\t\tlet text = domNode.firstChild ? domNode.firstChild.nodeValue : '';\n\t\tdomNode.className += ' ' + theme;\n\t\tlet render = (str: string) => {\n\t\t\tdomNode.innerHTML = str;\n\t\t};\n\t\treturn this.colorize(modeService, text || '', mimeType, options).then(render, (err) => console.error(err));\n\t}\n\n\tpublic static colorize(modeService: IModeService, text: string, mimeType: string, options: IColorizerOptions | null | undefined): Promise<string> {\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\tlet lines = text.split(/\\r\\n|\\r|\\n/);\n\t\tlet language = modeService.getModeId(mimeType);\n\t\tif (!language) {\n\t\t\treturn Promise.resolve(_fakeColorize(lines, tabSize));\n\t\t}\n\n\t\t// Send out the event to create the mode\n\t\tmodeService.triggerMode(language);\n\n\t\tconst tokenizationSupport = TokenizationRegistry.get(language);\n\t\tif (tokenizationSupport) {\n\t\t\treturn _colorize(lines, tabSize, tokenizationSupport);\n\t\t}\n\n\t\tconst tokenizationSupportPromise = TokenizationRegistry.getPromise(language);\n\t\tif (tokenizationSupportPromise) {\n\t\t\t// A tokenizer will be registered soon\n\t\t\treturn new Promise<string>((resolve, reject) => {\n\t\t\t\ttokenizationSupportPromise.then(tokenizationSupport => {\n\t\t\t\t\t_colorize(lines, tabSize, tokenizationSupport).then(resolve, reject);\n\t\t\t\t}, reject);\n\t\t\t});\n\t\t}\n\n\t\treturn new Promise<string>((resolve, reject) => {\n\t\t\tlet listener: IDisposable | null = null;\n\t\t\tlet timeout: TimeoutTimer | null = null;\n\n\t\t\tconst execute = () => {\n\t\t\t\tif (listener) {\n\t\t\t\t\tlistener.dispose();\n\t\t\t\t\tlistener = null;\n\t\t\t\t}\n\t\t\t\tif (timeout) {\n\t\t\t\t\ttimeout.dispose();\n\t\t\t\t\ttimeout = null;\n\t\t\t\t}\n\t\t\t\tconst tokenizationSupport = TokenizationRegistry.get(language!);\n\t\t\t\tif (tokenizationSupport) {\n\t\t\t\t\t_colorize(lines, tabSize, tokenizationSupport).then(resolve, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tresolve(_fakeColorize(lines, tabSize));\n\t\t\t};\n\n\t\t\t// wait 500ms for mode to load, then give up\n\t\t\ttimeout = new TimeoutTimer();\n\t\t\ttimeout.cancelAndSet(execute, 500);\n\t\t\tlistener = TokenizationRegistry.onDidChange((e) => {\n\t\t\t\tif (e.changedLanguages.indexOf(language!) >= 0) {\n\t\t\t\t\texecute();\n\t\t\t\t}\n\t\t\t});\n\t\t});\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\tlet 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\t-1,\n\t\t\t'none',\n\t\t\tfalse,\n\t\t\tfalse\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\tlet content = model.getLineContent(lineNumber);\n\t\tmodel.forceTokenization(lineNumber);\n\t\tlet tokens = model.getLineTokens(lineNumber);\n\t\tlet 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): Promise<string> {\n\treturn new Promise<string>((c, e) => {\n\t\tconst execute = () => {\n\t\t\tconst result = _actualColorize(lines, tabSize, tokenizationSupport);\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): 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\tlet line = lines[i];\n\n\t\ttokens[0] = line.length;\n\t\tconst lineTokens = new LineTokens(tokens, line);\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\tlet 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\t-1,\n\t\t\t'none',\n\t\t\tfalse,\n\t\t\tfalse\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): string {\n\tlet html: string[] = [];\n\tlet state = tokenizationSupport.getInitialState();\n\n\tfor (let i = 0, length = lines.length; i < length; i++) {\n\t\tlet line = lines[i];\n\t\tlet tokenizeResult = tokenizationSupport.tokenize2(line, state, 0);\n\t\tLineTokens.convertToEndOffset(tokenizeResult.tokens, line.length);\n\t\tlet lineTokens = new LineTokens(tokenizeResult.tokens, line);\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\tlet 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\t-1,\n\t\t\t'none',\n\t\t\tfalse,\n\t\t\tfalse\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 { ITokenThemeRule, TokenTheme } from 'vs/editor/common/modes/supports/tokenization';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { ITheme, 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 ITheme {\n\ttokenTheme: TokenTheme;\n\tthemeName: string;\n}\n\nexport interface IStandaloneThemeService extends IThemeService {\n\t_serviceBrand: any;\n\n\tsetTheme(themeName: string): string;\n\n\tdefineTheme(themeName: string, themeData: IStandaloneThemeData): void;\n\n\tgetTheme(): IStandaloneTheme;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Event } from 'vs/base/common/event';\n\nexport const IAccessibilityService = createDecorator<IAccessibilityService>('accessibilityService');\n\nexport interface IAccessibilityService {\n\t_serviceBrand: any;\n\n\treadonly onDidChangeAccessibilitySupport: Event<void>;\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 * Copyright (c) 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';\n\nexport const IClipboardService = createDecorator<IClipboardService>('clipboardService');\n\nexport interface IClipboardService {\n\n\t_serviceBrand: any;\n\n\t/**\n\t * Reads the content of the clipboard in plain text\n\t */\n\treadText(type?: string): string;\n\n\t/**\n\t * Reads text from the system find pasteboard.\n\t */\n\treadFindText(): string;\n\n\t/**\n\t * Writes text to the system find pasteboard.\n\t */\n\twriteFindText(text: string): 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 { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { TypeConstraint, validateConstraints } from 'vs/base/common/types';\nimport { ServicesAccessor, createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { LinkedList } from 'vs/base/common/linkedList';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\n\nexport const ICommandService = createDecorator<ICommandService>('commandService');\n\nexport interface ICommandEvent {\n\tcommandId: string;\n}\n\nexport interface ICommandService {\n\t_serviceBrand: any;\n\texecuteCommand<T = any>(commandId: string, ...args: any[]): Promise<T | undefined>;\n}\n\nexport interface ICommandsMap {\n\t[id: string]: ICommand;\n}\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\tdescription: string;\n\targs: { name: string; description?: string; constraint?: TypeConstraint; schema?: IJSONSchema; }[];\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 && 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 list.iterator().next().value;\n\t}\n\n\tgetCommands(): ICommandsMap {\n\t\tconst result: ICommandsMap = Object.create(null);\n\t\tthis._commands.forEach((value, key) => {\n\t\t\tresult[key] = this.getCommand(key)!;\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 * as dom from 'vs/base/browser/dom';\nimport { parse } from 'vs/base/common/marshalling';\nimport { Schemas } from 'vs/base/common/network';\nimport * as resources from 'vs/base/common/resources';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';\nimport { IOpenerService, IOpener } from 'vs/platform/opener/common/opener';\nimport { equalsIgnoreCase } from 'vs/base/common/strings';\nimport { LinkedList } from 'vs/base/common/linkedList';\n\nexport class OpenerService implements IOpenerService {\n\n\t_serviceBrand: any;\n\n\tprivate readonly _opener = new LinkedList<IOpener>();\n\n\tconstructor(\n\t\t@ICodeEditorService private readonly _editorService: ICodeEditorService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t) {\n\t\t//\n\t}\n\n\tasync open(resource: URI, options?: { openToSide?: boolean }): Promise<boolean> {\n\t\t// no scheme ?!?\n\t\tif (!resource.scheme) {\n\t\t\treturn Promise.resolve(false);\n\t\t}\n\t\t// check with contributed openers\n\t\tfor (const opener of this._opener.toArray()) {\n\t\t\tconst handled = await opener.open(resource, options);\n\t\t\tif (handled) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// use default openers\n\t\treturn this._doOpen(resource, options);\n\t}\n\n\tprivate _doOpen(resource: URI, options?: { openToSide?: boolean }): Promise<boolean> {\n\n\t\tconst { scheme, path, query, fragment } = resource;\n\n\t\tif (equalsIgnoreCase(scheme, Schemas.http) || equalsIgnoreCase(scheme, Schemas.https) || equalsIgnoreCase(scheme, Schemas.mailto)) {\n\t\t\t// open http or default mail application\n\t\t\tdom.windowOpenNoOpener(encodeURI(resource.toString(true)));\n\t\t\treturn Promise.resolve(true);\n\n\t\t} else if (equalsIgnoreCase(scheme, Schemas.command)) {\n\t\t\t// run command or bail out if command isn't known\n\t\t\tif (!CommandsRegistry.getCommand(path)) {\n\t\t\t\treturn Promise.reject(`command '${path}' NOT known`);\n\t\t\t}\n\t\t\t// execute as command\n\t\t\tlet args: any = [];\n\t\t\ttry {\n\t\t\t\targs = parse(query);\n\t\t\t\tif (!Array.isArray(args)) {\n\t\t\t\t\targs = [args];\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t//\n\t\t\t}\n\t\t\treturn this._commandService.executeCommand(path, ...args).then(() => true);\n\n\t\t} else {\n\t\t\tlet selection: { startLineNumber: number; startColumn: number; } | undefined = undefined;\n\t\t\tconst match = /^L?(\\d+)(?:,(\\d+))?/.exec(fragment);\n\t\t\tif (match) {\n\t\t\t\t// support file:///some/file.js#73,84\n\t\t\t\t// support file:///some/file.js#L73\n\t\t\t\tselection = {\n\t\t\t\t\tstartLineNumber: parseInt(match[1]),\n\t\t\t\t\tstartColumn: match[2] ? parseInt(match[2]) : 1\n\t\t\t\t};\n\t\t\t\t// remove fragment\n\t\t\t\tresource = resource.with({ fragment: '' });\n\t\t\t}\n\n\t\t\tif (resource.scheme === Schemas.file) {\n\t\t\t\tresource = resources.normalizePath(resource); // workaround for non-normalized paths (https://github.com/Microsoft/vscode/issues/12954)\n\t\t\t}\n\n\t\t\treturn this._editorService.openCodeEditor(\n\t\t\t\t{ resource, options: { selection, } },\n\t\t\t\tthis._editorService.getFocusedCodeEditor(),\n\t\t\t\toptions && options.openToSide\n\t\t\t).then(() => 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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } 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 { ILink, LinkProvider, LinkProviderRegistry, ILinksList } from 'vs/editor/common/modes';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { isDisposable, Disposable } from 'vs/base/common/lifecycle';\nimport { coalesce } from 'vs/base/common/arrays';\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};\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\tresolve(token: CancellationToken): Promise<URI> {\n\t\tif (this._link.url) {\n\t\t\ttry {\n\t\t\t\tif (typeof this._link.url === 'string') {\n\t\t\t\t\treturn Promise.resolve(URI.parse(this._link.url));\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve(this._link.url);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn Promise.reject(new Error('invalid'));\n\t\t\t}\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 extends Disposable {\n\n\treadonly links: Link[];\n\n\tconstructor(tuples: [ILinksList, LinkProvider][]) {\n\t\tsuper();\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(provider)) {\n\t\t\t\tthis._register(provider);\n\t\t\t}\n\t\t}\n\t\tthis.links = links;\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(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 = LinkProviderRegistry.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(() => new LinksList(coalesce(lists)));\n}\n\n\nCommandsRegistry.registerCommand('_executeLinkProvider', async (accessor, ...args): Promise<ILink[]> => {\n\tconst [uri] = args;\n\tif (!(uri instanceof URI)) {\n\t\treturn [];\n\t}\n\tconst model = accessor.get(IModelService).getModel(uri);\n\tif (!model) {\n\t\treturn [];\n\t}\n\tconst list = await getLinks(model, CancellationToken.None);\n\tif (!list) {\n\t\treturn [];\n\t}\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 { isFalsyOrWhitespace } from 'vs/base/common/strings';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const enum ContextKeyExprType {\n\tDefined = 1,\n\tNot = 2,\n\tEquals = 3,\n\tNotEquals = 4,\n\tAnd = 5,\n\tRegex = 6\n}\n\nexport abstract class ContextKeyExpr {\n\n\tpublic static has(key: string): ContextKeyExpr {\n\t\treturn new ContextKeyDefinedExpr(key);\n\t}\n\n\tpublic static equals(key: string, value: any): ContextKeyExpr {\n\t\treturn new ContextKeyEqualsExpr(key, value);\n\t}\n\n\tpublic static regex(key: string, value: RegExp): ContextKeyExpr {\n\t\treturn new ContextKeyRegexExpr(key, value);\n\t}\n\n\tpublic static not(key: string): ContextKeyExpr {\n\t\treturn new ContextKeyNotExpr(key);\n\t}\n\n\tpublic static and(...expr: Array<ContextKeyExpr | undefined | null>): ContextKeyExpr {\n\t\treturn new ContextKeyAndExpr(expr);\n\t}\n\n\tpublic static deserialize(serialized: string | null | undefined, strict: boolean = false): ContextKeyExpr | undefined {\n\t\tif (!serialized) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet pieces = serialized.split('&&');\n\t\tlet result = new ContextKeyAndExpr(pieces.map(p => this._deserializeOne(p, strict)));\n\t\treturn result.normalize();\n\t}\n\n\tprivate static _deserializeOne(serializedOne: string, strict: boolean): ContextKeyExpr {\n\t\tserializedOne = serializedOne.trim();\n\n\t\tif (serializedOne.indexOf('!=') >= 0) {\n\t\t\tlet pieces = serializedOne.split('!=');\n\t\t\treturn new ContextKeyNotEqualsExpr(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 new ContextKeyEqualsExpr(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 new ContextKeyRegexExpr(pieces[0].trim(), this._deserializeRegexValue(pieces[1], strict));\n\t\t}\n\n\t\tif (/^\\!\\s*/.test(serializedOne)) {\n\t\t\treturn new ContextKeyNotExpr(serializedOne.substr(1).trim());\n\t\t}\n\n\t\treturn new ContextKeyDefinedExpr(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\tpublic abstract getType(): ContextKeyExprType;\n\tpublic abstract equals(other: ContextKeyExpr): boolean;\n\tpublic abstract evaluate(context: IContext): boolean;\n\tpublic abstract normalize(): ContextKeyExpr | undefined;\n\tpublic abstract keys(): string[];\n}\n\nfunction cmp(a: ContextKeyExpr, b: ContextKeyExpr): number {\n\tlet aType = a.getType();\n\tlet bType = b.getType();\n\tif (aType !== bType) {\n\t\treturn aType - bType;\n\t}\n\tswitch (aType) {\n\t\tcase ContextKeyExprType.Defined:\n\t\t\treturn (<ContextKeyDefinedExpr>a).cmp(<ContextKeyDefinedExpr>b);\n\t\tcase ContextKeyExprType.Not:\n\t\t\treturn (<ContextKeyNotExpr>a).cmp(<ContextKeyNotExpr>b);\n\t\tcase ContextKeyExprType.Equals:\n\t\t\treturn (<ContextKeyEqualsExpr>a).cmp(<ContextKeyEqualsExpr>b);\n\t\tcase ContextKeyExprType.NotEquals:\n\t\t\treturn (<ContextKeyNotEqualsExpr>a).cmp(<ContextKeyNotEqualsExpr>b);\n\t\tcase ContextKeyExprType.Regex:\n\t\t\treturn (<ContextKeyRegexExpr>a).cmp(<ContextKeyRegexExpr>b);\n\t\tdefault:\n\t\t\tthrow new Error('Unknown ContextKeyExpr!');\n\t}\n}\n\nexport class ContextKeyDefinedExpr implements ContextKeyExpr {\n\tconstructor(protected key: string) {\n\t}\n\n\tpublic getType(): ContextKeyExprType {\n\t\treturn ContextKeyExprType.Defined;\n\t}\n\n\tpublic cmp(other: ContextKeyDefinedExpr): number {\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\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpr): boolean {\n\t\tif (other instanceof ContextKeyDefinedExpr) {\n\t\t\treturn (this.key === other.key);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn (!!context.getValue(this.key));\n\t}\n\n\tpublic normalize(): ContextKeyExpr {\n\t\treturn this;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n}\n\nexport class ContextKeyEqualsExpr implements ContextKeyExpr {\n\tconstructor(private readonly key: string, private readonly value: any) {\n\t}\n\n\tpublic getType(): ContextKeyExprType {\n\t\treturn ContextKeyExprType.Equals;\n\t}\n\n\tpublic cmp(other: ContextKeyEqualsExpr): number {\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\tif (this.value < other.value) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (this.value > other.value) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpr): boolean {\n\t\tif (other instanceof ContextKeyEqualsExpr) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\t/* tslint:disable:triple-equals */\n\t\t// Intentional ==\n\t\treturn (context.getValue(this.key) == this.value);\n\t\t/* tslint:enable:triple-equals */\n\t}\n\n\tpublic normalize(): ContextKeyExpr {\n\t\tif (typeof this.value === 'boolean') {\n\t\t\tif (this.value) {\n\t\t\t\treturn new ContextKeyDefinedExpr(this.key);\n\t\t\t}\n\t\t\treturn new ContextKeyNotExpr(this.key);\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n}\n\nexport class ContextKeyNotEqualsExpr implements ContextKeyExpr {\n\tconstructor(private key: string, private value: any) {\n\t}\n\n\tpublic getType(): ContextKeyExprType {\n\t\treturn ContextKeyExprType.NotEquals;\n\t}\n\n\tpublic cmp(other: ContextKeyNotEqualsExpr): number {\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\tif (this.value < other.value) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (this.value > other.value) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpr): boolean {\n\t\tif (other instanceof ContextKeyNotEqualsExpr) {\n\t\t\treturn (this.key === other.key && this.value === other.value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\t/* tslint:disable:triple-equals */\n\t\t// Intentional !=\n\t\treturn (context.getValue(this.key) != this.value);\n\t\t/* tslint:enable:triple-equals */\n\t}\n\n\tpublic normalize(): ContextKeyExpr {\n\t\tif (typeof this.value === 'boolean') {\n\t\t\tif (this.value) {\n\t\t\t\treturn new ContextKeyNotExpr(this.key);\n\t\t\t}\n\t\t\treturn new ContextKeyDefinedExpr(this.key);\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n}\n\nexport class ContextKeyNotExpr implements ContextKeyExpr {\n\tconstructor(private key: string) {\n\t}\n\n\tpublic getType(): ContextKeyExprType {\n\t\treturn ContextKeyExprType.Not;\n\t}\n\n\tpublic cmp(other: ContextKeyNotExpr): number {\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\treturn 0;\n\t}\n\n\tpublic equals(other: ContextKeyExpr): boolean {\n\t\tif (other instanceof ContextKeyNotExpr) {\n\t\t\treturn (this.key === other.key);\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic evaluate(context: IContext): boolean {\n\t\treturn (!context.getValue(this.key));\n\t}\n\n\tpublic normalize(): ContextKeyExpr {\n\t\treturn this;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n}\n\nexport class ContextKeyRegexExpr implements ContextKeyExpr {\n\n\tconstructor(private key: string, private regexp: RegExp | null) {\n\t\t//\n\t}\n\n\tpublic getType(): ContextKeyExprType {\n\t\treturn ContextKeyExprType.Regex;\n\t}\n\n\tpublic cmp(other: ContextKeyRegexExpr): number {\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: ContextKeyExpr): boolean {\n\t\tif (other instanceof ContextKeyRegexExpr) {\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 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 normalize(): ContextKeyExpr {\n\t\treturn this;\n\t}\n\n\tpublic keys(): string[] {\n\t\treturn [this.key];\n\t}\n}\n\nexport class ContextKeyAndExpr implements ContextKeyExpr {\n\tpublic readonly expr: ContextKeyExpr[];\n\n\tconstructor(expr: Array<ContextKeyExpr | null | undefined>) {\n\t\tthis.expr = ContextKeyAndExpr._normalizeArr(expr);\n\t}\n\n\tpublic getType(): ContextKeyExprType {\n\t\treturn ContextKeyExprType.And;\n\t}\n\n\tpublic equals(other: ContextKeyExpr): boolean {\n\t\tif (other instanceof ContextKeyAndExpr) {\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 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: Array<ContextKeyExpr | null | undefined>): ContextKeyExpr[] {\n\t\tlet expr: ContextKeyExpr[] = [];\n\n\t\tif (arr) {\n\t\t\tfor (let i = 0, len = arr.length; i < len; i++) {\n\t\t\t\tlet e: ContextKeyExpr | null | undefined = arr[i];\n\t\t\t\tif (!e) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\te = e.normalize();\n\t\t\t\tif (!e) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (e instanceof ContextKeyAndExpr) {\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\texpr.sort(cmp);\n\t\t}\n\n\t\treturn expr;\n\t}\n\n\tpublic normalize(): ContextKeyExpr | undefined {\n\t\tif (this.expr.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.expr.length === 1) {\n\t\t\treturn this.expr[0];\n\t\t}\n\n\t\treturn this;\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\nexport class RawContextKey<T> extends ContextKeyDefinedExpr {\n\n\tprivate _defaultValue: T | undefined;\n\n\tconstructor(key: string, defaultValue: T | undefined) {\n\t\tsuper(key);\n\t\tthis._defaultValue = defaultValue;\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(): ContextKeyExpr {\n\t\treturn ContextKeyExpr.not(this.key);\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\t_serviceBrand: any;\n\tdispose(): void;\n\n\tonDidChangeContext: Event<IContextKeyChangeEvent>;\n\tbufferChangeEvents(callback: Function): void;\n\n\n\tcreateKey<T>(key: string, defaultValue: T | undefined): IContextKey<T>;\n\tcontextMatchesRules(rules: ContextKeyExpr | 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\n\nexport namespace EditorContextKeys {\n\t/**\n\t * A context key that is set when the editor's text has focus (cursor is blinking).\n\t */\n\texport const editorTextFocus = new RawContextKey<boolean>('editorTextFocus', false);\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);\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);\n\n\texport const readOnly = new RawContextKey<boolean>('editorReadonly', false);\n\texport const writable: ContextKeyExpr = readOnly.toNegated();\n\texport const hasNonEmptySelection = new RawContextKey<boolean>('editorHasSelection', false);\n\texport const hasOnlyEmptySelection: ContextKeyExpr = hasNonEmptySelection.toNegated();\n\texport const hasMultipleSelections = new RawContextKey<boolean>('editorHasMultipleSelections', false);\n\texport const hasSingleSelection: ContextKeyExpr = hasMultipleSelections.toNegated();\n\texport const tabMovesFocus = new RawContextKey<boolean>('editorTabMovesFocus', false);\n\texport const tabDoesNotMoveFocus: ContextKeyExpr = tabMovesFocus.toNegated();\n\texport const isInEmbeddedEditor = new RawContextKey<boolean>('isInEmbeddedEditor', false);\n\texport const canUndo = new RawContextKey<boolean>('canUndo', false);\n\texport const canRedo = new RawContextKey<boolean>('canRedo', false);\n\n\t// -- mode context keys\n\texport const languageId = new RawContextKey<string>('editorLangId', '');\n\texport const hasCompletionItemProvider = new RawContextKey<boolean>('editorHasCompletionItemProvider', false);\n\texport const hasCodeActionsProvider = new RawContextKey<boolean>('editorHasCodeActionsProvider', false);\n\texport const hasCodeLensProvider = new RawContextKey<boolean>('editorHasCodeLensProvider', false);\n\texport const hasDefinitionProvider = new RawContextKey<boolean>('editorHasDefinitionProvider', false);\n\texport const hasDeclarationProvider = new RawContextKey<boolean>('editorHasDeclarationProvider', false);\n\texport const hasImplementationProvider = new RawContextKey<boolean>('editorHasImplementationProvider', false);\n\texport const hasTypeDefinitionProvider = new RawContextKey<boolean>('editorHasTypeDefinitionProvider', false);\n\texport const hasHoverProvider = new RawContextKey<boolean>('editorHasHoverProvider', false);\n\texport const hasDocumentHighlightProvider = new RawContextKey<boolean>('editorHasDocumentHighlightProvider', false);\n\texport const hasDocumentSymbolProvider = new RawContextKey<boolean>('editorHasDocumentSymbolProvider', false);\n\texport const hasReferenceProvider = new RawContextKey<boolean>('editorHasReferenceProvider', false);\n\texport const hasRenameProvider = new RawContextKey<boolean>('editorHasRenameProvider', false);\n\texport const hasSignatureHelpProvider = new RawContextKey<boolean>('editorHasSignatureHelpProvider', false);\n\n\t// -- mode context keys: formatting\n\texport const hasDocumentFormattingProvider = new RawContextKey<boolean>('editorHasDocumentFormattingProvider', false);\n\texport const hasDocumentSelectionFormattingProvider = new RawContextKey<boolean>('editorHasDocumentSelectionFormattingProvider', false);\n\texport const hasMultipleDocumentFormattingProvider = new RawContextKey<boolean>('editorHasMultipleDocumentFormattingProvider', false);\n\texport const hasMultipleDocumentSelectionFormattingProvider = new RawContextKey<boolean>('editorHasMultipleDocumentSelectionFormattingProvider', false);\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 { dispose, 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 OtherSuggestions = new RawContextKey<boolean>('hasOtherSuggestions', false);\n\n\tprivate readonly _ckOtherSuggestions: IContextKey<boolean>;\n\n\tprivate _index: number;\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\tdispose(this._listener);\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 { RawContextKey, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\n\nexport class WordContextKey {\n\n\tstatic readonly AtEnd = new RawContextKey<boolean>('atEndOfWord', false);\n\n\tprivate readonly _ckAtEnd: IContextKey<boolean>;\n\tprivate readonly _confListener: IDisposable;\n\n\tprivate _enabled: boolean;\n\tprivate _selectionListener?: IDisposable;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t) {\n\t\tthis._ckAtEnd = WordContextKey.AtEnd.bindTo(contextKeyService);\n\t\tthis._confListener = this._editor.onDidChangeConfiguration(e => e.contribInfo && this._update());\n\t\tthis._update();\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._confListener, this._selectionListener);\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.getConfiguration().contribInfo.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 { Action } from 'vs/base/common/actions';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { Event, Emitter } from 'vs/base/common/event';\n\nexport interface ILocalizedString {\n\tvalue: string;\n}\n\nexport interface IBaseCommandAction {\n\tid: string;\n\ttitle: string | ILocalizedString;\n}\n\nexport interface ICommandAction extends IBaseCommandAction {\n\tprecondition?: ContextKeyExpr;\n\ttoggled?: ContextKeyExpr;\n}\n\nexport interface IMenuItem {\n\tcommand: ICommandAction;\n\talt?: ICommandAction;\n\twhen?: ContextKeyExpr;\n\tgroup?: 'navigation' | string;\n\torder?: number;\n}\n\nexport interface ISubmenuItem {\n\ttitle: string | ILocalizedString;\n\twhen?: ContextKeyExpr;\n\tgroup?: 'navigation' | string;\n}\n\nexport function isIMenuItem(item: IMenuItem | ISubmenuItem): item is IMenuItem {\n\treturn (item as IMenuItem).command !== undefined;\n}\n\nexport const enum MenuId {\n\tCommandPalette,\n\tDebugBreakpointsContext,\n\tDebugCallStackContext,\n\tDebugConsoleContext,\n\tDebugVariablesContext,\n\tDebugWatchContext,\n\tDebugToolBar,\n\tEditorContext,\n\tEditorTitle,\n\tEditorTitleContext,\n\tEmptyEditorGroupContext,\n\tExplorerContext,\n\tMenubarAppearanceMenu,\n\tMenubarDebugMenu,\n\tMenubarEditMenu,\n\tMenubarFileMenu,\n\tMenubarGoMenu,\n\tMenubarHelpMenu,\n\tMenubarLayoutMenu,\n\tMenubarNewBreakpointMenu,\n\tMenubarPreferencesMenu,\n\tMenubarRecentMenu,\n\tMenubarSelectionMenu,\n\tMenubarSwitchEditorMenu,\n\tMenubarSwitchGroupMenu,\n\tMenubarTerminalMenu,\n\tMenubarViewMenu,\n\tOpenEditorsContext,\n\tProblemsPanelContext,\n\tSCMChangeContext,\n\tSCMResourceContext,\n\tSCMResourceGroupContext,\n\tSCMSourceControl,\n\tSCMTitle,\n\tSearchContext,\n\tStatusBarWindowIndicatorMenu,\n\tTouchBarContext,\n\tViewItemContext,\n\tViewTitle,\n}\n\nexport interface IMenuActionOptions {\n\targ?: any;\n\tshouldForwardArgs?: boolean;\n}\n\nexport interface IMenu extends IDisposable {\n\tgetActions(options?: IMenuActionOptions): [string, Array<MenuItemAction | SubmenuItemAction>][];\n}\n\nexport const IMenuService = createDecorator<IMenuService>('menuService');\n\nexport interface IMenuService {\n\n\t_serviceBrand: any;\n\n\tcreateMenu(id: MenuId, scopedKeybindingService: IContextKeyService): IMenu;\n}\n\nexport interface IMenuRegistry {\n\tappendMenuItem(menu: MenuId, item: IMenuItem | ISubmenuItem): IDisposable;\n\tgetMenuItems(loc: MenuId): Array<IMenuItem | ISubmenuItem>;\n\treadonly onDidChangeMenu: Event<MenuId>;\n}\n\nexport interface ICommandsMap {\n\t[id: string]: ICommandAction;\n}\n\nexport const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry {\n\n\tprivate readonly _commands: { [id: string]: ICommandAction } = Object.create(null);\n\tprivate readonly _menuItems: { [loc: number]: Array<IMenuItem | ISubmenuItem> } = Object.create(null);\n\tprivate readonly _onDidChangeMenu = new Emitter<MenuId>();\n\n\treadonly onDidChangeMenu: Event<MenuId> = this._onDidChangeMenu.event;\n\n\taddCommand(command: ICommandAction): IDisposable {\n\t\tthis._commands[command.id] = command;\n\t\tthis._onDidChangeMenu.fire(MenuId.CommandPalette);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tif (delete this._commands[command.id]) {\n\t\t\t\t\tthis._onDidChangeMenu.fire(MenuId.CommandPalette);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tgetCommand(id: string): ICommandAction {\n\t\treturn this._commands[id];\n\t}\n\n\tgetCommands(): ICommandsMap {\n\t\tconst result: ICommandsMap = Object.create(null);\n\t\tfor (const key in this._commands) {\n\t\t\tresult[key] = this.getCommand(key);\n\t\t}\n\t\treturn result;\n\t}\n\n\tappendMenuItem(id: MenuId, item: IMenuItem | ISubmenuItem): IDisposable {\n\t\tlet array = this._menuItems[id];\n\t\tif (!array) {\n\t\t\tthis._menuItems[id] = array = [item];\n\t\t} else {\n\t\t\tarray.push(item);\n\t\t}\n\t\tthis._onDidChangeMenu.fire(id);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tconst idx = array.indexOf(item);\n\t\t\t\tif (idx >= 0) {\n\t\t\t\t\tarray.splice(idx, 1);\n\t\t\t\t\tthis._onDidChangeMenu.fire(id);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tgetMenuItems(id: MenuId): Array<IMenuItem | ISubmenuItem> {\n\t\tconst result = (this._menuItems[id] || []).slice(0);\n\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\tconst temp = result.filter(item => { return isIMenuItem(item); }) as IMenuItem[];\n\n\t\tfor (const { command, alt } of temp) {\n\t\t\tset.add(command.id);\n\t\t\tif (alt) {\n\t\t\t\tset.add(alt.id);\n\t\t\t}\n\t\t}\n\t\tfor (let id in this._commands) {\n\t\t\tif (!set.has(id)) {\n\t\t\t\tresult.push({ command: this._commands[id] });\n\t\t\t}\n\t\t}\n\t}\n};\n\nexport class ExecuteCommandAction extends Action {\n\n\tconstructor(\n\t\tid: string,\n\t\tlabel: string,\n\t\t@ICommandService private readonly _commandService: ICommandService) {\n\n\t\tsuper(id, label);\n\t}\n\n\trun(...args: any[]): Promise<any> {\n\t\treturn this._commandService.executeCommand(this.id, ...args);\n\t}\n}\n\nexport class SubmenuItemAction extends Action {\n\n\treadonly item: ISubmenuItem;\n\tconstructor(item: ISubmenuItem) {\n\t\ttypeof item.title === 'string' ? super('', item.title, 'submenu') : super('', item.title.value, 'submenu');\n\t\tthis.item = item;\n\t}\n}\n\nexport class MenuItemAction extends ExecuteCommandAction {\n\n\treadonly item: ICommandAction;\n\treadonly alt: MenuItemAction | undefined;\n\n\tprivate _options: IMenuActionOptions;\n\n\tconstructor(\n\t\titem: ICommandAction,\n\t\talt: ICommandAction | undefined,\n\t\toptions: IMenuActionOptions,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@ICommandService commandService: ICommandService\n\t) {\n\t\ttypeof item.title === 'string' ? super(item.id, item.title, commandService) : super(item.id, item.title.value, commandService);\n\t\tthis._cssClass = undefined;\n\t\tthis._enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition);\n\t\tthis._checked = Boolean(item.toggled && contextKeyService.contextMatchesRules(item.toggled));\n\n\t\tthis._options = options || {};\n\n\t\tthis.item = item;\n\t\tthis.alt = alt ? new MenuItemAction(alt, undefined, this._options, contextKeyService, commandService) : undefined;\n\t}\n\n\trun(...args: any[]): Promise<any> {\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 super.run(...runArgs);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { IMenu, IMenuActionOptions, IMenuItem, IMenuService, isIMenuItem, ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction } from 'vs/platform/actions/common/actions';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr, IContextKeyService, IContextKeyChangeEvent } from 'vs/platform/contextkey/common/contextkey';\n\nexport class MenuService implements IMenuService {\n\n\t_serviceBrand: any;\n\n\tconstructor(\n\t\t@ICommandService private readonly _commandService: ICommandService\n\t) {\n\t\t//\n\t}\n\n\tcreateMenu(id: MenuId, contextKeyService: IContextKeyService): IMenu {\n\t\treturn new Menu(id, this._commandService, contextKeyService);\n\t}\n}\n\n\ntype MenuItemGroup = [string, Array<IMenuItem | ISubmenuItem>];\n\nclass Menu implements IMenu {\n\n\tprivate readonly _onDidChange = new Emitter<IMenu | undefined>();\n\tprivate readonly _disposables: IDisposable[] = [];\n\n\tprivate _menuGroups: MenuItemGroup[];\n\tprivate _contextKeys: Set<string>;\n\n\tconstructor(\n\t\tprivate readonly _id: MenuId,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService\n\t) {\n\t\tthis._build();\n\n\t\t// rebuild this menu whenever the menu registry reports an\n\t\t// event for this MenuId\n\t\tEvent.debounce(\n\t\t\tEvent.filter(MenuRegistry.onDidChangeMenu, menuId => menuId === this._id),\n\t\t\t() => { },\n\t\t\t50\n\t\t)(this._build, this, this._disposables);\n\n\t\t// when context keys change we need to check if the menu also\n\t\t// has changed\n\t\tEvent.debounce<IContextKeyChangeEvent, boolean>(\n\t\t\tthis._contextKeyService.onDidChangeContext,\n\t\t\t(last, event) => last || event.affectsSome(this._contextKeys),\n\t\t\t50\n\t\t)(e => e && this._onDidChange.fire(undefined), this, this._disposables);\n\t}\n\n\tprivate _build(): void {\n\n\t\t// reset\n\t\tthis._menuGroups = [];\n\t\tthis._contextKeys = new Set();\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 (let 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\tMenu._fillInKbExprKeys(item.when, this._contextKeys);\n\n\t\t\t// keep precondition keys for event if applicable\n\t\t\tif (isIMenuItem(item) && item.command.precondition) {\n\t\t\t\tMenu._fillInKbExprKeys(item.command.precondition, this._contextKeys);\n\t\t\t}\n\n\t\t\t// keep toggled keys for event if applicable\n\t\t\tif (isIMenuItem(item) && item.command.toggled) {\n\t\t\t\tMenu._fillInKbExprKeys(item.command.toggled, this._contextKeys);\n\t\t\t}\n\t\t}\n\t\tthis._onDidChange.fire(this);\n\t}\n\n\tdispose() {\n\t\tdispose(this._disposables);\n\t\tthis._onDidChange.dispose();\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) ? new MenuItemAction(item.command, item.alt, options, this._contextKeyService, this._commandService) : new SubmenuItemAction(item);\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: ContextKeyExpr | 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, b: IMenuItem): 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\tconst aTitle = typeof a.command.title === 'string' ? a.command.title : a.command.title.value;\n\t\tconst bTitle = typeof b.command.title === 'string' ? b.command.title : b.command.title.value;\n\t\treturn aTitle.localeCompare(bTitle);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IContextMenuDelegate } from 'vs/base/browser/contextmenu';\nimport { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';\n\nexport const IContextViewService = createDecorator<IContextViewService>('contextViewService');\n\nexport interface IContextViewService {\n\n\t_serviceBrand: any;\n\n\tshowContextView(delegate: IContextViewDelegate): void;\n\thideContextView(data?: any): void;\n\tlayout(): void;\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}\n\nexport const IContextMenuService = createDecorator<IContextMenuService>('contextMenuService');\n\nexport interface IContextMenuService {\n\n\t_serviceBrand: any;\n\n\tshowContextMenu(delegate: IContextMenuDelegate): void; // TODO@isidor these event should be removed once we get async context menus\n}","\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\n\nexport const IDialogService = createDecorator<IDialogService>('dialogService');\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\t_serviceBrand: any;\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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\thas(id: ServiceIdentifier<any>): boolean {\n\t\treturn this._entries.has(id);\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 { illegalState } from 'vs/base/common/errors';\nimport { Graph } from 'vs/platform/instantiation/common/graph';\nimport { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';\nimport { ServiceIdentifier, IInstantiationService, ServicesAccessor, _util, optional } from 'vs/platform/instantiation/common/instantiation';\nimport { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';\nimport { IdleValue } from 'vs/base/common/async';\n\n// TRACING\nconst _enableTracing = false;\n\n// PROXY\n// Ghetto-declare of the global Proxy object. This isn't the proper way\n// but allows us to run this code in the browser without IE11.\ndeclare var Proxy: any;\nconst _canUseProxy = typeof Proxy === 'function';\n\nexport class InstantiationService implements IInstantiationService {\n\n\t_serviceBrand: any;\n\n\tprotected readonly _services: ServiceCollection;\n\tprotected readonly _strict: boolean;\n\tprotected 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>, isOptional?: typeof optional) => {\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 && isOptional !== optional) {\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.apply(undefined, [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 && this._strict && !dependency.optional) {\n\t\t\t\tthrow new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`);\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 ${\n\t\t\t\tfirstServiceArgPos + 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\tprivate _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._createAndCacheServiceInstance(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 _createAndCacheServiceInstance<T>(id: ServiceIdentifier<T>, desc: SyncDescriptor<T>, _trace: Trace): T {\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\tfunction throwCycleError() {\n\t\t\tconst err = new Error('[createInstance] cyclic dependency between services');\n\t\t\terr.message = graph.toString();\n\t\t\tthrow err;\n\t\t}\n\n\t\tlet count = 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// TODO@joh use the graph to find a cycle\n\t\t\t// a weak heuristic for cycle checks\n\t\t\tif (count++ > 100) {\n\t\t\t\tthrowCycleError();\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\tlet dependencies = _util.getServiceDependencies(item.desc.ctor);\n\t\t\tfor (let dependency of dependencies) {\n\n\t\t\t\tlet instanceOrDesc = this._getServiceInstanceOrDescriptor(dependency.id);\n\t\t\t\tif (!instanceOrDesc && !dependency.optional) {\n\t\t\t\t\tconsole.warn(`[createInstance] ${id} depends on ${dependency.id} which is NOT registered.`);\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\tlet 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\tthrowCycleError();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (let { data } of roots) {\n\t\t\t\t// create instance and overwrite the service collections\n\t\t\t\tconst instance = this._createServiceInstanceWithOwner(data.id, data.desc.ctor, data.desc.staticArguments, data.desc.supportsDelayedInstantiation, data._trace);\n\t\t\t\tthis._setServiceInstance(data.id, instance);\n\t\t\t\tgraph.removeNode(data);\n\t\t\t}\n\t\t}\n\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');\n\t\t}\n\t}\n\n\tprivate _createServiceInstance<T>(ctor: any, args: any[] = [], _supportsDelayedInstantiation: boolean, _trace: Trace): T {\n\t\tif (!_supportsDelayedInstantiation || !_canUseProxy) {\n\t\t\t// eager instantiation or no support JS proxies (e.g. IE11)\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(() => this._createInstance(ctor, args, _trace));\n\t\t\treturn <T>new Proxy(Object.create(null), {\n\t\t\t\tget(_target: T, prop: PropertyKey): any {\n\t\t\t\t\treturn idle.getValue()[prop];\n\t\t\t\t},\n\t\t\t\tset(_target: T, p: PropertyKey, value: any): boolean {\n\t\t\t\t\tidle.getValue()[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\n//#region -- tracing ---\n\nconst enum TraceType {\n\tCreation, Invocation, Branch\n}\n\nclass Trace {\n\n\tprivate static _None = new class extends Trace {\n\t\tconstructor() { super(-1, null); }\n\t\tstop() { }\n\t\tbranch() { 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 * as nls from 'vs/nls';\nimport { IntervalTimer } from 'vs/base/common/async';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { KeyCode, Keybinding, ResolvedKeybinding } from 'vs/base/common/keyCodes';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\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 { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { withNullAsUndefined } from 'vs/base/common/types';\n\ninterface CurrentChord {\n\tkeypress: string;\n\tlabel: string | null;\n}\n\nexport abstract class AbstractKeybindingService extends Disposable implements IKeybindingService {\n\tpublic _serviceBrand: any;\n\n\tprivate _currentChord: CurrentChord | null;\n\tprivate _currentChordChecker: IntervalTimer;\n\tprivate _currentChordStatusMessage: IDisposable | null;\n\tprotected _onDidUpdateKeybindings: Emitter<IKeybindingEvent>;\n\n\tprivate _contextKeyService: IContextKeyService;\n\tprivate _statusService: IStatusbarService | undefined;\n\tprivate _notificationService: INotificationService;\n\tprotected _commandService: ICommandService;\n\tprotected _telemetryService: ITelemetryService;\n\n\tconstructor(\n\t\tcontextKeyService: IContextKeyService,\n\t\tcommandService: ICommandService,\n\t\ttelemetryService: ITelemetryService,\n\t\tnotificationService: INotificationService,\n\t\tstatusService?: IStatusbarService\n\t) {\n\t\tsuper();\n\t\tthis._contextKeyService = contextKeyService;\n\t\tthis._commandService = commandService;\n\t\tthis._telemetryService = telemetryService;\n\t\tthis._statusService = statusService;\n\t\tthis._notificationService = notificationService;\n\n\t\tthis._currentChord = null;\n\t\tthis._currentChordChecker = new IntervalTimer();\n\t\tthis._currentChordStatusMessage = null;\n\t\tthis._onDidUpdateKeybindings = this._register(new Emitter<IKeybindingEvent>());\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\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\tprotected abstract _getResolver(): KeybindingResolver;\n\tprotected abstract _documentHasFocus(): boolean;\n\tpublic abstract resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[];\n\tpublic abstract resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding;\n\n\tpublic lookupKeybinding(commandId: string): ResolvedKeybinding | undefined {\n\t\tlet result = this._getResolver().lookupPrimaryKeybinding(commandId);\n\t\tif (!result) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn withNullAsUndefined(result.resolvedKeybinding);\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\tif (this._statusService) {\n\t\t\tthis._currentChordStatusMessage = this._statusService.setStatusMessage(nls.localize('first.chord', \"({0}) was pressed. Waiting for second key of chord...\", keypressLabel));\n\t\t}\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);\n\t}\n\n\tprivate _doDispatch(keybinding: ResolvedKeybinding, target: IContextKeyServiceTarget): 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\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 shouldPreventDefault;\n\t\t}\n\n\t\tconst contextValue = this._contextKeyService.getContext(target);\n\t\tconst currentChord = this._currentChord ? this._currentChord.keypress : null;\n\t\tconst keypressLabel = keybinding.getLabel();\n\t\tconst resolveResult = this._getResolver().resolve(contextValue, currentChord, firstPart);\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._statusService && this._currentChord) {\n\t\t\tif (!resolveResult || !resolveResult.commandId) {\n\t\t\t\tthis._statusService.setStatusMessage(nls.localize('missing.chord', \"The key combination ({0}, {1}) is not a command.\", this._currentChord.label, keypressLabel), 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\t/* __GDPR__\n\t\t\t\t\"workbenchActionExecuted\" : {\n\t\t\t\t\t\"id\" : { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" },\n\t\t\t\t\t\"from\": { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" }\n\t\t\t\t}\n\t\t\t*/\n\t\t\tthis._telemetryService.publicLog('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });\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.KEY_A && event.keyCode <= KeyCode.KEY_Z)\n\t\t\t|| (event.keyCode >= KeyCode.KEY_0 && event.keyCode <= KeyCode.KEY_9)) {\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 { OperatingSystem } from 'vs/base/common/platform';\nimport { illegalArgument } from 'vs/base/common/errors';\nimport { Modifiers, UILabelProvider, AriaLabelProvider } from 'vs/base/common/keybindingLabels';\nimport { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes';\n\nexport abstract class BaseResolvedKeybinding<T extends Modifiers> 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 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\tprotected abstract _getLabel(keybinding: T): string | null;\n\tprotected abstract _getAriaLabel(keybinding: T): string | null;\n\tprotected abstract _getDispatchPart(keybinding: T): 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 { KeyCode, ResolvedKeybinding } from 'vs/base/common/keyCodes';\nimport { IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IResolveResult } from 'vs/platform/keybinding/common/keybindingResolver';\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\t_serviceBrand: any;\n\n\tonDidUpdateKeybindings: Event<IKeybindingEvent>;\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): ResolvedKeybinding | undefined;\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","\nimport { ContextKeyAndExpr, ContextKeyExpr, IContext } from 'vs/platform/contextkey/common/contextkey';\nimport { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';\n\nexport interface IResolveResult {\n\tenterChord: boolean;\n\tcommandId: string | null;\n\tcommandArgs: any;\n\tbubble: boolean;\n}\n\nexport class KeybindingResolver {\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(defaultKeybindings: ResolvedKeybindingItem[], overrides: ResolvedKeybindingItem[]) {\n\t\tthis._defaultKeybindings = defaultKeybindings;\n\n\t\tthis._defaultBoundCommands = new Map<string, boolean>();\n\t\tfor (let i = 0, len = defaultKeybindings.length; i < len; i++) {\n\t\t\tconst command = defaultKeybindings[i].command;\n\t\t\tif (command) {\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.combine(defaultKeybindings, 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\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, command: string, when: ContextKeyExpr | undefined): boolean {\n\t\tif (defaultKb.command !== command) {\n\t\t\treturn false;\n\t\t}\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 (!when.equals(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 -command in `overrides` and removes them directly from `defaults`.\n\t */\n\tpublic static combine(defaults: ResolvedKeybindingItem[], rawOverrides: ResolvedKeybindingItem[]): ResolvedKeybindingItem[] {\n\t\tdefaults = defaults.slice(0);\n\t\tlet overrides: ResolvedKeybindingItem[] = [];\n\t\tfor (const override of rawOverrides) {\n\t\t\tif (!override.command || override.command.length === 0 || override.command.charAt(0) !== '-') {\n\t\t\t\toverrides.push(override);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst command = override.command.substr(1);\n\t\t\t// TODO@chords\n\t\t\tconst keypressFirstPart = override.keypressParts[0];\n\t\t\tconst keypressChordPart = override.keypressParts[1];\n\t\t\tconst when = override.when;\n\t\t\tfor (let j = defaults.length - 1; j >= 0; j--) {\n\t\t\t\tif (this._isTargetedForRemoval(defaults[j], keypressFirstPart, keypressChordPart, command, when)) {\n\t\t\t\t\tdefaults.splice(j, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn defaults.concat(overrides);\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 * **Precondition**: Assumes `a` and `b` are normalized!\n\t */\n\tpublic static whenIsEntirelyIncluded(a: ContextKeyExpr | null | undefined, b: ContextKeyExpr | null | undefined): boolean {\n\t\tif (!b) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!a) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst aExpressions: ContextKeyExpr[] = ((a instanceof ContextKeyAndExpr) ? a.expr : [a]);\n\t\tconst bExpressions: ContextKeyExpr[] = ((b instanceof ContextKeyAndExpr) ? b.expr : [b]);\n\n\t\tlet aIndex = 0;\n\t\tfor (const bExpr of bExpressions) {\n\t\t\tlet bExprMatched = false;\n\t\t\twhile (!bExprMatched && aIndex < aExpressions.length) {\n\t\t\t\tlet aExpr = aExpressions[aIndex];\n\t\t\t\tif (aExpr.equals(bExpr)) {\n\t\t\t\t\tbExprMatched = true;\n\t\t\t\t}\n\t\t\t\taIndex++;\n\t\t\t}\n\n\t\t\tif (!bExprMatched) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic lookupPrimaryKeybinding(commandId: string): ResolvedKeybindingItem | null {\n\t\tlet items = this._lookupMap.get(commandId);\n\t\tif (typeof items === 'undefined' || items.length === 0) {\n\t\t\treturn null;\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\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\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\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\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\treturn {\n\t\t\t\tenterChord: true,\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\treturn {\n\t\t\tenterChord: false,\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\tpublic static contextMatchesRules(context: IContext, rules: ContextKeyExpr | 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/keyCodes';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\n\nexport class ResolvedKeybindingItem {\n\t_resolvedKeybindingItemBrand: void;\n\n\tpublic readonly resolvedKeybinding: ResolvedKeybinding | null;\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: ContextKeyExpr | undefined;\n\tpublic readonly isDefault: boolean;\n\n\tconstructor(resolvedKeybinding: ResolvedKeybinding | null, command: string | null, commandArgs: any, when: ContextKeyExpr | undefined, isDefault: boolean) {\n\t\tthis.resolvedKeybinding = resolvedKeybinding;\n\t\tthis.keypressParts = resolvedKeybinding ? removeElementsAfterNulls(resolvedKeybinding.getDispatchParts()) : [];\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}\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, Keybinding, SimpleKeybinding } from 'vs/base/common/keyCodes';\nimport { OperatingSystem } from 'vs/base/common/platform';\nimport { BaseResolvedKeybinding } from 'vs/platform/keybinding/common/baseResolvedKeybinding';\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 _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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport interface ILabelService {\n\t_serviceBrand: any;\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 */\n\tgetUriLabel(resource: URI, options?: { relative?: boolean, noPrefix?: boolean, endWithSeparator?: boolean }): string;\n}\n\nconst LABEL_SERVICE_ID = 'label';\n\n\nexport const ILabelService = createDecorator<ILabelService>(LABEL_SERVICE_ID);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 ILayoutService = createDecorator<ILayoutService>('layoutService');\n\nexport interface IDimension {\n}\n\nexport interface ILayoutService {\n\n\t_serviceBrand: any;\n\n\t/**\n\t * Container of the application.\n\t */\n\treadonly container: HTMLElement;\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 onLayout: Event<IDimension>;\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IContextViewService, IContextViewDelegate } from './contextView';\nimport { ContextView } from 'vs/base/browser/ui/contextview/contextview';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\n\nexport class ContextViewService extends Disposable implements IContextViewService {\n\t_serviceBrand: any;\n\n\tprivate contextView: ContextView;\n\n\tconstructor(\n\t\t@ILayoutService readonly layoutService: ILayoutService\n\t) {\n\t\tsuper();\n\n\t\tthis.contextView = this._register(new ContextView(layoutService.container));\n\t\tthis.layout();\n\n\t\tthis._register(layoutService.onLayout(() => this.layout()));\n\t}\n\n\t// ContextView\n\n\tsetContainer(container: HTMLElement): void {\n\t\tthis.contextView.setContainer(container);\n\t}\n\n\tshowContextView(delegate: IContextViewDelegate): void {\n\t\tthis.contextView.show(delegate);\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 * Copyright (c) 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 as createServiceDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IDisposable } from 'vs/base/common/lifecycle';\n\nexport const ILogService = createServiceDecorator<ILogService>('logService');\n\nexport interface ILogService extends IDisposable {\n\t_serviceBrand: any;\n\ttrace(message: string, ...args: any[]): void;\n\terror(message: string | Error, ...args: any[]): void;\n}\n\nexport class NullLogService implements ILogService {\n\t_serviceBrand: any;\n\ttrace(message: string, ...args: any[]): void { }\n\terror(message: string | Error, ...args: any[]): void { }\n\tdispose(): void { }\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 } from 'vs/base/common/async';\nimport { Disposable, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { SimpleWorkerClient, logOnceWebWorkerWarning } from 'vs/base/common/worker/simpleWorker';\nimport { DefaultWorkerFactory } from 'vs/base/worker/defaultWorkerFactory';\nimport { IEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as modes from 'vs/editor/common/modes';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { EditorSimpleWorkerImpl } from 'vs/editor/common/services/editorSimpleWorker';\nimport { IDiffComputationResult, IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';\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';\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\tlet 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 EditorWorkerServiceImpl extends Disposable implements IEditorWorkerService {\n\tpublic _serviceBrand: any;\n\n\tprivate readonly _modelService: IModelService;\n\tprivate readonly _workerManager: WorkerManager;\n\tprivate readonly _logService: ILogService;\n\tconstructor(\n\t\t@IModelService modelService: IModelService,\n\t\t@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,\n\t\t@ILogService logService: ILogService\n\t) {\n\t\tsuper();\n\t\tthis._modelService = modelService;\n\t\tthis._workerManager = this._register(new WorkerManager(this._modelService));\n\t\tthis._logService = logService;\n\n\t\t// todo@joh make sure this happens only once\n\t\tthis._register(modes.LinkProviderRegistry.register('*', {\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(modes.CompletionProviderRegistry.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService)));\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic canComputeDiff(original: URI, modified: URI): boolean {\n\t\treturn (canSyncModel(this._modelService, original) && canSyncModel(this._modelService, modified));\n\t}\n\n\tpublic computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise<IDiffComputationResult | null> {\n\t\treturn this._workerManager.withWorker().then(client => client.computeDiff(original, modified, ignoreTrimWhitespace));\n\t}\n\n\tpublic computeMoreMinimalEdits(resource: URI, edits: modes.TextEdit[] | null | undefined): Promise<modes.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 result;\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<modes.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 modes.CompletionItemProvider {\n\n\tprivate readonly _workerManager: WorkerManager;\n\tprivate readonly _configurationService: ITextResourceConfigurationService;\n\tprivate readonly _modelService: IModelService;\n\n\tconstructor(\n\t\tworkerManager: WorkerManager,\n\t\tconfigurationService: ITextResourceConfigurationService,\n\t\tmodelService: IModelService\n\t) {\n\t\tthis._workerManager = workerManager;\n\t\tthis._configurationService = configurationService;\n\t\tthis._modelService = modelService;\n\t}\n\n\tprovideCompletionItems(model: ITextModel, position: Position): Promise<modes.CompletionList | null> | undefined {\n\t\tconst { wordBasedSuggestions } = this._configurationService.getValue<IEditorOptions>(model.uri, position, 'editor');\n\t\tif (!wordBasedSuggestions) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (!canSyncModel(this._modelService, model.uri)) {\n\t\t\treturn undefined; // File too large\n\t\t}\n\t\treturn this._workerManager.withWorker().then(client => client.textualSuggest(model.uri, position));\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) {\n\t\tsuper();\n\t\tthis._modelService = modelService;\n\t\tthis._editorWorkerClient = null;\n\n\t\tlet 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 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\tlet 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\tlet 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, 'editorWorkerService');\n\t\t}\n\t\treturn Promise.resolve(this._editorWorkerClient);\n\t}\n}\n\nclass EditorModelManager extends Disposable {\n\n\tprivate readonly _proxy: EditorSimpleWorkerImpl;\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: EditorSimpleWorkerImpl, 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\tlet 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 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 esureSyncedResources(resources: URI[]): void {\n\t\tfor (const resource of resources) {\n\t\t\tlet resourceStr = resource.toString();\n\n\t\t\tif (!this._syncedModels[resourceStr]) {\n\t\t\t\tthis._beginModelSync(resource);\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\tlet currentTime = (new Date()).getTime();\n\n\t\tlet toRemove: string[] = [];\n\t\tfor (let modelUrl in this._syncedModelsLastUsedTime) {\n\t\t\tlet 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): void {\n\t\tlet model = this._modelService.getModel(resource);\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\t\tif (model.isTooLargeForSyncing()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet 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\tlet toDispose: IDisposable[] = [];\n\t\ttoDispose.push(model.onDidChangeContent((e) => {\n\t\t\tthis._proxy.acceptModelChanged(modelUrl.toString(), e);\n\t\t}));\n\t\ttoDispose.push(model.onWillDispose(() => {\n\t\t\tthis._stopModelSync(modelUrl);\n\t\t}));\n\t\ttoDispose.push(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\tlet toDispose = this._syncedModels[modelUrl];\n\t\tdelete this._syncedModels[modelUrl];\n\t\tdelete this._syncedModelsLastUsedTime[modelUrl];\n\t\tdispose(toDispose);\n\t}\n}\n\ninterface IWorkerClient<T> {\n\tgetProxyObject(): Promise<T>;\n\tdispose(): void;\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 class EditorWorkerClient extends Disposable {\n\n\tprivate readonly _modelService: IModelService;\n\tprivate _worker: IWorkerClient<EditorSimpleWorkerImpl> | null;\n\tprivate readonly _workerFactory: DefaultWorkerFactory;\n\tprivate _modelManager: EditorModelManager | null;\n\n\tconstructor(modelService: IModelService, label: string | undefined) {\n\t\tsuper();\n\t\tthis._modelService = modelService;\n\t\tthis._workerFactory = new DefaultWorkerFactory(label);\n\t\tthis._worker = null;\n\t\tthis._modelManager = null;\n\t}\n\n\tprivate _getOrCreateWorker(): IWorkerClient<EditorSimpleWorkerImpl> {\n\t\tif (!this._worker) {\n\t\t\ttry {\n\t\t\t\tthis._worker = this._register(new SimpleWorkerClient<EditorSimpleWorkerImpl>(\n\t\t\t\t\tthis._workerFactory,\n\t\t\t\t\t'vs/editor/common/services/editorSimpleWorker'\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 EditorSimpleWorkerImpl(null));\n\t\t\t}\n\t\t}\n\t\treturn this._worker;\n\t}\n\n\tprotected _getProxy(): Promise<EditorSimpleWorkerImpl> {\n\t\treturn this._getOrCreateWorker().getProxyObject().then(undefined, (err) => {\n\t\t\tlogOnceWebWorkerWarning(err);\n\t\t\tthis._worker = new SynchronousWorkerClient(new EditorSimpleWorkerImpl(null));\n\t\t\treturn this._getOrCreateWorker().getProxyObject();\n\t\t});\n\t}\n\n\tprivate _getOrCreateModelManager(proxy: EditorSimpleWorkerImpl): EditorModelManager {\n\t\tif (!this._modelManager) {\n\t\t\tthis._modelManager = this._register(new EditorModelManager(proxy, this._modelService, false));\n\t\t}\n\t\treturn this._modelManager;\n\t}\n\n\tprotected _withSyncedResources(resources: URI[]): Promise<EditorSimpleWorkerImpl> {\n\t\treturn this._getProxy().then((proxy) => {\n\t\t\tthis._getOrCreateModelManager(proxy).esureSyncedResources(resources);\n\t\t\treturn proxy;\n\t\t});\n\t}\n\n\tpublic computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise<IDiffComputationResult | null> {\n\t\treturn this._withSyncedResources([original, modified]).then(proxy => {\n\t\t\treturn proxy.computeDiff(original.toString(), modified.toString(), ignoreTrimWhitespace);\n\t\t});\n\t}\n\n\tpublic computeMoreMinimalEdits(resource: URI, edits: modes.TextEdit[]): Promise<modes.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<modes.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 textualSuggest(resource: URI, position: IPosition): Promise<modes.CompletionList | null> {\n\t\treturn this._withSyncedResources([resource]).then(proxy => {\n\t\t\tlet model = this._modelService.getModel(resource);\n\t\t\tif (!model) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet wordDefRegExp = LanguageConfigurationRegistry.getWordDefinition(model.getLanguageIdentifier().id);\n\t\t\tlet wordDef = wordDefRegExp.source;\n\t\t\tlet wordDefFlags = regExpFlags(wordDefRegExp);\n\t\t\treturn proxy.textualSuggest(resource.toString(), position, wordDef, wordDefFlags);\n\t\t});\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\tlet 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\tlet wordDefRegExp = LanguageConfigurationRegistry.getWordDefinition(model.getLanguageIdentifier().id);\n\t\t\tlet wordDef = wordDefRegExp.source;\n\t\t\tlet 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<modes.IInplaceReplaceSupportResult | null> {\n\t\treturn this._withSyncedResources([resource]).then(proxy => {\n\t\t\tlet model = this._modelService.getModel(resource);\n\t\t\tif (!model) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet wordDefRegExp = LanguageConfigurationRegistry.getWordDefinition(model.getLanguageIdentifier().id);\n\t\t\tlet wordDef = wordDefRegExp.source;\n\t\t\tlet wordDefFlags = regExpFlags(wordDefRegExp);\n\t\t\treturn proxy.navigateValueSet(resource.toString(), range, up, wordDef, wordDefFlags);\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 { URI } from 'vs/base/common/uri';\nimport { EditorWorkerClient } from 'vs/editor/common/services/editorWorkerServiceImpl';\nimport { IModelService } from 'vs/editor/common/services/modelService';\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, opts: IWebWorkerOptions): MonacoWebWorker<T> {\n\treturn new MonacoWebWorkerImpl<T>(modelService, 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}\n\nclass MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWorker<T> {\n\n\tprivate readonly _foreignModuleId: string;\n\tprivate _foreignModuleCreateData: any | null;\n\tprivate _foreignProxy: Promise<T> | null;\n\n\tconstructor(modelService: IModelService, opts: IWebWorkerOptions) {\n\t\tsuper(modelService, opts.label);\n\t\tthis._foreignModuleId = opts.moduleId;\n\t\tthis._foreignModuleCreateData = opts.createData || null;\n\t\tthis._foreignProxy = null;\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\treturn proxy.loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData).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\tlet 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 { URI } from 'vs/base/common/uri';\nimport { Event } from 'vs/base/common/event';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { localize } from 'vs/nls';\nimport Severity from 'vs/base/common/severity';\n\nexport interface IMarkerService {\n\t_serviceBrand: any;\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\tonMarkerChanged: Event<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}\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\n/**\n * A structure defining a problem/warning/etc.\n */\nexport interface IMarkerData {\n\tcode?: string;\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;\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\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\tresult.push(markerData.code.replace('¦', '\\¦'));\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\t\tif (markerData.message) {\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 { isFalsyOrEmpty } from 'vs/base/common/arrays';\nimport { Schemas } from 'vs/base/common/network';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { isEmptyObject } from 'vs/base/common/types';\nimport { URI } from 'vs/base/common/uri';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { IMarkerService, IMarkerData, IMarker, MarkerStatistics, MarkerSeverity } from './markers';\n\ninterface MapMap<V> {\n\t[key: string]: { [key: string]: V };\n}\n\nnamespace MapMap {\n\n\texport function get<V>(map: MapMap<V>, key1: string, key2: string): V | undefined {\n\t\tif (map[key1]) {\n\t\t\treturn map[key1][key2];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\texport function set<V>(map: MapMap<V>, key1: string, key2: string, value: V): void {\n\t\tif (!map[key1]) {\n\t\t\tmap[key1] = Object.create(null);\n\t\t}\n\t\tmap[key1][key2] = value;\n\t}\n\n\texport function remove(map: MapMap<any>, key1: string, key2: string): boolean {\n\t\tif (map[key1] && map[key1][key2]) {\n\t\t\tdelete map[key1][key2];\n\t\t\tif (isEmptyObject(map[key1])) {\n\t\t\t\tdelete map[key1];\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\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 _data?: { [resource: string]: MarkerStatistics } = Object.create(null);\n\tprivate _service: IMarkerService;\n\tprivate _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\tthis._data = undefined;\n\t}\n\n\tprivate _update(resources: URI[]): void {\n\t\tif (!this._data) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const resource of resources) {\n\t\t\tconst key = resource.toString();\n\t\t\tconst oldStats = this._data[key];\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[key] = 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\t_serviceBrand: any;\n\n\tprivate _onMarkerChanged = new Emitter<URI[]>();\n\tprivate _onMarkerChangedEvent: Event<URI[]> = Event.debounce(this._onMarkerChanged.event, MarkerService._debouncer, 0);\n\tprivate _byResource: MapMap<IMarker[]> = Object.create(null);\n\tprivate _byOwner: MapMap<IMarker[]> = Object.create(null);\n\tprivate _stats: MarkerStats;\n\n\tconstructor() {\n\t\tthis._stats = new MarkerStats(this);\n\t}\n\n\tdispose(): void {\n\t\tthis._stats.dispose();\n\t}\n\n\tget onMarkerChanged(): Event<URI[]> {\n\t\treturn this._onMarkerChangedEvent;\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 a = MapMap.remove(this._byResource, resource.toString(), owner);\n\t\t\tconst b = MapMap.remove(this._byOwner, owner, resource.toString());\n\t\t\tif (a !== b) {\n\t\t\t\tthrow new Error('invalid marker service state');\n\t\t\t}\n\t\t\tif (a && b) {\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\tMapMap.set(this._byResource, resource.toString(), owner, markers);\n\t\t\tMapMap.set(this._byOwner, owner, resource.toString(), 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 = MapMap.get(this._byResource, resource.toString(), 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 (const key1 in this._byResource) {\n\t\t\t\tfor (const key2 in this._byResource[key1]) {\n\t\t\t\t\tfor (const data of this._byResource[key1][key2]) {\n\t\t\t\t\t\tif (MarkerService._accept(data, severities)) {\n\t\t\t\t\t\t\tconst newLen = result.push(data);\n\t\t\t\t\t\t\tif (take > 0 && newLen === take) {\n\t\t\t\t\t\t\t\treturn result;\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\treturn result;\n\n\t\t} else {\n\t\t\t// of one resource OR owner\n\t\t\tconst map: { [key: string]: IMarker[] } | undefined = owner\n\t\t\t\t? this._byOwner[owner]\n\t\t\t\t: resource ? this._byResource[resource.toString()] : undefined;\n\n\t\t\tif (!map) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst result: IMarker[] = [];\n\t\t\tfor (const key in map) {\n\t\t\t\tfor (const data of map[key]) {\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 _dedupeMap: { [uri: string]: boolean };\n\n\tprivate static _debouncer(last: URI[], event: URI[]): URI[] {\n\t\tif (!last) {\n\t\t\tMarkerService._dedupeMap = Object.create(null);\n\t\t\tlast = [];\n\t\t}\n\t\tfor (const uri of event) {\n\t\t\tif (MarkerService._dedupeMap[uri.toString()] === undefined) {\n\t\t\t\tMarkerService._dedupeMap[uri.toString()] = true;\n\t\t\t\tlast.push(uri);\n\t\t\t}\n\t\t}\n\t\treturn 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 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\nexport interface INotification extends INotificationProperties {\n\n\t/**\n\t * The severity of the notification. Either `Info`, `Warning` or `Error`.\n\t */\n\tseverity: 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\tmessage: NotificationMessage;\n}\n\nexport interface INotificationHandle {\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\t_serviceBrand: any;\n\n\t/**\n\t * A convinient 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 convinient 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 convinient 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\nexport class NoOpNotification implements INotificationHandle {\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { createDecorator } from 'vs/platform/instantiation/common/instantiation';\n\nexport const IOpenerService = createDecorator<IOpenerService>('openerService');\n\n\nexport interface IOpener {\n\topen(resource: URI, options?: { openToSide?: boolean }): Promise<boolean>;\n}\n\nexport interface IOpenerService {\n\n\t_serviceBrand: any;\n\n\t/**\n\t * Opens a resource, like a webadress, 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, options?: { openToSide?: boolean }): Promise<boolean>;\n}\n\nexport const NullOpenerService: IOpenerService = Object.freeze({\n\t_serviceBrand: undefined,\n\tregisterOpener() { return { dispose() { } }; },\n\topen() { return Promise.resolve(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 { IMarkdownString } from 'vs/base/common/htmlContent';\nimport { renderMarkdown, RenderOptions } from 'vs/base/browser/htmlContentRenderer';\nimport { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { URI } from 'vs/base/common/uri';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { tokenizeToString } from 'vs/editor/common/modes/textToHtmlTokenizer';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { optional } from 'vs/platform/instantiation/common/instantiation';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { TokenizationRegistry } from 'vs/editor/common/modes';\n\nexport interface IMarkdownRenderResult extends IDisposable {\n\telement: HTMLElement;\n}\n\nexport class MarkdownRenderer {\n\n\tprivate _onDidRenderCodeBlock = new Emitter<void>();\n\treadonly onDidRenderCodeBlock: Event<void> = this._onDidRenderCodeBlock.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IModeService private readonly _modeService: IModeService,\n\t\t@optional(IOpenerService) private readonly _openerService: IOpenerService | null = NullOpenerService,\n\t) {\n\t}\n\n\tprivate getOptions(disposeables: IDisposable[]): RenderOptions {\n\t\treturn {\n\t\t\tcodeBlockRenderer: (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 modeId: string | null = null;\n\t\t\t\tif (languageAlias) {\n\t\t\t\t\tmodeId = this._modeService.getModeIdForLanguageName(languageAlias);\n\t\t\t\t} else {\n\t\t\t\t\tconst model = this._editor.getModel();\n\t\t\t\t\tif (model) {\n\t\t\t\t\t\tmodeId = model.getLanguageIdentifier().language;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._modeService.triggerMode(modeId || '');\n\t\t\t\treturn Promise.resolve(true).then(_ => {\n\t\t\t\t\tconst promise = TokenizationRegistry.getPromise(modeId || '');\n\t\t\t\t\tif (promise) {\n\t\t\t\t\t\treturn promise.then(support => tokenizeToString(value, support));\n\t\t\t\t\t}\n\t\t\t\t\treturn tokenizeToString(value, undefined);\n\t\t\t\t}).then(code => {\n\t\t\t\t\treturn `<span style=\"font-family: ${this._editor.getConfiguration().fontInfo.fontFamily}\">${code}</span>`;\n\t\t\t\t});\n\t\t\t},\n\t\t\tcodeBlockRenderCallback: () => this._onDidRenderCodeBlock.fire(),\n\t\t\tactionHandler: {\n\t\t\t\tcallback: (content) => {\n\t\t\t\t\tlet uri: URI | undefined;\n\t\t\t\t\ttry {\n\t\t\t\t\t\turi = URI.parse(content);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t\tif (uri && this._openerService) {\n\t\t\t\t\t\tthis._openerService.open(uri).catch(onUnexpectedError);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdisposeables\n\t\t\t}\n\t\t};\n\t}\n\n\trender(markdown: IMarkdownString | undefined): IMarkdownRenderResult {\n\t\tlet disposeables: IDisposable[] = [];\n\n\t\tlet element: HTMLElement;\n\t\tif (!markdown) {\n\t\t\telement = document.createElement('span');\n\t\t} else {\n\t\t\telement = renderMarkdown(markdown, this.getOptions(disposeables));\n\t\t}\n\n\t\treturn {\n\t\t\telement,\n\t\t\tdispose: () => dispose(disposeables)\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 { IMarkdownString, isEmptyMarkdownString } from 'vs/base/common/htmlContent';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contrib/hover/hoverOperation';\nimport { GlyphHoverWidget } from 'vs/editor/contrib/hover/hoverWidgets';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener';\nimport { asArray } from 'vs/base/common/arrays';\n\nexport interface IHoverMessage {\n\tvalue: IMarkdownString;\n}\n\nclass MarginComputer implements IHoverComputer<IHoverMessage[]> {\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _lineNumber: number;\n\tprivate _result: IHoverMessage[];\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis._editor = editor;\n\t\tthis._lineNumber = -1;\n\t}\n\n\tpublic setLineNumber(lineNumber: number): void {\n\t\tthis._lineNumber = lineNumber;\n\t\tthis._result = [];\n\t}\n\n\tpublic clearResult(): void {\n\t\tthis._result = [];\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\tpublic onResult(result: IHoverMessage[], isFromSynchronousComputation: boolean): void {\n\t\tthis._result = this._result.concat(result);\n\t}\n\n\tpublic getResult(): IHoverMessage[] {\n\t\treturn this._result;\n\t}\n\n\tpublic getResultWithLoadingMessage(): IHoverMessage[] {\n\t\treturn this.getResult();\n\t}\n}\n\nexport class ModesGlyphHoverWidget extends GlyphHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tprivate _messages: IHoverMessage[];\n\tprivate _lastLineNumber: number;\n\n\tprivate readonly _markdownRenderer: MarkdownRenderer;\n\tprivate readonly _computer: MarginComputer;\n\tprivate readonly _hoverOperation: HoverOperation<IHoverMessage[]>;\n\tprivate _renderDisposeables: IDisposable[];\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tmodeService: IModeService,\n\t\topenerService: IOpenerService | null = NullOpenerService,\n\t) {\n\t\tsuper(ModesGlyphHoverWidget.ID, editor);\n\n\t\tthis._lastLineNumber = -1;\n\n\t\tthis._markdownRenderer = new MarkdownRenderer(this._editor, modeService, openerService);\n\t\tthis._computer = new MarginComputer(this._editor);\n\n\t\tthis._hoverOperation = new HoverOperation(\n\t\t\tthis._computer,\n\t\t\t(result: IHoverMessage[]) => this._withResult(result),\n\t\t\tundefined,\n\t\t\t(result: any) => this._withResult(result),\n\t\t\t300\n\t\t);\n\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._renderDisposeables = dispose(this._renderDisposeables);\n\t\tthis._hoverOperation.cancel();\n\t\tsuper.dispose();\n\t}\n\n\tpublic 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._computer.clearResult();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed);\n\t\t}\n\t}\n\n\tpublic startShowingAt(lineNumber: number): void {\n\t\tif (this._lastLineNumber === 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._lastLineNumber = lineNumber;\n\t\tthis._computer.setLineNumber(lineNumber);\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._lastLineNumber = -1;\n\t\tthis._hoverOperation.cancel();\n\t\tsuper.hide();\n\t}\n\n\tpublic _withResult(result: IHoverMessage[]): void {\n\t\tthis._messages = result;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(this._lastLineNumber, 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\tdispose(this._renderDisposeables);\n\t\tthis._renderDisposeables = [];\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tmessages.forEach((msg) => {\n\t\t\tconst renderedContents = this._markdownRenderer.render(msg.value);\n\t\t\tthis._renderDisposeables.push(renderedContents);\n\t\t\tfragment.appendChild($('div.hover-row', undefined, renderedContents.element));\n\t\t});\n\n\t\tthis.updateContents(fragment);\n\t\tthis.showAt(lineNumber);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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';\n\nexport const IProgressService = createDecorator<IProgressService>('progressService');\n\nexport interface IProgressService {\n\t_serviceBrand: any;\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<any>, delay?: number): 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 * as Types from 'vs/base/common/types';\nimport * as Assert from 'vs/base/common/assert';\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 data: { [id: string]: any; };\n\n\tconstructor() {\n\t\tthis.data = {};\n\t}\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.hasOwnProperty(id), 'There is already an extension with this id');\n\n\t\tthis.data[id] = data;\n\t}\n\n\tpublic as(id: string): any {\n\t\treturn this.data[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 * as nls from 'vs/nls';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService';\nimport { Registry } from 'vs/platform/registry/common/platform';\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\tprivate _dynamicLanguages: 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\tthis._dynamicLanguages = [];\n\t}\n\n\t// --- languages\n\n\tpublic registerLanguage(def: ILanguageExtensionPoint): void {\n\t\tthis._languages.push(def);\n\t\tthis._onDidChangeLanguages.fire(undefined);\n\t}\n\tpublic getLanguages(): ILanguageExtensionPoint[] {\n\t\treturn (<ILanguageExtensionPoint[]>[]).concat(this._languages).concat(this._dynamicLanguages);\n\t}\n}\n\nexport const ModesRegistry = new EditorModesRegistry();\nRegistry.add(Extensions.ModesRegistry, ModesRegistry);\n\nexport const PLAINTEXT_MODE_ID = 'plaintext';\nexport const PLAINTEXT_LANGUAGE_IDENTIFIER = new LanguageIdentifier(PLAINTEXT_MODE_ID, LanguageId.PlainText);\n\nModesRegistry.registerLanguage({\n\tid: PLAINTEXT_MODE_ID,\n\textensions: ['.txt', '.gitignore'],\n\taliases: [nls.localize('plainText.alias', \"Plain Text\"), 'text'],\n\tmimetypes: ['text/plain']\n});\nLanguageConfigurationRegistry.register(PLAINTEXT_LANGUAGE_IDENTIFIER, {\n\tbrackets: [\n\t\t['(', ')'],\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 { Schemas } from 'vs/base/common/network';\nimport { DataUri, basenameOrAuthority } from 'vs/base/common/resources';\nimport { URI as uri } from 'vs/base/common/uri';\nimport { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { FileKind } from 'vs/platform/files/common/files';\n\nexport function getIconClasses(modelService: IModelService, modeService: IModeService, 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\tlet path: 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\tpath = name;\n\t\t} else {\n\t\t\tname = cssEscape(basenameOrAuthority(resource).toLowerCase());\n\t\t\tpath = resource.path.toLowerCase();\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\tconst dotSegments = name.split('.');\n\t\t\t\tfor (let i = 1; i < dotSegments.length; i++) {\n\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}\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// Configured Language\n\t\t\tlet configuredLangId: string | null = getConfiguredLangId(modelService, modeService, resource);\n\t\t\tconfiguredLangId = configuredLangId || (path ? modeService.getModeIdByFilepathOrFirstLine(path) : null);\n\t\t\tif (configuredLangId) {\n\t\t\t\tclasses.push(`${cssEscape(configuredLangId)}-lang-file-icon`);\n\t\t\t}\n\t\t}\n\t}\n\treturn classes;\n}\n\nexport function getConfiguredLangId(modelService: IModelService, modeService: IModeService, resource: uri): string | null {\n\tlet configuredLangId: string | null = null;\n\tif (resource) {\n\t\tlet modeId: string | null = null;\n\n\t\t// Data URI: check for encoded metadata\n\t\tif (resource.scheme === Schemas.data) {\n\t\t\tconst metadata = DataUri.parseMetaData(resource);\n\t\t\tconst mime = metadata.get(DataUri.META_DATA_MIME);\n\n\t\t\tif (mime) {\n\t\t\t\tmodeId = modeService.getModeId(mime);\n\t\t\t}\n\t\t}\n\n\t\t// Any other URI: check for model if existing\n\t\telse {\n\t\t\tconst model = modelService.getModel(resource);\n\t\t\tif (model) {\n\t\t\t\tmodeId = model.getLanguageIdentifier().language;\n\t\t\t}\n\t\t}\n\n\t\tif (modeId && modeId !== PLAINTEXT_MODE_ID) {\n\t\t\tconfiguredLangId = modeId; // only take if the mode is specific (aka no just plain text)\n\t\t}\n\t}\n\n\treturn configuredLangId;\n}\n\nexport function cssEscape(val: string): string {\n\treturn val.replace(/\\s/g, '\\\\$&'); // make sure to not introduce CSS classes from files that contain whitespace\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport * as platform from 'vs/platform/registry/common/platform';\nimport { Emitter } from 'vs/base/common/event';\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 * Copyright (c) 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 } from 'vs/base/common/event';\nimport { IJSONSchema } from 'vs/base/common/jsonSchema';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport * as types from 'vs/base/common/types';\nimport * as strings from 'vs/base/common/strings';\nimport { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';\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 * Returns all configurations settings of all configuration nodes contributed to this registry.\n\t */\n\tgetConfigurationProperties(): { [qualifiedKey: string]: IConfigurationPropertySchema };\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}\n\nexport interface IConfigurationPropertySchema extends IJSONSchema {\n\toverridable?: boolean;\n\tscope?: ConfigurationScope;\n\tincluded?: boolean;\n}\n\nexport interface IConfigurationNode {\n\tid?: string;\n\torder?: number;\n\ttype?: string | string[];\n\ttitle?: string;\n\tproperties?: { [path: string]: IConfigurationPropertySchema; };\n\tallOf?: IConfigurationNode[];\n\toverridable?: boolean;\n\tscope?: ConfigurationScope;\n}\n\nexport const allSettings: { properties: {}, patternProperties: {} } = { properties: {}, patternProperties: {} };\nexport const applicationSettings: { properties: {}, patternProperties: {} } = { properties: {}, patternProperties: {} };\nexport const machineSettings: { properties: {}, patternProperties: {} } = { properties: {}, patternProperties: {} };\nexport const windowSettings: { properties: {}, patternProperties: {} } = { properties: {}, patternProperties: {} };\nexport const resourceSettings: { properties: {}, patternProperties: {} } = { properties: {}, patternProperties: {} };\n\nexport const editorConfigurationSchemaId = 'vscode://schemas/settings/editor';\nconst contributionRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);\n\nclass ConfigurationRegistry implements IConfigurationRegistry {\n\n\tprivate readonly defaultOverridesConfigurationNode: IConfigurationNode;\n\tprivate readonly configurationContributors: IConfigurationNode[];\n\tprivate readonly configurationProperties: { [qualifiedKey: string]: IJSONSchema };\n\tprivate readonly excludedConfigurationProperties: { [qualifiedKey: string]: IJSONSchema };\n\tprivate readonly editorConfigurationSchema: IJSONSchema;\n\tprivate readonly overrideIdentifiers: string[] = [];\n\tprivate overridePropertyPattern: string;\n\n\tprivate readonly _onDidSchemaChange = new Emitter<void>();\n\n\tprivate readonly _onDidUpdateConfiguration: Emitter<string[]> = new Emitter<string[]>();\n\n\tconstructor() {\n\t\tthis.defaultOverridesConfigurationNode = {\n\t\t\tid: 'defaultOverrides',\n\t\t\ttitle: nls.localize('defaultConfigurations.title', \"Default Configuration Overrides\"),\n\t\t\tproperties: {}\n\t\t};\n\t\tthis.configurationContributors = [this.defaultOverridesConfigurationNode];\n\t\tthis.editorConfigurationSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting' };\n\t\tthis.configurationProperties = {};\n\t\tthis.excludedConfigurationProperties = {};\n\t\tthis.computeOverridePropertyPattern();\n\n\t\tcontributionRegistry.registerSchema(editorConfigurationSchemaId, this.editorConfigurationSchema);\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: string[] = [];\n\t\tconfigurations.forEach(configuration => {\n\t\t\tproperties.push(...this.validateAndRegisterProperties(configuration, validate)); // fills in defaults\n\t\t\tthis.configurationContributors.push(configuration);\n\t\t\tthis.registerJSONConfiguration(configuration);\n\t\t\tthis.updateSchemaForOverrideSettingsConfiguration(configuration);\n\t\t});\n\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire(properties);\n\t}\n\n\tpublic registerOverrideIdentifiers(overrideIdentifiers: string[]): void {\n\t\tthis.overrideIdentifiers.push(...overrideIdentifiers);\n\t\tthis.updateOverridePropertyPatternKey();\n\t}\n\n\tprivate validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, scope: ConfigurationScope = ConfigurationScope.WINDOW, overridable: boolean = false): string[] {\n\t\tscope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;\n\t\toverridable = configuration.overridable || overridable;\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\tlet message;\n\t\t\t\tif (validate && (message = validateProperty(key))) {\n\t\t\t\t\tconsole.warn(message);\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// fill in default values\n\t\t\t\tlet property = properties[key];\n\t\t\t\tlet defaultValue = property.default;\n\t\t\t\tif (types.isUndefined(defaultValue)) {\n\t\t\t\t\tproperty.default = getDefaultValue(property.type);\n\t\t\t\t}\n\t\t\t\t// Inherit overridable property from parent\n\t\t\t\tif (overridable) {\n\t\t\t\t\tproperty.overridable = true;\n\t\t\t\t}\n\n\t\t\t\tif (OVERRIDE_PROPERTY_PATTERN.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}\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\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, scope, overridable));\n\t\t\t}\n\t\t}\n\t\treturn propertyKeys;\n\t}\n\n\tgetConfigurationProperties(): { [qualifiedKey: string]: IConfigurationPropertySchema } {\n\t\treturn this.configurationProperties;\n\t}\n\n\tprivate registerJSONConfiguration(configuration: IConfigurationNode) {\n\t\tfunction 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\tallSettings.properties[key] = properties[key];\n\t\t\t\t\tswitch (properties[key].scope) {\n\t\t\t\t\t\tcase ConfigurationScope.APPLICATION:\n\t\t\t\t\t\t\tapplicationSettings.properties[key] = properties[key];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ConfigurationScope.MACHINE:\n\t\t\t\t\t\t\tmachineSettings.properties[key] = properties[key];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ConfigurationScope.WINDOW:\n\t\t\t\t\t\t\twindowSettings.properties[key] = properties[key];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ConfigurationScope.RESOURCE:\n\t\t\t\t\t\t\tresourceSettings.properties[key] = properties[key];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\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 updateSchemaForOverrideSettingsConfiguration(configuration: IConfigurationNode): void {\n\t\tif (configuration.id !== SETTINGS_OVERRRIDE_NODE_ID) {\n\t\t\tthis.update(configuration);\n\t\t\tcontributionRegistry.registerSchema(editorConfigurationSchemaId, this.editorConfigurationSchema);\n\t\t}\n\t}\n\n\tprivate updateOverridePropertyPatternKey(): void {\n\t\tlet patternProperties: IJSONSchema = allSettings.patternProperties[this.overridePropertyPattern];\n\t\tif (!patternProperties) {\n\t\t\tpatternProperties = {\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: 'Unknown Identifier. Use language identifiers',\n\t\t\t\t$ref: editorConfigurationSchemaId\n\t\t\t};\n\t\t}\n\n\t\tdelete allSettings.patternProperties[this.overridePropertyPattern];\n\t\tdelete applicationSettings.patternProperties[this.overridePropertyPattern];\n\t\tdelete machineSettings.patternProperties[this.overridePropertyPattern];\n\t\tdelete windowSettings.patternProperties[this.overridePropertyPattern];\n\t\tdelete resourceSettings.patternProperties[this.overridePropertyPattern];\n\n\t\tthis.computeOverridePropertyPattern();\n\n\t\tallSettings.patternProperties[this.overridePropertyPattern] = patternProperties;\n\t\tapplicationSettings.patternProperties[this.overridePropertyPattern] = patternProperties;\n\t\tmachineSettings.patternProperties[this.overridePropertyPattern] = patternProperties;\n\t\twindowSettings.patternProperties[this.overridePropertyPattern] = patternProperties;\n\t\tresourceSettings.patternProperties[this.overridePropertyPattern] = patternProperties;\n\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate update(configuration: IConfigurationNode): void {\n\t\tlet properties = configuration.properties;\n\t\tif (properties) {\n\t\t\tfor (let key in properties) {\n\t\t\t\tif (properties[key].overridable) {\n\t\t\t\t\tthis.editorConfigurationSchema.properties![key] = this.getConfigurationProperties()[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlet subNodes = configuration.allOf;\n\t\tif (subNodes) {\n\t\t\tsubNodes.forEach(subNode => this.update(subNode));\n\t\t}\n\t}\n\n\tprivate computeOverridePropertyPattern(): void {\n\t\tthis.overridePropertyPattern = this.overrideIdentifiers.length ? OVERRIDE_PATTERN_WITH_SUBSTITUTION.replace('${0}', this.overrideIdentifiers.map(identifier => strings.createRegExp(identifier, false).source).join('|')) : OVERRIDE_PROPERTY;\n\t}\n}\n\nconst SETTINGS_OVERRRIDE_NODE_ID = 'override';\nconst OVERRIDE_PROPERTY = '\\\\[.*\\\\]$';\nconst OVERRIDE_PATTERN_WITH_SUBSTITUTION = '\\\\[(${0})\\\\]$';\nexport const OVERRIDE_PROPERTY_PATTERN = new RegExp(OVERRIDE_PROPERTY);\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\n\nconst configurationRegistry = new ConfigurationRegistry();\nRegistry.add(Extensions.Configuration, configurationRegistry);\n\nexport function validateProperty(property: string): string | null {\n\tif (OVERRIDE_PROPERTY_PATTERN.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 * as nls from 'vs/nls';\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 * as editorOptions from 'vs/editor/common/config/editorOptions';\nimport { EditorZoom } from 'vs/editor/common/config/editorZoom';\nimport { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport EDITOR_DEFAULTS = editorOptions.EDITOR_DEFAULTS;\nimport EDITOR_FONT_DEFAULTS = editorOptions.EDITOR_FONT_DEFAULTS;\nimport EDITOR_MODEL_DEFAULTS = editorOptions.EDITOR_MODEL_DEFAULTS;\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\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 interface ITabFocus {\n\tonDidChangeTabFocus: Event<boolean>;\n\tgetTabFocusMode(): boolean;\n\tsetTabFocusMode(tabFocusMode: boolean): void;\n}\n\nexport const TabFocus: ITabFocus = new class implements ITabFocus {\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\nexport interface IEnvConfiguration {\n\textraEditorClassName: string;\n\touterWidth: number;\n\touterHeight: number;\n\temptySelectionClipboard: boolean;\n\tpixelRatio: number;\n\tzoomLevel: number;\n\taccessibilitySupport: AccessibilitySupport;\n}\n\nconst hasOwnProperty = Object.hasOwnProperty;\n\nexport abstract class CommonEditorConfiguration extends Disposable implements editorCommon.IConfiguration {\n\n\tpublic readonly isSimpleWidget: boolean;\n\tprotected _rawOptions: editorOptions.IEditorOptions;\n\tprotected _validatedOptions: editorOptions.IValidatedEditorOptions;\n\tpublic editor: editorOptions.InternalEditorOptions;\n\tprivate _isDominatedByLongLines: boolean;\n\tprivate _lineNumbersDigitCount: number;\n\n\tprivate _onDidChange = this._register(new Emitter<editorOptions.IConfigurationChangedEvent>());\n\tpublic readonly onDidChange: Event<editorOptions.IConfigurationChangedEvent> = this._onDidChange.event;\n\n\tconstructor(isSimpleWidget: boolean, options: editorOptions.IEditorOptions) {\n\t\tsuper();\n\n\t\tthis.isSimpleWidget = isSimpleWidget;\n\n\t\t// Do a \"deep clone of sorts\" on the incoming options\n\t\tthis._rawOptions = objects.mixin({}, options || {});\n\t\tthis._rawOptions.scrollbar = objects.mixin({}, this._rawOptions.scrollbar || {});\n\t\tthis._rawOptions.minimap = objects.mixin({}, this._rawOptions.minimap || {});\n\t\tthis._rawOptions.find = objects.mixin({}, this._rawOptions.find || {});\n\t\tthis._rawOptions.hover = objects.mixin({}, this._rawOptions.hover || {});\n\t\tthis._rawOptions.parameterHints = objects.mixin({}, this._rawOptions.parameterHints || {});\n\n\t\tthis._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);\n\t\tthis._isDominatedByLongLines = false;\n\t\tthis._lineNumbersDigitCount = 1;\n\n\t\tthis._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions()));\n\t\tthis._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions()));\n\t}\n\n\tpublic observeReferenceElement(dimension?: editorCommon.IDimension): void {\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprotected _recomputeOptions(): void {\n\t\tconst oldOptions = this.editor;\n\t\tconst newOptions = this._computeInternalOptions();\n\n\t\tif (oldOptions && oldOptions.equals(newOptions)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.editor = newOptions;\n\n\t\tif (oldOptions) {\n\t\t\tthis._onDidChange.fire(oldOptions.createChangeEvent(newOptions));\n\t\t}\n\t}\n\n\tpublic getRawOptions(): editorOptions.IEditorOptions {\n\t\treturn this._rawOptions;\n\t}\n\n\tprivate _computeInternalOptions(): editorOptions.InternalEditorOptions {\n\t\tconst opts = this._validatedOptions;\n\t\tconst partialEnv = this._getEnvConfiguration();\n\t\tconst bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel, this.isSimpleWidget);\n\t\tconst env: editorOptions.IEnvironmentalOptions = {\n\t\t\touterWidth: partialEnv.outerWidth,\n\t\t\touterHeight: partialEnv.outerHeight,\n\t\t\tfontInfo: this.readConfiguration(bareFontInfo),\n\t\t\textraEditorClassName: partialEnv.extraEditorClassName,\n\t\t\tisDominatedByLongLines: this._isDominatedByLongLines,\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 editorOptions.InternalEditorOptionsFactory.createInternalEditorOptions(env, opts);\n\t}\n\n\tprivate static _primitiveArrayEquals(a: any[], b: any[]): boolean {\n\t\tif (a.length !== b.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0; i < a.length; 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\tprivate static _subsetEquals(base: object, subset: object): boolean {\n\t\tfor (let key in subset) {\n\t\t\tif (hasOwnProperty.call(subset, key)) {\n\t\t\t\tconst subsetValue = subset[key];\n\t\t\t\tconst baseValue = base[key];\n\n\t\t\t\tif (baseValue === subsetValue) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(baseValue) && Array.isArray(subsetValue)) {\n\t\t\t\t\tif (!this._primitiveArrayEquals(baseValue, subsetValue)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (typeof baseValue === 'object' && typeof subsetValue === 'object') {\n\t\t\t\t\tif (!this._subsetEquals(baseValue, subsetValue)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic updateOptions(newOptions: editorOptions.IEditorOptions): void {\n\t\tif (typeof newOptions === 'undefined') {\n\t\t\treturn;\n\t\t}\n\t\tif (CommonEditorConfiguration._subsetEquals(this._rawOptions, newOptions)) {\n\t\t\treturn;\n\t\t}\n\t\tthis._rawOptions = objects.mixin(this._rawOptions, newOptions || {});\n\t\tthis._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {\n\t\tthis._isDominatedByLongLines = isDominatedByLongLines;\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic setMaxLineNumber(maxLineNumber: number): void {\n\t\tlet digitCount = CommonEditorConfiguration._digitCount(maxLineNumber);\n\t\tif (this._lineNumbersDigitCount === digitCount) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lineNumbersDigitCount = digitCount;\n\t\tthis._recomputeOptions();\n\t}\n\n\tprivate static _digitCount(n: number): number {\n\t\tlet r = 0;\n\t\twhile (n) {\n\t\t\tn = Math.floor(n / 10);\n\t\t\tr++;\n\t\t}\n\t\treturn r ? r : 1;\n\t}\n\tprotected abstract _getEnvConfiguration(): IEnvConfiguration;\n\n\tprotected abstract readConfiguration(styling: BareFontInfo): FontInfo;\n\n}\n\nconst configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);\nconst editorConfiguration: IConfigurationNode = {\n\t'id': 'editor',\n\t'order': 5,\n\t'type': 'object',\n\t'title': nls.localize('editorConfigurationTitle', \"Editor\"),\n\t'overridable': true,\n\t'scope': ConfigurationScope.RESOURCE,\n\t'properties': {\n\t\t'editor.fontFamily': {\n\t\t\t'type': 'string',\n\t\t\t'default': EDITOR_FONT_DEFAULTS.fontFamily,\n\t\t\t'description': nls.localize('fontFamily', \"Controls the font family.\")\n\t\t},\n\t\t'editor.fontWeight': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],\n\t\t\t'default': EDITOR_FONT_DEFAULTS.fontWeight,\n\t\t\t'description': nls.localize('fontWeight', \"Controls the font weight.\")\n\t\t},\n\t\t'editor.fontSize': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_FONT_DEFAULTS.fontSize,\n\t\t\t'description': nls.localize('fontSize', \"Controls the font size in pixels.\")\n\t\t},\n\t\t'editor.lineHeight': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_FONT_DEFAULTS.lineHeight,\n\t\t\t'description': nls.localize('lineHeight', \"Controls the line height. Use 0 to compute the line height from the font size.\")\n\t\t},\n\t\t'editor.letterSpacing': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_FONT_DEFAULTS.letterSpacing,\n\t\t\t'description': nls.localize('letterSpacing', \"Controls the letter spacing in pixels.\")\n\t\t},\n\t\t'editor.lineNumbers': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['off', 'on', 'relative', 'interval'],\n\t\t\t'enumDescriptions': [\n\t\t\t\tnls.localize('lineNumbers.off', \"Line numbers are not rendered.\"),\n\t\t\t\tnls.localize('lineNumbers.on', \"Line numbers are rendered as absolute number.\"),\n\t\t\t\tnls.localize('lineNumbers.relative', \"Line numbers are rendered as distance in lines to cursor position.\"),\n\t\t\t\tnls.localize('lineNumbers.interval', \"Line numbers are rendered every 10 lines.\")\n\t\t\t],\n\t\t\t'default': 'on',\n\t\t\t'description': nls.localize('lineNumbers', \"Controls the display of line numbers.\")\n\t\t},\n\t\t'editor.renderFinalNewline': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.renderFinalNewline,\n\t\t\t'description': nls.localize('renderFinalNewline', \"Render last line number when the file ends with a newline.\")\n\t\t},\n\t\t'editor.rulers': {\n\t\t\t'type': 'array',\n\t\t\t'items': {\n\t\t\t\t'type': 'number'\n\t\t\t},\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.rulers,\n\t\t\t'description': 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},\n\t\t'editor.wordSeparators': {\n\t\t\t'type': 'string',\n\t\t\t'default': EDITOR_DEFAULTS.wordSeparators,\n\t\t\t'description': nls.localize('wordSeparators', \"Characters that will be used as word separators when doing word related navigations or operations.\")\n\t\t},\n\t\t'editor.tabSize': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_MODEL_DEFAULTS.tabSize,\n\t\t\t'minimum': 1,\n\t\t\t'markdownDescription': 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\t'type': 'string',\n\t\t// \t\t\t'enum': ['tabSize']\n\t\t// \t\t},\n\t\t// \t\t{\n\t\t// \t\t\t'type': 'number',\n\t\t// \t\t\t'minimum': 1\n\t\t// \t\t}\n\t\t// \t],\n\t\t// \t'default': 'tabSize',\n\t\t// \t'markdownDescription': 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\t'type': 'boolean',\n\t\t\t'default': EDITOR_MODEL_DEFAULTS.insertSpaces,\n\t\t\t'markdownDescription': 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\t'type': 'boolean',\n\t\t\t'default': EDITOR_MODEL_DEFAULTS.detectIndentation,\n\t\t\t'markdownDescription': 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.roundedSelection': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.roundedSelection,\n\t\t\t'description': nls.localize('roundedSelection', \"Controls whether selections should have rounded corners.\")\n\t\t},\n\t\t'editor.scrollBeyondLastLine': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine,\n\t\t\t'description': nls.localize('scrollBeyondLastLine', \"Controls whether the editor will scroll beyond the last line.\")\n\t\t},\n\t\t'editor.scrollBeyondLastColumn': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastColumn,\n\t\t\t'description': nls.localize('scrollBeyondLastColumn', \"Controls the number of extra characters beyond which the editor will scroll horizontally.\")\n\t\t},\n\t\t'editor.smoothScrolling': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.smoothScrolling,\n\t\t\t'description': nls.localize('smoothScrolling', \"Controls whether the editor will scroll using an animation.\")\n\t\t},\n\t\t'editor.minimap.enabled': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.minimap.enabled,\n\t\t\t'description': nls.localize('minimap.enabled', \"Controls whether the minimap is shown.\")\n\t\t},\n\t\t'editor.minimap.side': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['left', 'right'],\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.minimap.side,\n\t\t\t'description': nls.localize('minimap.side', \"Controls the side where to render the minimap.\")\n\t\t},\n\t\t'editor.minimap.showSlider': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['always', 'mouseover'],\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.minimap.showSlider,\n\t\t\t'description': nls.localize('minimap.showSlider', \"Controls whether the minimap slider is automatically hidden.\")\n\t\t},\n\t\t'editor.minimap.renderCharacters': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters,\n\t\t\t'description': nls.localize('minimap.renderCharacters', \"Render the actual characters on a line as opposed to color blocks.\")\n\t\t},\n\t\t'editor.minimap.maxColumn': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.minimap.maxColumn,\n\t\t\t'description': nls.localize('minimap.maxColumn', \"Limit the width of the minimap to render at most a certain number of columns.\")\n\t\t},\n\t\t'editor.hover.enabled': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.hover.enabled,\n\t\t\t'description': nls.localize('hover.enabled', \"Controls whether the hover is shown.\")\n\t\t},\n\t\t'editor.hover.delay': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.hover.delay,\n\t\t\t'description': nls.localize('hover.delay', \"Controls the delay in milliseconds after which the hover is shown.\")\n\t\t},\n\t\t'editor.hover.sticky': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.hover.sticky,\n\t\t\t'description': nls.localize('hover.sticky', \"Controls whether the hover should remain visible when mouse is moved over it.\")\n\t\t},\n\t\t'editor.find.seedSearchStringFromSelection': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,\n\t\t\t'description': nls.localize('find.seedSearchStringFromSelection', \"Controls whether the search string in the Find Widget is seeded from the editor selection.\")\n\t\t},\n\t\t'editor.find.autoFindInSelection': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,\n\t\t\t'description': nls.localize('find.autoFindInSelection', \"Controls whether the find operation is carried out on selected text or the entire file in the editor.\")\n\t\t},\n\t\t'editor.find.globalFindClipboard': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.find.globalFindClipboard,\n\t\t\t'description': nls.localize('find.globalFindClipboard', \"Controls whether the Find Widget should read or modify the shared find clipboard on macOS.\"),\n\t\t\t'included': platform.isMacintosh\n\t\t},\n\t\t'editor.find.addExtraSpaceOnTop': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': true,\n\t\t\t'description': 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},\n\t\t'editor.wordWrap': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['off', 'on', 'wordWrapColumn', 'bounded'],\n\t\t\t'markdownEnumDescriptions': [\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\t'default': EDITOR_DEFAULTS.wordWrap,\n\t\t\t'description': 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\t'editor.wordWrapColumn': {\n\t\t\t'type': 'integer',\n\t\t\t'default': EDITOR_DEFAULTS.wordWrapColumn,\n\t\t\t'minimum': 1,\n\t\t\t'markdownDescription': 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\t'editor.wrappingIndent': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['none', 'same', 'indent', 'deepIndent'],\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\t'default': 'same',\n\t\t\t'description': nls.localize('wrappingIndent', \"Controls the indentation of wrapped lines.\"),\n\t\t},\n\t\t'editor.mouseWheelScrollSensitivity': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity,\n\t\t\t'markdownDescription': nls.localize('mouseWheelScrollSensitivity', \"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.\")\n\t\t},\n\t\t'editor.fastScrollSensitivity': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.scrollbar.fastScrollSensitivity,\n\t\t\t'markdownDescription': nls.localize('fastScrollSensitivity', \"Scrolling speed mulitiplier when pressing `Alt`.\")\n\t\t},\n\t\t'editor.multiCursorModifier': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['ctrlCmd', 'alt'],\n\t\t\t'markdownEnumDescriptions': [\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\t'default': 'alt',\n\t\t\t'markdownDescription': 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\t'editor.multiCursorMergeOverlapping': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.multiCursorMergeOverlapping,\n\t\t\t'description': nls.localize('multiCursorMergeOverlapping', \"Merge multiple cursors when they are overlapping.\")\n\t\t},\n\t\t'editor.quickSuggestions': {\n\t\t\t'anyOf': [\n\t\t\t\t{\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tstrings: {\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\tdescription: nls.localize('quickSuggestions.strings', \"Enable quick suggestions inside strings.\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcomments: {\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\tdescription: nls.localize('quickSuggestions.comments', \"Enable quick suggestions inside comments.\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tother: {\n\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\tdefault: true,\n\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},\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.quickSuggestions,\n\t\t\t'description': nls.localize('quickSuggestions', \"Controls whether suggestions should automatically show up while typing.\")\n\t\t},\n\t\t'editor.quickSuggestionsDelay': {\n\t\t\t'type': 'integer',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,\n\t\t\t'minimum': 0,\n\t\t\t'description': nls.localize('quickSuggestionsDelay', \"Controls the delay in milliseconds after which quick suggestions will show up.\")\n\t\t},\n\t\t'editor.parameterHints.enabled': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.parameterHints.enabled,\n\t\t\t'description': nls.localize('parameterHints.enabled', \"Enables a pop-up that shows parameter documentation and type information as you type.\")\n\t\t},\n\t\t'editor.parameterHints.cycle': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.parameterHints.cycle,\n\t\t\t'description': nls.localize('parameterHints.cycle', \"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.\")\n\t\t},\n\t\t'editor.autoClosingBrackets': {\n\t\t\ttype: 'string',\n\t\t\tenum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],\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\n\t\t\t],\n\t\t\t'default': EDITOR_DEFAULTS.autoClosingBrackets,\n\t\t\t'description': nls.localize('autoClosingBrackets', \"Controls whether the editor should automatically close brackets after the user adds an opening bracket.\")\n\t\t},\n\t\t'editor.autoClosingQuotes': {\n\t\t\ttype: 'string',\n\t\t\tenum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],\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\t'default': EDITOR_DEFAULTS.autoClosingQuotes,\n\t\t\t'description': nls.localize('autoClosingQuotes', \"Controls whether the editor should automatically close quotes after the user adds an opening quote.\")\n\t\t},\n\t\t'editor.autoSurround': {\n\t\t\ttype: 'string',\n\t\t\tenum: ['languageDefined', 'brackets', 'quotes', 'never'],\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.brackets', \"Surround with brackets but not quotes.\"),\n\t\t\t\tnls.localize('editor.autoSurround.quotes', \"Surround with quotes but not brackets.\"),\n\t\t\t\t''\n\t\t\t],\n\t\t\t'default': EDITOR_DEFAULTS.autoSurround,\n\t\t\t'description': nls.localize('autoSurround', \"Controls whether the editor should automatically surround selections.\")\n\t\t},\n\t\t'editor.formatOnType': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.formatOnType,\n\t\t\t'description': nls.localize('formatOnType', \"Controls whether the editor should automatically format the line after typing.\")\n\t\t},\n\t\t'editor.formatOnPaste': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste,\n\t\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\t},\n\t\t'editor.autoIndent': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.autoIndent,\n\t\t\t'description': nls.localize('autoIndent', \"Controls whether the editor should automatically adjust the indentation when users type, paste or move lines. Extensions with indentation rules of the language must be available.\")\n\t\t},\n\t\t'editor.suggestOnTriggerCharacters': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,\n\t\t\t'description': nls.localize('suggestOnTriggerCharacters', \"Controls whether suggestions should automatically show up when typing trigger characters.\")\n\t\t},\n\t\t'editor.acceptSuggestionOnEnter': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['on', 'smart', 'off'],\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,\n\t\t\t'markdownEnumDescriptions': [\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\t'markdownDescription': 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\t'editor.acceptSuggestionOnCommitCharacter': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,\n\t\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\t},\n\t\t'editor.snippetSuggestions': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['top', 'bottom', 'inline', 'none'],\n\t\t\t'enumDescriptions': [\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\t'default': EDITOR_DEFAULTS.contribInfo.suggest.snippets,\n\t\t\t'description': nls.localize('snippetSuggestions', \"Controls whether snippets are shown with other suggestions and how they are sorted.\")\n\t\t},\n\t\t'editor.emptySelectionClipboard': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.emptySelectionClipboard,\n\t\t\t'description': nls.localize('emptySelectionClipboard', \"Controls whether copying without a selection copies the current line.\")\n\t\t},\n\t\t'editor.copyWithSyntaxHighlighting': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.copyWithSyntaxHighlighting,\n\t\t\t'description': nls.localize('copyWithSyntaxHighlighting', \"Controls whether syntax highlighting should be copied into the clipboard.\")\n\t\t},\n\t\t'editor.wordBasedSuggestions': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,\n\t\t\t'description': nls.localize('wordBasedSuggestions', \"Controls whether completions should be computed based on words in the document.\")\n\t\t},\n\t\t'editor.suggestSelection': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['first', 'recentlyUsed', 'recentlyUsedByPrefix'],\n\t\t\t'markdownEnumDescriptions': [\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\t'default': 'recentlyUsed',\n\t\t\t'description': nls.localize('suggestSelection', \"Controls how suggestions are pre-selected when showing the suggest list.\")\n\t\t},\n\t\t'editor.suggestFontSize': {\n\t\t\t'type': 'integer',\n\t\t\t'default': 0,\n\t\t\t'minimum': 0,\n\t\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\t},\n\t\t'editor.suggestLineHeight': {\n\t\t\t'type': 'integer',\n\t\t\t'default': 0,\n\t\t\t'minimum': 0,\n\t\t\t'markdownDescription': nls.localize('suggestLineHeight', \"Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.\")\n\t\t},\n\t\t'editor.tabCompletion': {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'off',\n\t\t\tenum: ['on', 'off', 'onlySnippets'],\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\t'editor.suggest.filterGraceful': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription: nls.localize('suggest.filterGraceful', \"Controls whether filtering and sorting suggestions accounts for small typos.\")\n\t\t},\n\t\t'editor.suggest.localityBonus': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription: nls.localize('suggest.localityBonus', \"Controls whether sorting favours words that appear close to the cursor.\")\n\t\t},\n\t\t'editor.suggest.shareSuggestSelections': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\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},\n\t\t'editor.suggest.snippetsPreventQuickSuggestions': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription: nls.localize('suggest.snippetsPreventQuickSuggestions', \"Control whether an active snippet prevents quick suggestions.\")\n\t\t},\n\t\t'editor.suggest.showIcons': {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: EDITOR_DEFAULTS.contribInfo.suggest.showIcons,\n\t\t\tdescription: nls.localize('suggest.showIcons', \"Controls whether to show or hide icons in suggestions.\")\n\t\t},\n\t\t'editor.suggest.maxVisibleSuggestions': {\n\t\t\ttype: 'number',\n\t\t\tdefault: EDITOR_DEFAULTS.contribInfo.suggest.maxVisibleSuggestions,\n\t\t\tminimum: 1,\n\t\t\tmaximum: 15,\n\t\t\tdescription: nls.localize('suggest.maxVisibleSuggestions', \"Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).\")\n\t\t},\n\t\t'editor.suggest.filteredTypes': {\n\t\t\ttype: 'object',\n\t\t\tdefault: { keyword: true },\n\t\t\tmarkdownDescription: nls.localize('suggest.filtered', \"Controls whether some suggestion types should be filtered from IntelliSense. A list of suggestion types can be found here: https://code.visualstudio.com/docs/editor/intellisense#_types-of-completions.\"),\n\t\t\tproperties: {\n\t\t\t\tmethod: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.method', \"When set to `false` IntelliSense never shows `method` suggestions.\")\n\t\t\t\t},\n\t\t\t\tfunction: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.function', \"When set to `false` IntelliSense never shows `function` suggestions.\")\n\t\t\t\t},\n\t\t\t\tconstructor: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.constructor', \"When set to `false` IntelliSense never shows `constructor` suggestions.\")\n\t\t\t\t},\n\t\t\t\tfield: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.field', \"When set to `false` IntelliSense never shows `field` suggestions.\")\n\t\t\t\t},\n\t\t\t\tvariable: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.variable', \"When set to `false` IntelliSense never shows `variable` suggestions.\")\n\t\t\t\t},\n\t\t\t\tclass: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.class', \"When set to `false` IntelliSense never shows `class` suggestions.\")\n\t\t\t\t},\n\t\t\t\tstruct: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.struct', \"When set to `false` IntelliSense never shows `struct` suggestions.\")\n\t\t\t\t},\n\t\t\t\tinterface: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.interface', \"When set to `false` IntelliSense never shows `interface` suggestions.\")\n\t\t\t\t},\n\t\t\t\tmodule: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.module', \"When set to `false` IntelliSense never shows `module` suggestions.\")\n\t\t\t\t},\n\t\t\t\tproperty: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.property', \"When set to `false` IntelliSense never shows `property` suggestions.\")\n\t\t\t\t},\n\t\t\t\tevent: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.event', \"When set to `false` IntelliSense never shows `event` suggestions.\")\n\t\t\t\t},\n\t\t\t\toperator: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.operator', \"When set to `false` IntelliSense never shows `operator` suggestions.\")\n\t\t\t\t},\n\t\t\t\tunit: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.unit', \"When set to `false` IntelliSense never shows `unit` suggestions.\")\n\t\t\t\t},\n\t\t\t\tvalue: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.value', \"When set to `false` IntelliSense never shows `value` suggestions.\")\n\t\t\t\t},\n\t\t\t\tconstant: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.constant', \"When set to `false` IntelliSense never shows `constant` suggestions.\")\n\t\t\t\t},\n\t\t\t\tenum: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.enum', \"When set to `false` IntelliSense never shows `enum` suggestions.\")\n\t\t\t\t},\n\t\t\t\tenumMember: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.enumMember', \"When set to `false` IntelliSense never shows `enumMember` suggestions.\")\n\t\t\t\t},\n\t\t\t\tkeyword: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.keyword', \"When set to `false` IntelliSense never shows `keyword` suggestions.\")\n\t\t\t\t},\n\t\t\t\ttext: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.text', \"When set to `false` IntelliSense never shows `text` suggestions.\")\n\t\t\t\t},\n\t\t\t\tcolor: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.color', \"When set to `false` IntelliSense never shows `color` suggestions.\")\n\t\t\t\t},\n\t\t\t\tfile: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.file', \"When set to `false` IntelliSense never shows `file` suggestions.\")\n\t\t\t\t},\n\t\t\t\treference: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.reference', \"When set to `false` IntelliSense never shows `reference` suggestions.\")\n\t\t\t\t},\n\t\t\t\tcustomcolor: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.customcolor', \"When set to `false` IntelliSense never shows `customcolor` suggestions.\")\n\t\t\t\t},\n\t\t\t\tfolder: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.folder', \"When set to `false` IntelliSense never shows `folder` suggestions.\")\n\t\t\t\t},\n\t\t\t\ttypeParameter: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.typeParameter', \"When set to `false` IntelliSense never shows `typeParameter` suggestions.\")\n\t\t\t\t},\n\t\t\t\tsnippet: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tmarkdownDescription: nls.localize('suggest.filtered.snippet', \"When set to `false` IntelliSense never shows `snippet` suggestions.\")\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t\t'editor.gotoLocation.multiple': {\n\t\t\tdescription: nls.localize('editor.gotoLocation.multiple', \"Controls the behavior of 'Go To' commands, like Go To Definition, when multiple target locations exist.\"),\n\t\t\ttype: 'string',\n\t\t\tenum: ['peek', 'gotoAndPeek', 'goto'],\n\t\t\tdefault: EDITOR_DEFAULTS.contribInfo.gotoLocation.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 ignore others')\n\t\t\t]\n\t\t},\n\t\t'editor.selectionHighlight': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.selectionHighlight,\n\t\t\t'description': nls.localize('selectionHighlight', \"Controls whether the editor should highlight matches similar to the selection.\")\n\t\t},\n\t\t'editor.occurrencesHighlight': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,\n\t\t\t'description': nls.localize('occurrencesHighlight', \"Controls whether the editor should highlight semantic symbol occurrences.\")\n\t\t},\n\t\t'editor.overviewRulerLanes': {\n\t\t\t'type': 'integer',\n\t\t\t'default': 3,\n\t\t\t'description': nls.localize('overviewRulerLanes', \"Controls the number of decorations that can show up at the same position in the overview ruler.\")\n\t\t},\n\t\t'editor.overviewRulerBorder': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.overviewRulerBorder,\n\t\t\t'description': nls.localize('overviewRulerBorder', \"Controls whether a border should be drawn around the overview ruler.\")\n\t\t},\n\t\t'editor.cursorBlinking': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['blink', 'smooth', 'phase', 'expand', 'solid'],\n\t\t\t'default': editorOptions.blinkingStyleToString(EDITOR_DEFAULTS.viewInfo.cursorBlinking),\n\t\t\t'description': nls.localize('cursorBlinking', \"Control the cursor animation style.\")\n\t\t},\n\t\t'editor.mouseWheelZoom': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.mouseWheelZoom,\n\t\t\t'markdownDescription': nls.localize('mouseWheelZoom', \"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.\")\n\t\t},\n\t\t'editor.cursorSmoothCaretAnimation': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.cursorSmoothCaretAnimation,\n\t\t\t'description': nls.localize('cursorSmoothCaretAnimation', \"Controls whether the smooth caret animation should be enabled.\")\n\t\t},\n\t\t'editor.cursorStyle': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['block', 'block-outline', 'line', 'line-thin', 'underline', 'underline-thin'],\n\t\t\t'default': editorOptions.cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle),\n\t\t\t'description': nls.localize('cursorStyle', \"Controls the cursor style.\")\n\t\t},\n\t\t'editor.cursorWidth': {\n\t\t\t'type': 'integer',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.cursorWidth,\n\t\t\t'markdownDescription': nls.localize('cursorWidth', \"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.\")\n\t\t},\n\t\t'editor.fontLigatures': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.fontLigatures,\n\t\t\t'description': nls.localize('fontLigatures', \"Enables/Disables font ligatures.\")\n\t\t},\n\t\t'editor.hideCursorInOverviewRuler': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler,\n\t\t\t'description': nls.localize('hideCursorInOverviewRuler', \"Controls whether the cursor should be hidden in the overview ruler.\")\n\t\t},\n\t\t'editor.renderWhitespace': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['none', 'boundary', 'all'],\n\t\t\t'enumDescriptions': [\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\t''\n\t\t\t],\n\t\t\tdefault: EDITOR_DEFAULTS.viewInfo.renderWhitespace,\n\t\t\tdescription: nls.localize('renderWhitespace', \"Controls how the editor should render whitespace characters.\")\n\t\t},\n\t\t'editor.renderControlCharacters': {\n\t\t\t'type': 'boolean',\n\t\t\tdefault: EDITOR_DEFAULTS.viewInfo.renderControlCharacters,\n\t\t\tdescription: nls.localize('renderControlCharacters', \"Controls whether the editor should render control characters.\")\n\t\t},\n\t\t'editor.renderIndentGuides': {\n\t\t\t'type': 'boolean',\n\t\t\tdefault: EDITOR_DEFAULTS.viewInfo.renderIndentGuides,\n\t\t\tdescription: nls.localize('renderIndentGuides', \"Controls whether the editor should render indent guides.\")\n\t\t},\n\t\t'editor.highlightActiveIndentGuide': {\n\t\t\t'type': 'boolean',\n\t\t\tdefault: EDITOR_DEFAULTS.viewInfo.highlightActiveIndentGuide,\n\t\t\tdescription: nls.localize('highlightActiveIndentGuide', \"Controls whether the editor should highlight the active indent guide.\")\n\t\t},\n\t\t'editor.renderLineHighlight': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['none', 'gutter', 'line', 'all'],\n\t\t\t'enumDescriptions': [\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\tdefault: EDITOR_DEFAULTS.viewInfo.renderLineHighlight,\n\t\t\tdescription: nls.localize('renderLineHighlight', \"Controls how the editor should render the current line highlight.\")\n\t\t},\n\t\t'editor.codeLens': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.codeLens,\n\t\t\t'description': nls.localize('codeLens', \"Controls whether the editor shows CodeLens.\")\n\t\t},\n\t\t'editor.folding': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.folding,\n\t\t\t'description': nls.localize('folding', \"Controls whether the editor has code folding enabled.\")\n\t\t},\n\t\t'editor.foldingStrategy': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['auto', 'indentation'],\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.foldingStrategy,\n\t\t\t'markdownDescription': nls.localize('foldingStrategy', \"Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.\")\n\t\t},\n\t\t'editor.showFoldingControls': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['always', 'mouseover'],\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.showFoldingControls,\n\t\t\t'description': nls.localize('showFoldingControls', \"Controls whether the fold controls on the gutter are automatically hidden.\")\n\t\t},\n\t\t'editor.matchBrackets': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.matchBrackets,\n\t\t\t'description': nls.localize('matchBrackets', \"Highlight matching brackets when one of them is selected.\")\n\t\t},\n\t\t'editor.glyphMargin': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.viewInfo.glyphMargin,\n\t\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\t},\n\t\t'editor.useTabStops': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.useTabStops,\n\t\t\t'description': nls.localize('useTabStops', \"Inserting and deleting whitespace follows tab stops.\")\n\t\t},\n\t\t'editor.trimAutoWhitespace': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,\n\t\t\t'description': nls.localize('trimAutoWhitespace', \"Remove trailing auto inserted whitespace.\")\n\t\t},\n\t\t'editor.stablePeek': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': false,\n\t\t\t'markdownDescription': nls.localize('stablePeek', \"Keep peek editors open even when double clicking their content or when hitting `Escape`.\")\n\t\t},\n\t\t'editor.dragAndDrop': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.dragAndDrop,\n\t\t\t'description': nls.localize('dragAndDrop', \"Controls whether the editor should allow moving selections via drag and drop.\")\n\t\t},\n\t\t'editor.accessibilitySupport': {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['auto', 'on', 'off'],\n\t\t\t'enumDescriptions': [\n\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\tnls.localize('accessibilitySupport.on', \"The editor will be permanently optimized for usage with a Screen Reader.\"),\n\t\t\t\tnls.localize('accessibilitySupport.off', \"The editor will never be optimized for usage with a Screen Reader.\"),\n\t\t\t],\n\t\t\t'default': EDITOR_DEFAULTS.accessibilitySupport,\n\t\t\t'description': nls.localize('accessibilitySupport', \"Controls whether the editor should run in a mode where it is optimized for screen readers.\")\n\t\t},\n\t\t'editor.showUnused': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.showUnused,\n\t\t\t'description': nls.localize('showUnused', \"Controls fading out of unused code.\")\n\t\t},\n\t\t'editor.links': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.links,\n\t\t\t'description': nls.localize('links', \"Controls whether the editor should detect links and make them clickable.\")\n\t\t},\n\t\t'editor.colorDecorators': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.colorDecorators,\n\t\t\t'description': nls.localize('colorDecorators', \"Controls whether the editor should render the inline color decorators and color picker.\")\n\t\t},\n\t\t'editor.lightbulb.enabled': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,\n\t\t\t'description': nls.localize('codeActions', \"Enables the code action lightbulb in the editor.\")\n\t\t},\n\t\t'editor.maxTokenizationLineLength': {\n\t\t\t'type': 'integer',\n\t\t\t'default': 20_000,\n\t\t\t'description': nls.localize('maxTokenizationLineLength', \"Lines above this length will not be tokenized for performance reasons\")\n\t\t},\n\t\t'editor.codeActionsOnSave': {\n\t\t\t'type': 'object',\n\t\t\t'properties': {\n\t\t\t\t'source.organizeImports': {\n\t\t\t\t\t'type': 'boolean',\n\t\t\t\t\t'description': nls.localize('codeActionsOnSave.organizeImports', \"Controls whether organize imports action should be run on file save.\")\n\t\t\t\t},\n\t\t\t\t'source.fixAll': {\n\t\t\t\t\t'type': 'boolean',\n\t\t\t\t\t'description': nls.localize('codeActionsOnSave.fixAll', \"Controls whether auto fix action should be run on file save.\")\n\t\t\t\t}\n\t\t\t},\n\t\t\t'additionalProperties': {\n\t\t\t\t'type': 'boolean'\n\t\t\t},\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSave,\n\t\t\t'description': nls.localize('codeActionsOnSave', \"Code action kinds to be run on save.\")\n\t\t},\n\t\t'editor.codeActionsOnSaveTimeout': {\n\t\t\t'type': 'number',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSaveTimeout,\n\t\t\t'description': nls.localize('codeActionsOnSaveTimeout', \"Timeout in milliseconds after which the code actions that are run on save are cancelled.\")\n\t\t},\n\t\t'editor.selectionClipboard': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_DEFAULTS.contribInfo.selectionClipboard,\n\t\t\t'description': nls.localize('selectionClipboard', \"Controls whether the Linux primary clipboard should be supported.\"),\n\t\t\t'included': platform.isLinux\n\t\t},\n\t\t'diffEditor.renderSideBySide': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': true,\n\t\t\t'description': 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\t'type': 'boolean',\n\t\t\t'default': true,\n\t\t\t'description': nls.localize('ignoreTrimWhitespace', \"Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.\")\n\t\t},\n\t\t'editor.largeFileOptimizations': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': EDITOR_MODEL_DEFAULTS.largeFileOptimizations,\n\t\t\t'description': nls.localize('largeFileOptimizations', \"Special handling for large files to disable certain memory intensive features.\")\n\t\t},\n\t\t'diffEditor.renderIndicators': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': true,\n\t\t\t'description': nls.localize('renderIndicators', \"Controls whether the diff editor shows +/- indicators for added/removed changes.\")\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}\nexport function isDiffEditorConfigurationKey(key: string): boolean {\n\tconst editorConfigurationKeys = getEditorConfigurationKeys();\n\treturn (editorConfigurationKeys[`diffEditor.${key}`] || false);\n}\n\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 browser from 'vs/base/browser/browser';\nimport { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { CharWidthRequest, CharWidthRequestType, readCharWidths } from 'vs/editor/browser/config/charWidthReader';\nimport { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver';\nimport { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig';\nimport { IEditorOptions } from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { IDimension } from 'vs/editor/common/editorCommon';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\n\nclass CSSBasedConfigurationCache {\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 function clearAllFontInfos(): void {\n\tCSSBasedConfiguration.INSTANCE.clearCache();\n}\n\nclass CSSBasedConfiguration extends Disposable {\n\n\tpublic static readonly INSTANCE = new CSSBasedConfiguration();\n\n\tprivate _cache: CSSBasedConfigurationCache;\n\tprivate _evictUntrustedReadingsTimeout: any;\n\n\tprivate _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 CSSBasedConfigurationCache();\n\t\tthis._evictUntrustedReadingsTimeout = -1;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._evictUntrustedReadingsTimeout !== -1) {\n\t\t\tclearTimeout(this._evictUntrustedReadingsTimeout);\n\t\t\tthis._evictUntrustedReadingsTimeout = -1;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\tpublic clearCache(): void {\n\t\tthis._cache = new CSSBasedConfigurationCache();\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 = 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 (let i = 0, len = values.length; i < len; i++) {\n\t\t\tconst item = values[i];\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\tpublic readConfiguration(bareFontInfo: BareFontInfo): FontInfo {\n\t\tif (!this._cache.has(bareFontInfo)) {\n\t\t\tlet readConfig = CSSBasedConfiguration._actualReadConfiguration(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\tzoomLevel: browser.getZoomLevel(),\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\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\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 static 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 static _actualReadConfiguration(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\tthis.createRequest('·', CharWidthRequestType.Regular, all, monospace);\n\n\t\t// monospace test: some characters\n\t\tthis.createRequest('|', CharWidthRequestType.Regular, all, monospace);\n\t\tthis.createRequest('/', CharWidthRequestType.Regular, all, monospace);\n\t\tthis.createRequest('-', CharWidthRequestType.Regular, all, monospace);\n\t\tthis.createRequest('_', CharWidthRequestType.Regular, all, monospace);\n\t\tthis.createRequest('i', CharWidthRequestType.Regular, all, monospace);\n\t\tthis.createRequest('l', CharWidthRequestType.Regular, all, monospace);\n\t\tthis.createRequest('m', CharWidthRequestType.Regular, all, monospace);\n\n\t\t// monospace italic test\n\t\tthis.createRequest('|', CharWidthRequestType.Italic, all, monospace);\n\t\tthis.createRequest('_', CharWidthRequestType.Italic, all, monospace);\n\t\tthis.createRequest('i', CharWidthRequestType.Italic, all, monospace);\n\t\tthis.createRequest('l', CharWidthRequestType.Italic, all, monospace);\n\t\tthis.createRequest('m', CharWidthRequestType.Italic, all, monospace);\n\t\tthis.createRequest('n', CharWidthRequestType.Italic, all, monospace);\n\n\t\t// monospace bold test\n\t\tthis.createRequest('|', CharWidthRequestType.Bold, all, monospace);\n\t\tthis.createRequest('_', CharWidthRequestType.Bold, all, monospace);\n\t\tthis.createRequest('i', CharWidthRequestType.Bold, all, monospace);\n\t\tthis.createRequest('l', CharWidthRequestType.Bold, all, monospace);\n\t\tthis.createRequest('m', CharWidthRequestType.Bold, all, monospace);\n\t\tthis.createRequest('n', CharWidthRequestType.Bold, all, monospace);\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 = true;\n\t\tconst referenceWidth = monospace[0].width;\n\t\tfor (let i = 1, len = monospace.length; 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\t// let's trust the zoom level only 2s after it was changed.\n\t\tconst canTrustBrowserZoomLevel = (browser.getTimeSinceLastZoomLevelChanged() > 2000);\n\t\treturn new FontInfo({\n\t\t\tzoomLevel: browser.getZoomLevel(),\n\t\t\tfontFamily: bareFontInfo.fontFamily,\n\t\t\tfontWeight: bareFontInfo.fontWeight,\n\t\t\tfontSize: bareFontInfo.fontSize,\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\tmaxDigitWidth: maxDigitWidth\n\t\t}, canTrustBrowserZoomLevel);\n\t}\n}\n\nexport class Configuration extends CommonEditorConfiguration {\n\n\tpublic static applyFontInfoSlow(domNode: HTMLElement, fontInfo: BareFontInfo): void {\n\t\tdomNode.style.fontFamily = fontInfo.getMassagedFontFamily();\n\t\tdomNode.style.fontWeight = fontInfo.fontWeight;\n\t\tdomNode.style.fontSize = fontInfo.fontSize + 'px';\n\t\tdomNode.style.lineHeight = fontInfo.lineHeight + 'px';\n\t\tdomNode.style.letterSpacing = fontInfo.letterSpacing + 'px';\n\t}\n\n\tpublic static applyFontInfo(domNode: FastDomNode<HTMLElement>, fontInfo: BareFontInfo): void {\n\t\tdomNode.setFontFamily(fontInfo.getMassagedFontFamily());\n\t\tdomNode.setFontWeight(fontInfo.fontWeight);\n\t\tdomNode.setFontSize(fontInfo.fontSize);\n\t\tdomNode.setLineHeight(fontInfo.lineHeight);\n\t\tdomNode.setLetterSpacing(fontInfo.letterSpacing);\n\t}\n\n\tprivate readonly _elementSizeObserver: ElementSizeObserver;\n\n\tconstructor(\n\t\tisSimpleWidget: boolean,\n\t\toptions: IEditorOptions,\n\t\treferenceDomElement: HTMLElement | null = null,\n\t\tprivate readonly accessibilityService: IAccessibilityService\n\t) {\n\t\tsuper(isSimpleWidget, options);\n\n\t\tthis._elementSizeObserver = this._register(new ElementSizeObserver(referenceDomElement, () => this._onReferenceDomElementSizeChanged()));\n\n\t\tthis._register(CSSBasedConfiguration.INSTANCE.onDidChange(() => this._onCSSBasedConfigurationChanged()));\n\n\t\tif (this._validatedOptions.automaticLayout) {\n\t\t\tthis._elementSizeObserver.startObserving();\n\t\t}\n\n\t\tthis._register(browser.onDidChangeZoomLevel(_ => this._recomputeOptions()));\n\t\tthis._register(this.accessibilityService.onDidChangeAccessibilitySupport(() => this._recomputeOptions()));\n\n\t\tthis._recomputeOptions();\n\t}\n\n\tprivate _onReferenceDomElementSizeChanged(): void {\n\t\tthis._recomputeOptions();\n\t}\n\n\tprivate _onCSSBasedConfigurationChanged(): void {\n\t\tthis._recomputeOptions();\n\t}\n\n\tpublic observeReferenceElement(dimension?: IDimension): void {\n\t\tthis._elementSizeObserver.observe(dimension);\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate _getExtraEditorClassName(): string {\n\t\tlet extra = '';\n\t\tif (!browser.isSafari && !browser.isWebkitWebView) {\n\t\t\t// Use user-select: none in all browsers except Safari and native macOS WebView\n\t\t\textra += 'no-user-select ';\n\t\t}\n\t\tif (platform.isMacintosh) {\n\t\t\textra += 'mac ';\n\t\t}\n\t\treturn extra;\n\t}\n\n\tprotected _getEnvConfiguration(): IEnvConfiguration {\n\t\treturn {\n\t\t\textraEditorClassName: this._getExtraEditorClassName(),\n\t\t\touterWidth: this._elementSizeObserver.getWidth(),\n\t\t\touterHeight: this._elementSizeObserver.getHeight(),\n\t\t\temptySelectionClipboard: browser.isWebKit || browser.isFirefox,\n\t\t\tpixelRatio: browser.getPixelRatio(),\n\t\t\tzoomLevel: browser.getZoomLevel(),\n\t\t\taccessibilitySupport: this.accessibilityService.getAccessibilitySupport()\n\t\t};\n\t}\n\n\tprotected readConfiguration(bareFontInfo: BareFontInfo): FontInfo {\n\t\treturn CSSBasedConfiguration.INSTANCE.readConfiguration(bareFontInfo);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Configuration } from 'vs/editor/browser/config/configuration';\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 { IConfiguration } from 'vs/editor/common/editorCommon';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\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 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 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 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 onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn this._visibleLines.onFlushed(e);\n\t}\n\tpublic onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis._isFocused = e.isFocused;\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn this._visibleLines.onLinesChanged(e);\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn this._visibleLines.onLinesDeleted(e);\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn this._visibleLines.onLinesInserted(e);\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn this._visibleLines.onScrollChanged(e) || true;\n\t}\n\tpublic onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn this._visibleLines.onTokensChanged(e);\n\t}\n\tpublic 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: IConfiguration;\n\tprivate readonly _dynamicOverlays: DynamicViewOverlay[];\n\tprivate _domNode: FastDomNode<HTMLElement> | null;\n\tprivate _renderedContent: string | null;\n\tprivate _lineHeight: number;\n\n\tconstructor(configuration: IConfiguration, dynamicOverlays: DynamicViewOverlay[]) {\n\t\tthis._configuration = configuration;\n\t\tthis._lineHeight = this._configuration.editor.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\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._configuration.editor.lineHeight;\n\t\t}\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\n\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\n\t\tthis.domNode.setHeight(0);\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\t\t}\n\t\treturn super.onConfigurationChanged(e);\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn super.onScrollChanged(e) || e.scrollWidthChanged;\n\t}\n\n\t// --- end event handlers\n\n\t_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\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\n\t\tthis.domNode.setClassName('margin-view-overlays');\n\t\tthis.domNode.setWidth(1);\n\n\t\tConfiguration.applyFontInfo(this.domNode, this._context.configuration.editor.fontInfo);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tlet shouldRender = false;\n\t\tif (e.fontInfo) {\n\t\t\tConfiguration.applyFontInfo(this.domNode, this._context.configuration.editor.fontInfo);\n\t\t\tshouldRender = true;\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\t\tshouldRender = true;\n\t\t}\n\t\treturn super.onConfigurationChanged(e) || shouldRender;\n\t}\n\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn super.onScrollChanged(e) || e.scrollHeightChanged;\n\t}\n\n\t_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 { Configuration } from 'vs/editor/browser/config/configuration';\nimport { TextEditorCursorStyle } 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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\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\n\t\tthis._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;\n\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.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');\n\t\tthis._domNode.setHeight(this._lineHeight);\n\t\tthis._domNode.setTop(0);\n\t\tthis._domNode.setLeft(0);\n\t\tConfiguration.applyFontInfo(this._domNode, this._context.configuration.editor.fontInfo);\n\t\tthis._domNode.setDisplay('none');\n\n\t\tthis.updatePosition(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\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.fontInfo) {\n\t\t\tConfiguration.applyFontInfo(this._domNode, this._context.configuration.editor.fontInfo);\n\t\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;\n\t\t\tthis._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.cursorWidth, this._typicalHalfwidthCharacterWidth);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic onCursorPositionChanged(position: Position): boolean {\n\t\tthis.updatePosition(position);\n\t\treturn true;\n\t}\n\n\tprivate _prepareRender(ctx: RenderingContext): ViewCursorRenderData | null {\n\t\tlet textContent = '';\n\t\tlet textContentClassName = '';\n\n\t\tif (this._cursorStyle === TextEditorCursorStyle.Line || this._cursorStyle === TextEditorCursorStyle.LineThin) {\n\t\t\tconst visibleRange = ctx.visibleRangeForPosition(this._position);\n\t\t\tif (!visibleRange) {\n\t\t\t\t// Outside viewport\n\t\t\t\treturn null;\n\t\t\t}\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\tconst lineContent = this._context.model.getLineContent(this._position.lineNumber);\n\t\t\t\t\ttextContent = lineContent.charAt(this._position.column - 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twidth = dom.computeScreenAwareSize(1);\n\t\t\t}\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\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(this._position.lineNumber) - ctx.bigNumbersDelta;\n\t\t\treturn new ViewCursorRenderData(top, left, width, this._lineHeight, textContent, textContentClassName);\n\t\t}\n\n\t\tconst visibleRangeForCharacter = ctx.linesVisibleRangesForRange(new Range(this._position.lineNumber, this._position.column, this._position.lineNumber, this._position.column + 1), false);\n\n\t\tif (!visibleRangeForCharacter || visibleRangeForCharacter.length === 0 || visibleRangeForCharacter[0].ranges.length === 0) {\n\t\t\t// Outside viewport\n\t\t\treturn null;\n\t\t}\n\n\t\tconst range = visibleRangeForCharacter[0].ranges[0];\n\t\tconst width = range.width < 1 ? this._typicalHalfwidthCharacterWidth : range.width;\n\n\t\tif (this._cursorStyle === TextEditorCursorStyle.Block) {\n\t\t\tconst lineData = this._context.model.getViewLineData(this._position.lineNumber);\n\t\t\ttextContent = lineData.content.charAt(this._position.column - 1);\n\t\t\tif (strings.isHighSurrogate(lineData.content.charCodeAt(this._position.column - 1))) {\n\t\t\t\ttextContent += lineData.content.charAt(this._position.column);\n\t\t\t}\n\t\t\tconst tokenIndex = lineData.tokens.findTokenIndexAtOffset(this._position.column - 1);\n\t\t\ttextContentClassName = lineData.tokens.getClassName(tokenIndex);\n\t\t}\n\n\t\tlet top = ctx.getVerticalOffsetForLineNumber(this._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 ' + 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\tprivate updatePosition(newPosition: Position): void {\n\t\tthis._position = newPosition;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Disposable } from 'vs/base/common/lifecycle';\nimport * as mime from 'vs/base/common/mime';\nimport * as strings from 'vs/base/common/strings';\nimport { URI } from 'vs/base/common/uri';\nimport { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';\nimport { ModesRegistry } from 'vs/editor/common/modes/modesRegistry';\nimport { NULL_LANGUAGE_IDENTIFIER, NULL_MODE_ID } from 'vs/editor/common/modes/nullMode';\nimport { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService';\nimport { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\nexport interface IResolvedLanguage {\n\tidentifier: LanguageIdentifier;\n\tname: string | null;\n\tmimetypes: string[];\n\taliases: string[];\n\textensions: string[];\n\tfilenames: string[];\n\tconfigurationFiles: URI[];\n}\n\nexport class LanguagesRegistry extends Disposable {\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\n\tprivate _nextLanguageId2: number;\n\tprivate readonly _languageIdToLanguage: string[];\n\tprivate readonly _languageToLanguageId: { [id: string]: number; };\n\n\tprivate _languages: { [id: string]: IResolvedLanguage; };\n\tprivate _mimeTypesMap: { [mimeType: string]: LanguageIdentifier; };\n\tprivate _nameMap: { [name: string]: LanguageIdentifier; };\n\tprivate _lowercaseNameMap: { [name: string]: LanguageIdentifier; };\n\n\tconstructor(useModesRegistry = true, warnOnOverwrite = false) {\n\t\tsuper();\n\n\t\tthis._warnOnOverwrite = warnOnOverwrite;\n\n\t\tthis._nextLanguageId2 = 1;\n\t\tthis._languageIdToLanguage = [];\n\t\tthis._languageToLanguageId = Object.create(null);\n\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) => this._initializeFromRegistry()));\n\t\t}\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\tconst desc = ModesRegistry.getLanguages();\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\tlet 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(ModesRegistry.getLanguages().map(language => language.id));\n\n\t\tthis._onDidChange.fire();\n\t}\n\n\tprivate _getLanguageId(language: string): number {\n\t\tif (this._languageToLanguageId[language]) {\n\t\t\treturn this._languageToLanguageId[language];\n\t\t}\n\n\t\tconst languageId = this._nextLanguageId2++;\n\t\tthis._languageIdToLanguage[languageId] = language;\n\t\tthis._languageToLanguageId[language] = languageId;\n\n\t\treturn languageId;\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\tconst languageId = this._getLanguageId(langId);\n\t\t\tresolvedLanguage = {\n\t\t\t\tidentifier: new LanguageIdentifier(langId, languageId),\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};\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\tfor (let extension of lang.extensions) {\n\t\t\t\tmime.registerTextMime({ id: langId, mime: primaryMime, extension: extension }, this._warnOnOverwrite);\n\t\t\t\tresolvedLanguage.extensions.push(extension);\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\tmime.registerTextMime({ 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\tmime.registerTextMime({ 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\tlet firstLineRegex = new RegExp(firstLineRegexStr);\n\t\t\t\tif (!strings.regExpLeadsToEndlessLoop(firstLineRegex)) {\n\t\t\t\t\tmime.registerTextMime({ 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\tlet 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\tlet 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\t}\n\n\tpublic isRegisteredMode(mimetypeOrModeId: string): boolean {\n\t\t// Is this a known mime type ?\n\t\tif (hasOwnProperty.call(this._mimeTypesMap, mimetypeOrModeId)) {\n\t\t\treturn true;\n\t\t}\n\t\t// Is this a known mode id ?\n\t\treturn hasOwnProperty.call(this._languages, mimetypeOrModeId);\n\t}\n\n\tpublic getModeIdForLanguageNameLowercase(languageNameLower: string): string | null {\n\t\tif (!hasOwnProperty.call(this._lowercaseNameMap, languageNameLower)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._lowercaseNameMap[languageNameLower].language;\n\t}\n\n\tpublic extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds: string | undefined): string[] {\n\t\tif (!commaSeparatedMimetypesOrCommaSeparatedIds) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn (\n\t\t\tcommaSeparatedMimetypesOrCommaSeparatedIds.\n\t\t\t\tsplit(',').\n\t\t\t\tmap((mimeTypeOrId) => mimeTypeOrId.trim()).\n\t\t\t\tmap((mimeTypeOrId) => {\n\t\t\t\t\tif (hasOwnProperty.call(this._mimeTypesMap, mimeTypeOrId)) {\n\t\t\t\t\t\treturn this._mimeTypesMap[mimeTypeOrId].language;\n\t\t\t\t\t}\n\t\t\t\t\treturn mimeTypeOrId;\n\t\t\t\t}).\n\t\t\t\tfilter((modeId) => {\n\t\t\t\t\treturn hasOwnProperty.call(this._languages, modeId);\n\t\t\t\t})\n\t\t);\n\t}\n\n\tpublic getLanguageIdentifier(_modeId: string | LanguageId): LanguageIdentifier | null {\n\t\tif (_modeId === NULL_MODE_ID || _modeId === LanguageId.Null) {\n\t\t\treturn NULL_LANGUAGE_IDENTIFIER;\n\t\t}\n\n\t\tlet modeId: string;\n\t\tif (typeof _modeId === 'string') {\n\t\t\tmodeId = _modeId;\n\t\t} else {\n\t\t\tmodeId = this._languageIdToLanguage[_modeId];\n\t\t\tif (!modeId) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasOwnProperty.call(this._languages, modeId)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._languages[modeId].identifier;\n\t}\n\n\tpublic getModeIdsFromFilepathOrFirstLine(filepath: string | null, firstLine?: string): string[] {\n\t\tif (!filepath && !firstLine) {\n\t\t\treturn [];\n\t\t}\n\t\tlet mimeTypes = mime.guessMimeTypes(filepath, firstLine);\n\t\treturn this.extractModeIds(mimeTypes.join(','));\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IMode, LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';\nimport { FrankensteinMode } from 'vs/editor/common/modes/abstractMode';\nimport { NULL_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/nullMode';\nimport { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry';\nimport { ILanguageSelection, IModeService } from 'vs/editor/common/services/modeService';\n\nclass LanguageSelection extends Disposable implements ILanguageSelection {\n\n\tpublic languageIdentifier: LanguageIdentifier;\n\n\tprivate readonly _selector: () => LanguageIdentifier;\n\n\tprivate readonly _onDidChange: Emitter<LanguageIdentifier> = this._register(new Emitter<LanguageIdentifier>());\n\tpublic readonly onDidChange: Event<LanguageIdentifier> = this._onDidChange.event;\n\n\tconstructor(onLanguagesMaybeChanged: Event<void>, selector: () => LanguageIdentifier) {\n\t\tsuper();\n\t\tthis._selector = selector;\n\t\tthis.languageIdentifier = this._selector();\n\t\tthis._register(onLanguagesMaybeChanged(() => this._evaluate()));\n\t}\n\n\tprivate _evaluate(): void {\n\t\tlet languageIdentifier = this._selector();\n\t\tif (languageIdentifier.id === this.languageIdentifier.id) {\n\t\t\t// no change\n\t\t\treturn;\n\t\t}\n\t\tthis.languageIdentifier = languageIdentifier;\n\t\tthis._onDidChange.fire(this.languageIdentifier);\n\t}\n}\n\nexport class ModeServiceImpl implements IModeService {\n\tpublic _serviceBrand: any;\n\n\tprivate readonly _instantiatedModes: { [modeId: string]: IMode; };\n\tprivate readonly _registry: LanguagesRegistry;\n\n\tprivate readonly _onDidCreateMode = new Emitter<IMode>();\n\tpublic readonly onDidCreateMode: Event<IMode> = this._onDidCreateMode.event;\n\n\tprotected readonly _onLanguagesMaybeChanged = new Emitter<void>();\n\tprivate readonly onLanguagesMaybeChanged: Event<void> = this._onLanguagesMaybeChanged.event;\n\n\tconstructor(warnOnOverwrite = false) {\n\t\tthis._instantiatedModes = {};\n\n\t\tthis._registry = new LanguagesRegistry(true, warnOnOverwrite);\n\t\tthis._registry.onDidChange(() => this._onLanguagesMaybeChanged.fire());\n\t}\n\n\tpublic isRegisteredMode(mimetypeOrModeId: string): boolean {\n\t\treturn this._registry.isRegisteredMode(mimetypeOrModeId);\n\t}\n\n\tpublic getModeIdForLanguageName(alias: string): string | null {\n\t\treturn this._registry.getModeIdForLanguageNameLowercase(alias);\n\t}\n\n\tpublic getModeIdByFilepathOrFirstLine(filepath: string | null, firstLine?: string): string | null {\n\t\tconst modeIds = this._registry.getModeIdsFromFilepathOrFirstLine(filepath, firstLine);\n\n\t\tif (modeIds.length > 0) {\n\t\t\treturn modeIds[0];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getModeId(commaSeparatedMimetypesOrCommaSeparatedIds: string | undefined): string | null {\n\t\tconst modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds);\n\n\t\tif (modeIds.length > 0) {\n\t\t\treturn modeIds[0];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getLanguageIdentifier(modeId: string | LanguageId): LanguageIdentifier | null {\n\t\treturn this._registry.getLanguageIdentifier(modeId);\n\t}\n\n\t// --- instantiation\n\n\tpublic create(commaSeparatedMimetypesOrCommaSeparatedIds: string | undefined): ILanguageSelection {\n\t\treturn new LanguageSelection(this.onLanguagesMaybeChanged, () => {\n\t\t\tconst modeId = this.getModeId(commaSeparatedMimetypesOrCommaSeparatedIds);\n\t\t\treturn this._createModeAndGetLanguageIdentifier(modeId);\n\t\t});\n\t}\n\n\tpublic createByFilepathOrFirstLine(filepath: string | null, firstLine?: string): ILanguageSelection {\n\t\treturn new LanguageSelection(this.onLanguagesMaybeChanged, () => {\n\t\t\tconst modeId = this.getModeIdByFilepathOrFirstLine(filepath, firstLine);\n\t\t\treturn this._createModeAndGetLanguageIdentifier(modeId);\n\t\t});\n\t}\n\n\tprivate _createModeAndGetLanguageIdentifier(modeId: string | null): LanguageIdentifier {\n\t\t// Fall back to plain text if no mode was found\n\t\tconst languageIdentifier = this.getLanguageIdentifier(modeId || 'plaintext') || NULL_LANGUAGE_IDENTIFIER;\n\t\tthis._getOrCreateMode(languageIdentifier.language);\n\t\treturn languageIdentifier;\n\t}\n\n\tpublic triggerMode(commaSeparatedMimetypesOrCommaSeparatedIds: string): void {\n\t\tconst modeId = this.getModeId(commaSeparatedMimetypesOrCommaSeparatedIds);\n\t\t// Fall back to plain text if no mode was found\n\t\tthis._getOrCreateMode(modeId || 'plaintext');\n\t}\n\n\tprivate _getOrCreateMode(modeId: string): IMode {\n\t\tif (!this._instantiatedModes.hasOwnProperty(modeId)) {\n\t\t\tlet languageIdentifier = this.getLanguageIdentifier(modeId) || NULL_LANGUAGE_IDENTIFIER;\n\t\t\tthis._instantiatedModes[modeId] = new FrankensteinMode(languageIdentifier);\n\n\t\t\tthis._onDidCreateMode.fire(this._instantiatedModes[modeId]);\n\t\t}\n\t\treturn this._instantiatedModes[modeId];\n\t}\n}\n","\nimport { URI } from 'vs/base/common/uri';\nimport { Event } from 'vs/base/common/event';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry';\n\nexport const IConfigurationService = createDecorator<IConfigurationService>('configurationService');\n\nexport interface IConfigurationOverrides {\n\toverrideIdentifier?: string | null;\n\tresource?: URI | null;\n}\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 IConfigurationChangeEvent {\n\n\tsource: ConfigurationTarget;\n\taffectedKeys: string[];\n\taffectsConfiguration(configuration: string, resource?: URI): boolean;\n}\n\nexport interface IConfigurationService {\n\t_serviceBrand: any;\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\tinspect<T>(key: string, overrides?: IConfigurationOverrides): {\n\t\tdefault: T,\n\t\tuser: T,\n\t\tuserLocal?: T,\n\t\tuserRemote?: T,\n\t\tworkspace?: T,\n\t\tworkspaceFolder?: T,\n\t\tmemory?: T,\n\t\tvalue: T,\n\t};\n}\n\nexport interface IConfigurationModel {\n\tcontents: any;\n\tkeys: string[];\n\toverrides: IOverrides[];\n}\n\nexport interface IOverrides {\n\tcontents: any;\n\tidentifiers: string[];\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') {\n\t\tcurr[last] = value; // workaround https://github.com/Microsoft/vscode/issues/13606\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\nexport function getConfigurationKeys(): string[] {\n\tconst properties = Registry.as<IConfigurationRegistry>(Extensions.Configuration).getConfigurationProperties();\n\treturn Object.keys(properties);\n}\n\nexport function getDefaultValues(): any {\n\tconst valueTreeRoot: any = Object.create(null);\n\tconst properties = Registry.as<IConfigurationRegistry>(Extensions.Configuration).getConfigurationProperties();\n\n\tfor (let key in properties) {\n\t\tlet value = properties[key].default;\n\t\taddToValueTree(valueTreeRoot, key, value, message => console.error(`Conflict in default settings: ${message}`));\n\t}\n\n\treturn valueTreeRoot;\n}\n\nexport function overrideIdentifierFromKey(key: string): string {\n\treturn key.substring(1, key.length - 1);\n}\n\nexport function getMigratedSettingValue<T>(configurationService: IConfigurationService, currentSettingName: string, legacySettingName: string): T {\n\tconst setting = configurationService.inspect<T>(currentSettingName);\n\tconst legacySetting = configurationService.inspect<T>(legacySettingName);\n\n\tif (typeof setting.user !== 'undefined' || typeof setting.workspace !== 'undefined' || typeof setting.workspaceFolder !== 'undefined') {\n\t\treturn setting.value;\n\t} else if (typeof legacySetting.user !== 'undefined' || typeof legacySetting.workspace !== 'undefined' || typeof legacySetting.workspaceFolder !== 'undefined') {\n\t\treturn legacySetting.value;\n\t} else {\n\t\treturn setting.default;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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, dispose } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { URI } from 'vs/base/common/uri';\nimport { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions';\nimport { DefaultEndOfLine, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model';\nimport { TextModel } from 'vs/editor/common/model/textModel';\nimport { IModelLanguageChangedEvent } from 'vs/editor/common/model/textModelEvents';\nimport { LanguageIdentifier } from 'vs/editor/common/modes';\nimport { PLAINTEXT_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/modesRegistry';\nimport { ILanguageSelection } from 'vs/editor/common/services/modeService';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\n\nfunction MODEL_ID(resource: URI): string {\n\treturn resource.toString();\n}\n\nclass ModelData implements IDisposable {\n\tpublic readonly model: ITextModel;\n\n\tprivate _languageSelection: ILanguageSelection | null;\n\tprivate _languageSelectionListener: IDisposable | null;\n\n\tprivate _modelEventListeners: IDisposable[];\n\n\tconstructor(\n\t\tmodel: ITextModel,\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 = [];\n\t\tthis._modelEventListeners.push(model.onWillDispose(() => onWillDispose(model)));\n\t\tthis._modelEventListeners.push(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\tif (this._languageSelection) {\n\t\t\tthis._languageSelection.dispose();\n\t\t\tthis._languageSelection = null;\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._modelEventListeners = dispose(this._modelEventListeners);\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.languageIdentifier));\n\t\tthis.model.setMode(languageSelection.languageIdentifier);\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}\n\ninterface IRawConfig {\n\teol?: any;\n\teditor?: IRawEditorConfig;\n}\n\nconst DEFAULT_EOL = (platform.isLinux || platform.isMacintosh) ? DefaultEndOfLine.LF : DefaultEndOfLine.CRLF;\n\nexport class ModelServiceImpl extends Disposable implements IModelService {\n\tpublic _serviceBrand: any;\n\n\tprivate readonly _configurationService: IConfigurationService;\n\tprivate readonly _configurationServiceSubscription: IDisposable;\n\tprivate readonly _resourcePropertiesService: ITextResourcePropertiesService;\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: Emitter<{ model: ITextModel; oldModeId: string; }> = this._register(new Emitter<{ model: ITextModel; oldModeId: string; }>());\n\tpublic readonly onModelModeChanged: Event<{ model: ITextModel; oldModeId: string; }> = this._onModelModeChanged.event;\n\n\tprivate _modelCreationOptionsByLanguageAndResource: {\n\t\t[languageAndResource: string]: ITextModelCreationOptions;\n\t};\n\n\t/**\n\t * All the models known in the system.\n\t */\n\tprivate readonly _models: { [modelId: string]: ModelData; };\n\n\tconstructor(\n\t\t@IConfigurationService configurationService: IConfigurationService,\n\t\t@ITextResourcePropertiesService resourcePropertiesService: ITextResourcePropertiesService\n\t) {\n\t\tsuper();\n\t\tthis._configurationService = configurationService;\n\t\tthis._resourcePropertiesService = resourcePropertiesService;\n\t\tthis._models = {};\n\t\tthis._modelCreationOptionsByLanguageAndResource = Object.create(null);\n\n\t\tthis._configurationServiceSubscription = this._configurationService.onDidChangeConfiguration(e => this._updateModelOptions());\n\t\tthis._updateModelOptions();\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\tlet 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\tlet 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\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};\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._resourcePropertiesService.getEOL(resource, language);\n\t\t\tcreationOptions = ModelServiceImpl._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\tlet oldOptionsByLanguageAndResource = this._modelCreationOptionsByLanguageAndResource;\n\t\tthis._modelCreationOptionsByLanguageAndResource = Object.create(null);\n\n\t\t// Update options on all models\n\t\tlet keys = Object.keys(this._models);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tlet modelId = keys[i];\n\t\t\tlet modelData = this._models[modelId];\n\t\t\tconst language = modelData.model.getLanguageIdentifier().language;\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\tModelServiceImpl._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\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) {\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});\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});\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._configurationServiceSubscription.dispose();\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin IModelService\n\n\tprivate _createModelData(value: string | ITextBufferFactory, languageIdentifier: LanguageIdentifier, resource: URI | undefined, isForSimpleWidget: boolean): ModelData {\n\t\t// create & save the model\n\t\tconst options = this.getCreationOptions(languageIdentifier.language, resource, isForSimpleWidget);\n\t\tconst model: TextModel = new TextModel(value, options, languageIdentifier, resource);\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.languageIdentifier, resource, isForSimpleWidget);\n\t\t\tthis.setMode(modelData.model, languageSelection);\n\t\t} else {\n\t\t\tmodelData = this._createModelData(value, PLAINTEXT_LANGUAGE_IDENTIFIER, 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\tlet 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\tlet ret: ITextModel[] = [];\n\n\t\tlet keys = Object.keys(this._models);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tlet 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\tlet modelId = MODEL_ID(resource);\n\t\tlet 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\t// --- end IModelService\n\n\tprivate _onWillDispose(model: ITextModel): void {\n\t\tlet modelId = MODEL_ID(model.uri);\n\t\tlet modelData = this._models[modelId];\n\n\t\tdelete this._models[modelId];\n\t\tmodelData.dispose();\n\n\t\t// clean up cache\n\t\tdelete this._modelCreationOptionsByLanguageAndResource[model.getLanguageIdentifier().language + model.uri];\n\n\t\tthis._onModelRemoved.fire(model);\n\t}\n\n\tprivate _onDidChangeLanguage(model: ITextModel, e: IModelLanguageChangedEvent): void {\n\t\tconst oldModeId = e.oldLanguage;\n\t\tconst newModeId = model.getLanguageIdentifier().language;\n\t\tconst oldOptions = this.getCreationOptions(oldModeId, model.uri, model.isForSimpleWidget);\n\t\tconst newOptions = this.getCreationOptions(newModeId, model.uri, model.isForSimpleWidget);\n\t\tModelServiceImpl._setModelOptionsForModel(model, newOptions, oldOptions);\n\t\tthis._onModelModeChanged.fire({ model, oldModeId });\n\t}\n}\n","\nimport { ResourceMap } from 'vs/base/common/map';\nimport * as arrays from 'vs/base/common/arrays';\nimport * as types from 'vs/base/common/types';\nimport * as objects from 'vs/base/common/objects';\nimport { URI } from 'vs/base/common/uri';\nimport { OVERRIDE_PROPERTY_PATTERN } from 'vs/platform/configuration/common/configurationRegistry';\nimport { IOverrides, overrideIdentifierFromKey, addToValueTree, toValuesTree, IConfigurationModel, getConfigurationValue, IConfigurationOverrides, getDefaultValues, getConfigurationKeys, removeFromValueTree } from 'vs/platform/configuration/common/configuration';\nimport { Workspace } from 'vs/platform/workspace/common/workspace';\n\nexport class ConfigurationModel implements IConfigurationModel {\n\n\tprivate isFrozen: boolean = false;\n\n\tconstructor(\n\t\tprivate _contents: any = {},\n\t\tprivate _keys: string[] = [],\n\t\tprivate _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\toverride(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 = {};\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);\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} 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 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\tfor (const override of this.overrides) {\n\t\t\tif (override.identifiers.indexOf(identifier) !== -1) {\n\t\t\t\treturn override.contents;\n\t\t\t}\n\t\t}\n\t\treturn null;\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() {\n\t\tconst contents = getDefaultValues();\n\t\tconst keys = getConfigurationKeys();\n\t\tconst overrides: IOverrides[] = [];\n\t\tfor (const key of Object.keys(contents)) {\n\t\t\tif (OVERRIDE_PROPERTY_PATTERN.test(key)) {\n\t\t\t\toverrides.push({\n\t\t\t\t\tidentifiers: [overrideIdentifierFromKey(key).trim()],\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\t\tsuper(contents, keys, overrides);\n\t}\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: IConfigurationOverrides = {}): 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): {\n\t\tdefault: C,\n\t\tuser: C,\n\t\tuserLocal?: C,\n\t\tuserRemote?: C,\n\t\tworkspace?: C,\n\t\tworkspaceFolder?: C\n\t\tmemory?: C\n\t\tvalue: C,\n\t} {\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\t\treturn {\n\t\t\tdefault: overrides.overrideIdentifier ? this._defaultConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this._defaultConfiguration.freeze().getValue(key),\n\t\t\tuser: overrides.overrideIdentifier ? this.userConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this.userConfiguration.freeze().getValue(key),\n\t\t\tuserLocal: overrides.overrideIdentifier ? this.localUserConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this.localUserConfiguration.freeze().getValue(key),\n\t\t\tuserRemote: overrides.overrideIdentifier ? this.remoteUserConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this.remoteUserConfiguration.freeze().getValue(key),\n\t\t\tworkspace: workspace ? overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().override(overrides.overrideIdentifier).getValue(key) : this._workspaceConfiguration.freeze().getValue(key) : undefined, //Check on workspace exists or not because _workspaceConfiguration is never null\n\t\t\tworkspaceFolder: folderConfigurationModel ? overrides.overrideIdentifier ? folderConfigurationModel.freeze().override(overrides.overrideIdentifier).getValue(key) : folderConfigurationModel.freeze().getValue(key) : undefined,\n\t\t\tmemory: overrides.overrideIdentifier ? memoryConfigurationModel.override(overrides.overrideIdentifier).getValue(key) : memoryConfigurationModel.getValue(key),\n\t\t\tvalue: consolidateConfigurationModel.getValue(key)\n\t\t};\n\t}\n\n\tprivate _userConfiguration: ConfigurationModel | 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 | null {\n\t\tif (workspace && resource) {\n\t\t\tconst root = workspace.getFolder(resource);\n\t\t\tif (root) {\n\t\t\t\treturn types.withUndefinedAsNull(this._folderConfigurations.get(root.uri));\n\t\t\t}\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 { Emitter, Event, PauseableEmitter } from 'vs/base/common/event';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { keys } from 'vs/base/common/map';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { ContextKeyExpr, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IReadableSet, SET_CONTEXT_COMMAND_ID } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver';\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 setValue(key: string, value: any): boolean {\n\t\treturn false;\n\t}\n\n\tpublic removeValue(key: string): boolean {\n\t\treturn false;\n\t}\n\n\tpublic getValue<T>(key: string): T | undefined {\n\t\treturn undefined;\n\t}\n}\n\nclass ConfigAwareContextValuesContainer extends Context {\n\n\tprivate static _keyPrefix = 'config.';\n\n\tprivate readonly _values = new Map<string, 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 = keys(this._values);\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\t\t\t\t\tif (this._values.has(contextKey)) {\n\t\t\t\t\t\tthis._values.delete(contextKey);\n\t\t\t\t\t\tchangedKeys.push(contextKey);\n\t\t\t\t\t}\n\t\t\t\t}\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\tgetValue(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}\n\n\t\tthis._values.set(key, value);\n\t\treturn value;\n\t}\n\n\tsetValue(key: string, value: any): boolean {\n\t\treturn super.setValue(key, value);\n\t}\n\n\tremoveValue(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\tpublic _serviceBrand: any;\n\n\tprotected _isDisposed: boolean;\n\tprotected _onDidChangeContext = new PauseableEmitter<IContextKeyChangeEvent>({ merge: input => new CompositeContextKeyChangeEvent(input) });\n\tprotected _myContextId: number;\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\tpublic get onDidChangeContext(): Event<IContextKeyChangeEvent> {\n\t\treturn this._onDidChangeContext.event;\n\t}\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: ContextKeyExpr | 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 = KeybindingResolver.contextMatchesRules(context, rules);\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 _toDispose: IDisposable[] = [];\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.push(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._isDisposed = true;\n\t\tthis._toDispose = dispose(this._toDispose);\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 | undefined;\n\n\tconstructor(parent: AbstractContextKeyService, domNode?: IContextKeyServiceTarget) {\n\t\tsuper(parent.createChildContext());\n\t\tthis._parent = parent;\n\n\t\tif (domNode) {\n\t\t\tthis._domNode = domNode;\n\t\t\tthis._domNode.setAttribute(KEYBINDING_CONTEXT_ATTR, String(this._myContextId));\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._isDisposed = true;\n\t\tthis._parent.disposeContext(this._myContextId);\n\t\tif (this._domNode) {\n\t\t\tthis._domNode.removeAttribute(KEYBINDING_CONTEXT_ATTR);\n\t\t\tthis._domNode = undefined;\n\t\t}\n\t}\n\n\tpublic get onDidChangeContext(): Event<IContextKeyChangeEvent> {\n\t\treturn Event.any(this._parent.onDidChangeContext, this._onDidChangeContext.event);\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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, Keybinding, SimpleKeybinding, createKeybinding } from 'vs/base/common/keyCodes';\nimport { OS, OperatingSystem } from 'vs/base/common/platform';\nimport { CommandsRegistry, ICommandHandler, ICommandHandlerDescription } from 'vs/platform/commands/common/commands';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { Registry } from 'vs/platform/registry/common/platform';\n\nexport interface IKeybindingItem {\n\tkeybinding: Keybinding;\n\tcommand: string;\n\tcommandArgs?: any;\n\twhen: ContextKeyExpr | null | undefined;\n\tweight1: number;\n\tweight2: number;\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\twhen: ContextKeyExpr | 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\tdescription?: ICommandHandlerDescription | null;\n}\n\nexport interface IKeybindingsRegistry {\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, undefined, 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, undefined, 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.KEY_0 && keyCode <= KeyCode.KEY_9) {\n\t\t\treturn true;\n\t\t}\n\t\tif (keyCode >= KeyCode.KEY_A && keyCode <= KeyCode.KEY_Z) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\tkeyCode === KeyCode.US_SEMICOLON\n\t\t\t|| keyCode === KeyCode.US_EQUAL\n\t\t\t|| keyCode === KeyCode.US_COMMA\n\t\t\t|| keyCode === KeyCode.US_MINUS\n\t\t\t|| keyCode === KeyCode.US_DOT\n\t\t\t|| keyCode === KeyCode.US_SLASH\n\t\t\t|| keyCode === KeyCode.US_BACKTICK\n\t\t\t|| keyCode === KeyCode.ABNT_C1\n\t\t\t|| keyCode === KeyCode.ABNT_C2\n\t\t\t|| keyCode === KeyCode.US_OPEN_SQUARE_BRACKET\n\t\t\t|| keyCode === KeyCode.US_BACKSLASH\n\t\t\t|| keyCode === KeyCode.US_CLOSE_SQUARE_BRACKET\n\t\t\t|| keyCode === KeyCode.US_QUOTE\n\t\t\t|| keyCode === KeyCode.OEM_8\n\t\t\t|| keyCode === KeyCode.OEM_102\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: ContextKeyExpr | 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,\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});\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 { IContextKeyService, ContextKeyDefinedExpr, ContextKeyExpr, ContextKeyAndExpr, ContextKeyEqualsExpr, RawContextKey, IContextKey, IContextKeyServiceTarget } from 'vs/platform/contextkey/common/contextkey';\nimport { HistoryInputBox, IHistoryInputOptions } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { FindInput, IFindInputOptions } from 'vs/base/browser/ui/findinput/findInput';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { IHistoryNavigationWidget } from 'vs/base/browser/history';\nimport { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\n\nexport const HistoryNavigationWidgetContext = 'historyNavigationWidget';\nexport const HistoryNavigationEnablementContext = 'historyNavigationEnabled';\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\ninterface IContextScopedHistoryNavigationWidget extends IContextScopedWidget {\n\thistoryNavigator: IHistoryNavigationWidget;\n}\n\nexport function createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService: IContextKeyService, widget: IContextScopedHistoryNavigationWidget): { scopedContextKeyService: IContextKeyService, historyNavigationEnablement: IContextKey<boolean> } {\n\tconst scopedContextKeyService = createWidgetScopedContextKeyService(contextKeyService, widget);\n\tbindContextScopedWidget(scopedContextKeyService, widget, HistoryNavigationWidgetContext);\n\tconst historyNavigationEnablement = new RawContextKey<boolean>(HistoryNavigationEnablementContext, true).bindTo(scopedContextKeyService);\n\treturn { scopedContextKeyService, historyNavigationEnablement };\n}\n\nexport class ContextScopedHistoryInputBox extends HistoryInputBox {\n\n\tconstructor(container: HTMLElement, contextViewProvider: IContextViewProvider | undefined, options: IHistoryInputOptions,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\t\tsuper(container, contextViewProvider, options);\n\t\tthis._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService, <IContextScopedHistoryNavigationWidget>{ target: this.element, historyNavigator: this }).scopedContextKeyService);\n\t}\n\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}\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'history.showPrevious',\n\tweight: KeybindingWeight.WorkbenchContrib,\n\twhen: ContextKeyExpr.and(new ContextKeyDefinedExpr(HistoryNavigationWidgetContext), new ContextKeyEqualsExpr(HistoryNavigationEnablementContext, true)),\n\tprimary: KeyCode.UpArrow,\n\tsecondary: [KeyMod.Alt | KeyCode.UpArrow],\n\thandler: (accessor, arg2) => {\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: new ContextKeyAndExpr([new ContextKeyDefinedExpr(HistoryNavigationWidgetContext), new ContextKeyEqualsExpr(HistoryNavigationEnablementContext, true)]),\n\tprimary: KeyCode.DownArrow,\n\tsecondary: [KeyMod.Alt | KeyCode.DownArrow],\n\thandler: (accessor, arg2) => {\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 { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { isUndefinedOrNull } from 'vs/base/common/types';\n\nexport const IStorageService = createDecorator<IStorageService>('storageService');\n\nexport interface IWillSaveStateEvent {\n}\n\nexport interface IStorageService {\n\t_serviceBrand: any;\n\n\t/**\n\t * Emitted whenever data is updated or deleted.\n\t */\n\treadonly onDidChangeStorage: Event<IWorkspaceStorageChangeEvent>;\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\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 * 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\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. The element\n\t * will be converted to a boolean.\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\tgetBoolean(key: string, scope: StorageScope, fallbackValue: boolean): boolean;\n\tgetBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined;\n\n\t/**\n\t * Store a value under the given key to storage. The value will be converted to a string.\n\t * Storing either undefined or null will remove the entry under the key.\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\tstore(key: string, value: string | boolean | number | undefined | null, 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 interface IWorkspaceStorageChangeEvent {\n\tkey: string;\n\tscope: StorageScope;\n}\n\nexport class InMemoryStorageService extends Disposable implements IStorageService {\n\t_serviceBrand = undefined;\n\n\tprivate readonly _onDidChangeStorage: Emitter<IWorkspaceStorageChangeEvent> = this._register(new Emitter<IWorkspaceStorageChangeEvent>());\n\tget onDidChangeStorage(): Event<IWorkspaceStorageChangeEvent> { return this._onDidChangeStorage.event; }\n\n\treadonly onWillSaveState = Event.None;\n\n\tprivate globalCache: Map<string, string> = new Map<string, string>();\n\tprivate workspaceCache: Map<string, string> = new Map<string, string>();\n\n\tprivate getCache(scope: StorageScope): Map<string, string> {\n\t\treturn scope === StorageScope.GLOBAL ? this.globalCache : this.workspaceCache;\n\t}\n\n\tget(key: string, scope: StorageScope, fallbackValue: string): string;\n\tget(key: string, scope: StorageScope, fallbackValue?: string): string | undefined {\n\t\tconst value = this.getCache(scope).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, scope: StorageScope, fallbackValue: boolean): boolean;\n\tgetBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined {\n\t\tconst value = this.getCache(scope).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\tstore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> {\n\n\t\t// We remove the key for undefined/null values\n\t\tif (isUndefinedOrNull(value)) {\n\t\t\treturn this.remove(key, scope);\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.getCache(scope).get(key);\n\t\tif (currentValue === valueStr) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\t// Update in cache\n\t\tthis.getCache(scope).set(key, valueStr);\n\n\t\t// Events\n\t\tthis._onDidChangeStorage.fire({ scope, key });\n\n\t\treturn Promise.resolve();\n\t}\n\n\tremove(key: string, scope: StorageScope): Promise<void> {\n\t\tconst wasDeleted = this.getCache(scope).delete(key);\n\t\tif (!wasDeleted) {\n\t\t\treturn Promise.resolve(); // Return early if value already deleted\n\t\t}\n\n\t\t// Events\n\t\tthis._onDidChangeStorage.fire({ scope, key });\n\n\t\treturn Promise.resolve();\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 { ITextModel } from 'vs/editor/common/model';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { ICodeLensData } from 'vs/editor/contrib/codelens/codelens';\nimport { LRUCache, values } from 'vs/base/common/map';\nimport { ICodeLensSymbol, CodeLensProvider } from 'vs/editor/common/modes';\nimport { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';\nimport { Range } from 'vs/editor/common/core/range';\n\nexport const ICodeLensCache = createDecorator<ICodeLensCache>('ICodeLensCache');\n\nexport interface ICodeLensCache {\n\t_serviceBrand: any;\n\tput(model: ITextModel, data: ICodeLensData[]): void;\n\tget(model: ITextModel): ICodeLensData[] | 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: ICodeLensData[]\n\t) { }\n}\n\nexport class CodeLensCache implements ICodeLensCache {\n\n\t_serviceBrand: any;\n\n\tprivate readonly _fakeProvider = new class implements CodeLensProvider {\n\t\tprovideCodeLenses(): ICodeLensSymbol[] {\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\tconst key = 'codelens/cache';\n\n\t\t// restore lens data on start\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\tconst listener = storageService.onWillSaveState(() => {\n\t\t\tstorageService.store(key, this._serialize(), StorageScope.WORKSPACE);\n\t\t\tlistener.dispose();\n\t\t});\n\t}\n\n\tput(model: ITextModel, data: ICodeLensData[]): void {\n\t\tconst item = new CacheItem(model.getLineCount(), data.map(item => {\n\t\t\treturn {\n\t\t\t\tsymbol: item.symbol,\n\t\t\t\tprovider: this._fakeProvider\n\t\t\t};\n\t\t}));\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\tthis._cache.forEach((value, key) => {\n\t\t\tconst lines = new Set<number>();\n\t\t\tfor (const d of value.data) {\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: values(lines)\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 symbols: ICodeLensData[] = [];\n\t\t\t\tfor (const line of element.lines) {\n\t\t\t\t\tsymbols.push({\n\t\t\t\t\t\tprovider: this._fakeProvider,\n\t\t\t\t\t\tsymbol: { range: new Range(line, 1, line, 11) }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._cache.set(key, new CacheItem(element.lineCount, symbols));\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 { LRUCache, TernarySearchTree } from 'vs/base/common/map';\nimport { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { CompletionItemKind, completionKindFromString } from 'vs/editor/common/modes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\nimport { CompletionItem } from 'vs/editor/contrib/suggest/suggest';\n\nexport abstract class Memory {\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;\n\t\tfor (let i = 1; i < items.length; i++) {\n\t\t\tconst { score, completion: suggestion } = items[i];\n\t\t\tif (score !== 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\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\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 { label } = item.completion;\n\t\tconst key = `${model.getLanguageIdentifier().language}/${label}`;\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\tselect(model: ITextModel, pos: IPosition, items: CompletionItem[]): number {\n\t\t// in order of completions, select the first\n\t\t// that has been used in the past\n\t\tlet { word } = model.getWordUntilPosition(pos);\n\t\tif (word.length !== 0) {\n\t\t\treturn super.select(model, pos, items);\n\t\t}\n\n\t\tlet 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 res = -1;\n\t\tlet seq = -1;\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst { completion: suggestion } = items[i];\n\t\t\tconst key = `${model.getLanguageIdentifier().language}/${suggestion.label}`;\n\t\t\tconst item = this._cache.get(key);\n\t\t\tif (item && item.touch > seq && item.type === suggestion.kind && item.insertText === suggestion.insertText) {\n\t\t\t\tseq = item.touch;\n\t\t\t\tres = i;\n\t\t\t}\n\t\t}\n\t\tif (res === -1) {\n\t\t\treturn super.select(model, pos, items);\n\t\t} else {\n\t\t\treturn res;\n\t\t}\n\t}\n\n\ttoJSON(): object {\n\t\tlet data: [string, MemItem][] = [];\n\t\tthis._cache.forEach((value, key) => {\n\t\t\tdata.push([key, value]);\n\t\t});\n\t\treturn data;\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 : completionKindFromString(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\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.getLanguageIdentifier().language}/${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\tselect(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.getLanguageIdentifier().language}/${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 : completionKindFromString(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 extends Disposable implements ISuggestMemoryService {\n\n\treadonly _serviceBrand: any;\n\n\tprivate readonly _storagePrefix = 'suggest/memories';\n\n\tprivate readonly _persistSoon: RunOnceScheduler;\n\tprivate _mode: MemMode;\n\tprivate _shareMem: boolean;\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\tsuper();\n\n\t\tconst update = () => {\n\t\t\tconst mode = this._configService.getValue<MemMode>('editor.suggestSelection');\n\t\t\tconst share = this._configService.getValue<boolean>('editor.suggest.shareSuggestSelections');\n\t\t\tthis._update(mode, share, false);\n\t\t};\n\n\t\tthis._persistSoon = this._register(new RunOnceScheduler(() => this._saveState(), 500));\n\t\tthis._register(_storageService.onWillSaveState(() => this._saveState()));\n\n\t\tthis._register(this._configService.onDidChangeConfiguration(e => {\n\t\t\tif (e.affectsConfiguration('editor.suggestSelection') || e.affectsConfiguration('editor.suggest.shareSuggestSelections')) {\n\t\t\t\tupdate();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._storageService.onDidChangeStorage(e => {\n\t\t\tif (e.scope === StorageScope.GLOBAL && e.key.indexOf(this._storagePrefix) === 0) {\n\t\t\t\tif (!document.hasFocus()) {\n\t\t\t\t\t// windows that aren't focused have to drop their current\n\t\t\t\t\t// storage value and accept what's stored now\n\t\t\t\t\tthis._update(this._mode, this._shareMem, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tupdate();\n\t}\n\n\tprivate _update(mode: MemMode, shareMem: boolean, force: boolean): void {\n\t\tif (!force && this._mode === mode && this._shareMem === shareMem) {\n\t\t\treturn;\n\t\t}\n\t\tthis._shareMem = shareMem;\n\t\tthis._mode = mode;\n\t\tthis._strategy = mode === 'recentlyUsedByPrefix' ? new PrefixMemory() : mode === 'recentlyUsed' ? new LRUMemory() : new NoMemory();\n\n\t\ttry {\n\t\t\tconst scope = shareMem ? StorageScope.GLOBAL : StorageScope.WORKSPACE;\n\t\t\tconst raw = this._storageService.get(`${this._storagePrefix}/${this._mode}`, scope);\n\t\t\tif (raw) {\n\t\t\t\tthis._strategy.fromJSON(JSON.parse(raw));\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// things can go wrong with JSON...\n\t\t}\n\t}\n\n\tmemorize(model: ITextModel, pos: IPosition, item: CompletionItem): void {\n\t\tthis._strategy.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._strategy.select(model, pos, items);\n\t}\n\n\tprivate _saveState() {\n\t\tconst raw = JSON.stringify(this._strategy);\n\t\tconst scope = this._shareMem ? StorageScope.GLOBAL : StorageScope.WORKSPACE;\n\t\tthis._storageService.store(`${this._storagePrefix}/${this._mode}`, raw, scope);\n\t}\n}\n\n\nexport const ISuggestMemoryService = createDecorator<ISuggestMemoryService>('ISuggestMemories');\n\nexport interface ISuggestMemoryService {\n\t_serviceBrand: any;\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';\n\nexport const ITelemetryService = createDecorator<ITelemetryService>('telemetryService');\n\nexport interface ITelemetryData {\n\tfrom?: string;\n\t[key: string]: any;\n}\n\nexport interface ITelemetryService {\n\n\t_serviceBrand: any;\n\n\t/**\n\t * Sends a telemetry event that has been privacy approved.\n\t * Do not call this unless you have been given approval.\n\t */\n\tpublicLog(eventName: string, data?: ITelemetryData, 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 { IPosition } from 'vs/base/browser/ui/contextview/contextview';\nimport { illegalArgument } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IModelService } from 'vs/editor/common/services/modelService';\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 } from 'vs/platform/contextkey/common/contextkey';\nimport { IConstructorSignature1, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindings, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { Registry } from 'vs/platform/registry/common/platform';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { withNullAsUndefined } from 'vs/base/common/types';\n\nexport type ServicesAccessor = ServicesAccessor;\nexport type IEditorContributionCtor = IConstructorSignature1<ICodeEditor, IEditorContribution>;\n\n//#region Command\n\nexport interface ICommandKeybindingsOptions extends IKeybindings {\n\tkbExpr?: ContextKeyExpr | null;\n\tweight: number;\n}\nexport interface ICommandMenubarOptions {\n\tmenuId: MenuId;\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpr;\n\ttitle: string;\n}\nexport interface ICommandOptions {\n\tid: string;\n\tprecondition: ContextKeyExpr | null;\n\tkbOpts?: ICommandKeybindingsOptions | null;\n\tdescription?: ICommandHandlerDescription;\n\tmenubarOpts?: ICommandMenubarOptions;\n}\nexport abstract class Command {\n\tpublic readonly id: string;\n\tpublic readonly precondition: ContextKeyExpr | null;\n\tprivate readonly _kbOpts: ICommandKeybindingsOptions | null | undefined;\n\tprivate readonly _menubarOpts: ICommandMenubarOptions | null | undefined;\n\tprivate readonly _description: ICommandHandlerDescription | null | 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._menubarOpts = opts.menubarOpts;\n\t\tthis._description = opts.description;\n\t}\n\n\tpublic register(): void {\n\n\t\tif (this._menubarOpts) {\n\t\t\tMenuRegistry.appendMenuItem(this._menubarOpts.menuId, {\n\t\t\t\tgroup: this._menubarOpts.group,\n\t\t\t\tcommand: {\n\t\t\t\t\tid: this.id,\n\t\t\t\t\ttitle: this._menubarOpts.title,\n\t\t\t\t\t// precondition: this.precondition\n\t\t\t\t},\n\t\t\t\twhen: this._menubarOpts.when,\n\t\t\t\torder: this._menubarOpts.order\n\t\t\t});\n\t\t}\n\n\t\tif (this._kbOpts) {\n\t\t\tlet kbWhen = this._kbOpts.kbExpr;\n\t\t\tif (this.precondition) {\n\t\t\t\tif (kbWhen) {\n\t\t\t\t\tkbWhen = ContextKeyExpr.and(kbWhen, this.precondition);\n\t\t\t\t} else {\n\t\t\t\t\tkbWhen = this.precondition;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tKeybindingsRegistry.registerCommandAndKeybindingRule({\n\t\t\t\tid: this.id,\n\t\t\t\thandler: (accessor, args) => this.runCommand(accessor, args),\n\t\t\t\tweight: this._kbOpts.weight,\n\t\t\t\twhen: kbWhen,\n\t\t\t\tprimary: this._kbOpts.primary,\n\t\t\t\tsecondary: this._kbOpts.secondary,\n\t\t\t\twin: this._kbOpts.win,\n\t\t\t\tlinux: this._kbOpts.linux,\n\t\t\t\tmac: this._kbOpts.mac,\n\t\t\t\tdescription: this._description\n\t\t\t});\n\n\t\t} else {\n\n\t\t\tCommandsRegistry.registerCommand({\n\t\t\t\tid: this.id,\n\t\t\t\thandler: (accessor, args) => this.runCommand(accessor, args),\n\t\t\t\tdescription: this._description\n\t\t\t});\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 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): 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(controllerGetter(editor), 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 IEditorCommandMenuOptions {\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpr;\n}\nexport interface IActionOptions extends ICommandOptions {\n\tlabel: string;\n\talias: string;\n\tmenuOpts?: IEditorCommandMenuOptions;\n}\nexport abstract class EditorAction extends EditorCommand {\n\n\tpublic readonly label: string;\n\tpublic readonly alias: string;\n\tprivate readonly menuOpts: IEditorCommandMenuOptions | undefined;\n\n\tconstructor(opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis.label = opts.label;\n\t\tthis.alias = opts.alias;\n\t\tthis.menuOpts = opts.menuOpts;\n\t}\n\n\tpublic register(): void {\n\n\t\tif (this.menuOpts) {\n\t\t\tMenuRegistry.appendMenuItem(MenuId.EditorContext, {\n\t\t\t\tcommand: {\n\t\t\t\t\tid: this.id,\n\t\t\t\t\ttitle: this.label\n\t\t\t\t},\n\t\t\t\twhen: ContextKeyExpr.and(this.precondition, this.menuOpts.when),\n\t\t\t\tgroup: this.menuOpts.group,\n\t\t\t\torder: this.menuOpts.order\n\t\t\t});\n\t\t}\n\n\t\tsuper.register();\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\t/* __GDPR__\n\t\t\t\"editorActionInvoked\" : {\n\t\t\t\t\"name\" : { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" },\n\t\t\t\t\"id\": { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" },\n\t\t\t\t\"${include}\": [\n\t\t\t\t\t\"${EditorTelemetryData}\"\n\t\t\t\t]\n\t\t\t}\n\t\t*/\n\t\taccessor.get(ITelemetryService).publicLog('editorActionInvoked', { name: this.label, id: this.id, ...editor.getTelemetryData() });\n\t}\n\n\tpublic abstract run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void>;\n}\n\n//#endregion EditorAction\n\n// --- Registration of commands and actions\n\nexport function registerLanguageCommand(id: string, handler: (accessor: ServicesAccessor, args: { [n: string]: any }) => any) {\n\tCommandsRegistry.registerCommand(id, (accessor, args) => handler(accessor, args || {}));\n}\n\ninterface IDefaultArgs {\n\tresource: URI;\n\tposition: IPosition;\n\t[name: string]: any;\n}\n\nexport function registerDefaultLanguageCommand(id: string, handler: (model: ITextModel, position: Position, args: IDefaultArgs) => any) {\n\tregisterLanguageCommand(id, function (accessor, args: IDefaultArgs) {\n\n\t\tconst { resource, position } = args;\n\t\tif (!(resource instanceof URI)) {\n\t\t\tthrow illegalArgument('resource');\n\t\t}\n\t\tif (!Position.isIPosition(position)) {\n\t\t\tthrow illegalArgument('position');\n\t\t}\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 handler(model, editorPosition, args);\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 = handler(reference.object.textEditorModel, Position.lift(position), args);\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(ctor: { new(): EditorAction; }): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(new ctor());\n}\n\nexport function registerInstantiatedEditorAction(editorAction: EditorAction): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(editorAction);\n}\n\nexport function registerEditorContribution(ctor: IEditorContributionCtor): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorContribution(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(): IEditorContributionCtor[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions();\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: IEditorContributionCtor[];\n\tprivate readonly editorActions: EditorAction[];\n\tprivate readonly editorCommands: { [commandId: string]: EditorCommand; };\n\n\tconstructor() {\n\t\tthis.editorContributions = [];\n\t\tthis.editorActions = [];\n\t\tthis.editorCommands = Object.create(null);\n\t}\n\n\tpublic registerEditorContribution(ctor: IEditorContributionCtor): void {\n\t\tthis.editorContributions.push(ctor);\n\t}\n\n\tpublic registerEditorAction(action: EditorAction) {\n\t\taction.register();\n\t\tthis.editorActions.push(action);\n\t}\n\n\tpublic getEditorContributions(): IEditorContributionCtor[] {\n\t\treturn this.editorContributions.slice(0);\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport * as types from 'vs/base/common/types';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Command, EditorCommand, ICommandOptions, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { ColumnSelection, IColumnSelectResult } from 'vs/editor/common/controller/cursorColumnSelection';\nimport { CursorContext, CursorState, EditOperationType, IColumnSelectData, ICursors, PartialCursorState, RevealTarget } from 'vs/editor/common/controller/cursorCommon';\nimport { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperations';\nimport { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';\nimport { CursorMove as CursorMove_, CursorMoveCommands } from 'vs/editor/common/controller/cursorMoveCommands';\nimport { TypeOperations } from 'vs/editor/common/controller/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/view/viewEvents';\nimport { MenuId } from 'vs/platform/actions/common/actions';\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 } from 'vs/platform/keybinding/common/keybindingsRegistry';\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 cursors = editor._getCursors();\n\t\tif (!cursors) {\n\t\t\t// the editor has no view => has no cursors\n\t\t\treturn;\n\t\t}\n\t\tthis.runCoreEditorCommand(cursors, args || {});\n\t}\n\n\tpublic abstract runCoreEditorCommand(cursors: ICursors, 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)) {\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',\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;\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\nexport namespace CoreNavigationCommands {\n\n\tclass BaseMoveToCommand 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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.moveTo(cursors.context, cursors.getPrimaryCursor(), this._inSelectionMode, args.position, args.viewPosition)\n\t\t\t\t]\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\n\t\t}\n\t}\n\n\texport const MoveTo: CoreEditorCommand = registerEditorCommand(new BaseMoveToCommand({\n\t\tid: '_moveTo',\n\t\tinSelectionMode: false,\n\t\tprecondition: null\n\t}));\n\n\texport const MoveToSelect: CoreEditorCommand = registerEditorCommand(new BaseMoveToCommand({\n\t\tid: '_moveToSelect',\n\t\tinSelectionMode: true,\n\t\tprecondition: null\n\t}));\n\n\tabstract class ColumnSelectCommand extends CoreEditorCommand {\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tconst result = this._getColumnSelectResult(cursors.context, cursors.getPrimaryCursor(), cursors.getColumnSelectData(), args);\n\t\t\tcursors.setStates(args.source, CursorChangeReason.Explicit, result.viewStates.map((viewState) => CursorState.fromViewState(viewState)));\n\t\t\tcursors.setColumnSelectData({\n\t\t\t\ttoViewLineNumber: result.toLineNumber,\n\t\t\t\ttoViewVisualColumn: result.toVisualColumn\n\t\t\t});\n\t\t\tcursors.reveal(true, (result.reversed ? RevealTarget.TopMost : RevealTarget.BottomMost), ScrollType.Smooth);\n\t\t}\n\n\t\tprotected abstract _getColumnSelectResult(context: CursorContext, 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: null\n\t\t\t});\n\t\t}\n\n\t\tprotected _getColumnSelectResult(context: CursorContext, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\n\t\t\t// validate `args`\n\t\t\tconst validatedPosition = context.model.validatePosition(args.position);\n\n\t\t\tlet validatedViewPosition: Position;\n\t\t\tif (args.viewPosition) {\n\t\t\t\tvalidatedViewPosition = context.validateViewPosition(new Position(args.viewPosition.lineNumber, args.viewPosition.column), validatedPosition);\n\t\t\t} else {\n\t\t\t\tvalidatedViewPosition = context.convertModelPositionToViewPosition(validatedPosition);\n\t\t\t}\n\n\t\t\treturn ColumnSelection.columnSelect(context.config, context.viewModel, primary.viewState.selection, 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: null,\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(context: CursorContext, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectLeft(context.config, context.viewModel, primary.viewState, prevColumnSelectData.toViewLineNumber, prevColumnSelectData.toViewVisualColumn);\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: null,\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(context: CursorContext, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectRight(context.config, context.viewModel, primary.viewState, prevColumnSelectData.toViewLineNumber, prevColumnSelectData.toViewVisualColumn);\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(context: CursorContext, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectUp(context.config, context.viewModel, primary.viewState, this._isPaged, prevColumnSelectData.toViewLineNumber, prevColumnSelectData.toViewVisualColumn);\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: null,\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: null,\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(context: CursorContext, primary: CursorState, prevColumnSelectData: IColumnSelectData, args: any): IColumnSelectResult {\n\t\t\treturn ColumnSelection.columnSelectDown(context.config, context.viewModel, primary.viewState, this._isPaged, prevColumnSelectData.toViewLineNumber, prevColumnSelectData.toViewVisualColumn);\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: null,\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: null,\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: null,\n\t\t\t\tdescription: CursorMove_.description\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, 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(cursors, args.source, parsed);\n\t\t}\n\n\t\t_runCursorMove(cursors: ICursors, source: string, args: CursorMove_.ParsedArguments): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\tsource,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.move(cursors.context, cursors.getAll(), args)\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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_.ParsedArguments;\n\n\t\tconstructor(opts: ICommandOptions & { args: CursorMove_.ParsedArguments }) {\n\t\t\tsuper(opts);\n\t\t\tthis._staticArgs = opts.args;\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, 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: cursors.context.config.pageSize\n\t\t\t\t};\n\t\t\t}\n\t\t\tCursorMove._runCursorMove(cursors, dynamicArgs.source, args);\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: null,\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.KEY_B] }\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: null,\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: null,\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.KEY_F] }\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: null,\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: null,\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.KEY_P] }\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: null,\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: null,\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: null,\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: null,\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.KEY_N] }\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: null,\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: null,\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: null,\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: null\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tconst context = cursors.context;\n\n\t\t\tlet newState: PartialCursorState;\n\t\t\tif (args.wholeLine) {\n\t\t\t\tnewState = CursorMoveCommands.line(context, cursors.getPrimaryCursor(), false, args.position, args.viewPosition);\n\t\t\t} else {\n\t\t\t\tnewState = CursorMoveCommands.moveTo(context, cursors.getPrimaryCursor(), false, args.position, args.viewPosition);\n\t\t\t}\n\n\t\t\tconst states: PartialCursorState[] = cursors.getAll();\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\tcursors.context.model.pushStackElement();\n\t\t\t\t\tcursors.setStates(\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\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\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: null\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tconst context = cursors.context;\n\n\t\t\tconst lastAddedCursorIndex = cursors.getLastAddedCursorIndex();\n\n\t\t\tconst states = cursors.getAll();\n\t\t\tconst newStates: PartialCursorState[] = states.slice(0);\n\t\t\tnewStates[lastAddedCursorIndex] = CursorMoveCommands.moveTo(context, states[lastAddedCursorIndex], true, args.position, args.viewPosition);\n\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToBeginningOfLine(cursors.context, cursors.getAll(), this._inSelectionMode)\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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: null,\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: null,\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\texport const CursorLineStart: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'cursorLineStart',\n\t\t\t\tprecondition: null,\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.KEY_A }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tthis._exec(cursors.context, cursors.getAll())\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\n\t\t}\n\n\t\tprivate _exec(context: CursorContext, 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(false, lineNumber, 1, 0));\n\t\t\t}\n\t\t\treturn result;\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToEndOfLine(cursors.context, cursors.getAll(), this._inSelectionMode)\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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: null,\n\t\tkbOpts: {\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}));\n\n\texport const CursorEndSelect: CoreEditorCommand = registerEditorCommand(new EndCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'cursorEndSelect',\n\t\tprecondition: null,\n\t\tkbOpts: {\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}));\n\n\texport const CursorLineEnd: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'cursorLineEnd',\n\t\t\t\tprecondition: null,\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.KEY_E }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tthis._exec(cursors.context, cursors.getAll())\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\n\t\t}\n\n\t\tprivate _exec(context: CursorContext, 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 = context.model.getLineMaxColumn(lineNumber);\n\t\t\t\tresult[i] = CursorState.fromModelState(cursor.modelState.move(false, lineNumber, maxColumn, 0));\n\t\t\t}\n\t\t\treturn result;\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToBeginningOfBuffer(cursors.context, cursors.getAll(), this._inSelectionMode)\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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: null,\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: null,\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.moveToEndOfBuffer(cursors.context, cursors.getAll(), this._inSelectionMode)\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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: null,\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: null,\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: null,\n\t\t\t\tdescription: EditorScroll_.description\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, 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(cursors, args.source, parsed);\n\t\t}\n\n\t\t_runEditorScroll(cursors: ICursors, source: string, args: EditorScroll_.ParsedArguments): void {\n\n\t\t\tconst desiredScrollTop = this._computeDesiredScrollTop(cursors.context, 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 = cursors.context.getCompletelyVisibleViewRangeAtScrollTop(desiredScrollTop);\n\t\t\t\tcursors.setStates(\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(cursors.context, cursors.getPrimaryCursor(), desiredVisibleViewRange, args.select)\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcursors.scrollTo(desiredScrollTop);\n\t\t}\n\n\t\tprivate _computeDesiredScrollTop(context: CursorContext, 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 visibleModelRange = context.getCompletelyVisibleModelRange();\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(context.model.getLineCount(), visibleModelRange.startLineNumber + args.value);\n\t\t\t\t}\n\n\t\t\t\tconst desiredTopViewPosition = context.convertModelPositionToViewPosition(new Position(desiredTopModelLineNumber, 1));\n\t\t\t\treturn context.getVerticalOffsetForViewLine(desiredTopViewPosition.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 = context.config.pageSize * args.value;\n\t\t\t} else if (args.unit === EditorScroll_.Unit.HalfPage) {\n\t\t\t\tnoOfLines = Math.round(context.config.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 context.getCurrentScrollTop() + deltaLines * context.config.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: null,\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(cursors: ICursors, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(cursors, 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: null,\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(cursors: ICursors, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(cursors, 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: null,\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(cursors: ICursors, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(cursors, 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: null,\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(cursors: ICursors, args: any): void {\n\t\t\tEditorScroll._runEditorScroll(cursors, 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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.word(cursors.context, cursors.getPrimaryCursor(), this._inSelectionMode, args.position)\n\t\t\t\t]\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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: null\n\t}));\n\n\texport const WordSelectDrag: CoreEditorCommand = registerEditorCommand(new WordCommand({\n\t\tinSelectionMode: true,\n\t\tid: '_wordSelectDrag',\n\t\tprecondition: null\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: null\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tconst context = cursors.context;\n\n\t\t\tconst lastAddedCursorIndex = cursors.getLastAddedCursorIndex();\n\n\t\t\tconst states = cursors.getAll();\n\t\t\tconst newStates: PartialCursorState[] = states.slice(0);\n\t\t\tconst lastAddedState = states[lastAddedCursorIndex];\n\t\t\tnewStates[lastAddedCursorIndex] = CursorMoveCommands.word(context, lastAddedState, lastAddedState.modelState.hasSelection(), args.position);\n\n\t\t\tcontext.model.pushStackElement();\n\t\t\tcursors.setStates(\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.line(cursors.context, cursors.getPrimaryCursor(), this._inSelectionMode, args.position, args.viewPosition)\n\t\t\t\t]\n\t\t\t);\n\t\t\tcursors.reveal(false, RevealTarget.Primary, ScrollType.Smooth);\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: null\n\t}));\n\n\texport const LineSelectDrag: CoreEditorCommand = registerEditorCommand(new LineCommand({\n\t\tinSelectionMode: true,\n\t\tid: '_lineSelectDrag',\n\t\tprecondition: null\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(cursors: ICursors, args: any): void {\n\t\t\tconst lastAddedCursorIndex = cursors.getLastAddedCursorIndex();\n\n\t\t\tconst states = cursors.getAll();\n\t\t\tconst newStates: PartialCursorState[] = states.slice(0);\n\t\t\tnewStates[lastAddedCursorIndex] = CursorMoveCommands.line(cursors.context, states[lastAddedCursorIndex], this._inSelectionMode, args.position, args.viewPosition);\n\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\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: null\n\t}));\n\n\texport const LastCursorLineSelectDrag: CoreEditorCommand = registerEditorCommand(new LastCursorLineCommand({\n\t\tinSelectionMode: true,\n\t\tid: 'lastCursorLineSelectDrag',\n\t\tprecondition: null\n\t}));\n\n\texport const ExpandLineSelection: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'expandLineSelection',\n\t\t\t\tprecondition: null,\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.KEY_L\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\tCursorMoveCommands.expandLineSelection(cursors.context, cursors.getAll())\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\n\t\t}\n\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.cancelSelection(cursors.context, cursors.getPrimaryCursor())\n\t\t\t\t]\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tcursors.getPrimaryCursor()\n\t\t\t\t]\n\t\t\t);\n\t\t\tcursors.reveal(true, RevealTarget.Primary, ScrollType.Smooth);\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: null,\n\t\t\t\tdescription: RevealLine_.description\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tconst revealLineArg = <RevealLine_.RawArguments>args;\n\t\t\tlet lineNumber = (revealLineArg.lineNumber || 0) + 1;\n\t\t\tif (lineNumber < 1) {\n\t\t\t\tlineNumber = 1;\n\t\t\t}\n\t\t\tconst lineCount = cursors.context.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, cursors.context.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 = cursors.context.convertModelRangeToViewRange(range);\n\n\t\t\tcursors.revealRange(false, viewRange, revealAt, ScrollType.Smooth);\n\t\t}\n\t});\n\n\texport const SelectAll: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {\n\t\tconstructor() {\n\t\t\tsuper({\n\t\t\t\tid: 'selectAll',\n\t\t\t\tprecondition: null\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\n\t\t\t\targs.source,\n\t\t\t\tCursorChangeReason.Explicit,\n\t\t\t\t[\n\t\t\t\t\tCursorMoveCommands.selectAll(cursors.context, cursors.getPrimaryCursor())\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: null\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditorCommand(cursors: ICursors, args: any): void {\n\t\t\tcursors.context.model.pushStackElement();\n\t\t\tcursors.setStates(\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\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 cursors = editor._getCursors();\n\t\t\tif (!cursors) {\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, cursors, args || {});\n\t\t}\n\n\t\tpublic abstract runCoreEditingCommand(editor: ICodeEditor, cursors: ICursors, 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.KEY_O }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, cursors: ICursors, args: any): void {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, TypeOperations.lineBreakInsert(cursors.context.config, cursors.context.model, cursors.getAll().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, cursors: ICursors, args: any): void {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, TypeOperations.outdent(cursors.context.config, cursors.context.model, cursors.getAll().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, cursors: ICursors, args: any): void {\n\t\t\teditor.pushUndoStop();\n\t\t\teditor.executeCommands(this.id, TypeOperations.tab(cursors.context.config, cursors.context.model, cursors.getAll().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: 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: 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.KEY_H, KeyMod.WinCtrl | KeyCode.Backspace] }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, cursors: ICursors, args: any): void {\n\t\t\tconst [shouldPushStackElementBefore, commands] = DeleteOperations.deleteLeft(cursors.getPrevEditOperationType(), cursors.context.config, cursors.context.model, cursors.getAll().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\tcursors.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: 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: KeyCode.Delete,\n\t\t\t\t\tmac: { primary: KeyCode.Delete, secondary: [KeyMod.WinCtrl | KeyCode.KEY_D, KeyMod.WinCtrl | KeyCode.Delete] }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic runCoreEditingCommand(editor: ICodeEditor, cursors: ICursors, args: any): void {\n\t\t\tconst [shouldPushStackElementBefore, commands] = DeleteOperations.deleteRight(cursors.getPrevEditOperationType(), cursors.context.config, cursors.context.model, cursors.getAll().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\tcursors.setPrevEditOperationType(EditOperationType.DeletingRight);\n\t\t}\n\t});\n\n}\n\nfunction registerCommand(command: Command) {\n\tcommand.register();\n}\n\n/**\n * A command that will:\n * 1. invoke a command on the focused editor.\n * 2. otherwise, invoke a browser built-in command on the `activeElement`.\n * 3. otherwise, invoke a command on the workbench active editor.\n */\nclass EditorOrNativeTextInputCommand extends Command {\n\n\tprivate readonly _editorHandler: string | EditorCommand;\n\tprivate readonly _inputHandler: string;\n\n\tconstructor(opts: ICommandOptions & { editorHandler: string | EditorCommand; inputHandler: string; }) {\n\t\tsuper(opts);\n\t\tthis._editorHandler = opts.editorHandler;\n\t\tthis._inputHandler = opts.inputHandler;\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void {\n\n\t\tconst focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tif (focusedEditor && focusedEditor.hasTextFocus()) {\n\t\t\treturn this._runEditorHandler(accessor, focusedEditor, args);\n\t\t}\n\n\t\t// Ignore this action when user is focused on an element that allows for entering text\n\t\tconst activeElement = <HTMLElement>document.activeElement;\n\t\tif (activeElement && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) {\n\t\t\tdocument.execCommand(this._inputHandler);\n\t\t\treturn;\n\t\t}\n\n\t\t// Redirecting to active editor\n\t\tconst activeEditor = accessor.get(ICodeEditorService).getActiveCodeEditor();\n\t\tif (activeEditor) {\n\t\t\tactiveEditor.focus();\n\t\t\treturn this._runEditorHandler(accessor, activeEditor, args);\n\t\t}\n\t}\n\n\tprivate _runEditorHandler(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\tconst HANDLER = this._editorHandler;\n\t\tif (typeof HANDLER === 'string') {\n\t\t\teditor.trigger('keyboard', HANDLER, args);\n\t\t} else {\n\t\t\targs = args || {};\n\t\t\targs.source = 'keyboard';\n\t\t\tHANDLER.runEditorCommand(accessor, editor, args);\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: null,\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\nregisterCommand(new EditorOrNativeTextInputCommand({\n\teditorHandler: CoreNavigationCommands.SelectAll,\n\tinputHandler: 'selectAll',\n\tid: 'editor.action.selectAll',\n\tprecondition: EditorContextKeys.textInputFocus,\n\tkbOpts: {\n\t\tweight: CORE_WEIGHT,\n\t\tkbExpr: null,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_A\n\t},\n\tmenubarOpts: {\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}));\n\nregisterCommand(new EditorOrNativeTextInputCommand({\n\teditorHandler: Handler.Undo,\n\tinputHandler: 'undo',\n\tid: Handler.Undo,\n\tprecondition: EditorContextKeys.writable,\n\tkbOpts: {\n\t\tweight: CORE_WEIGHT,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_Z\n\t},\n\tmenubarOpts: {\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}));\nregisterCommand(new EditorHandlerCommand('default:' + Handler.Undo, Handler.Undo));\n\nregisterCommand(new EditorOrNativeTextInputCommand({\n\teditorHandler: Handler.Redo,\n\tinputHandler: 'redo',\n\tid: Handler.Redo,\n\tprecondition: EditorContextKeys.writable,\n\tkbOpts: {\n\t\tweight: CORE_WEIGHT,\n\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_Y,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z],\n\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z }\n\t},\n\tmenubarOpts: {\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}));\nregisterCommand(new EditorHandlerCommand('default:' + Handler.Redo, Handler.Redo));\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.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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { CoreEditorCommand, CoreNavigationCommands } from 'vs/editor/browser/controller/coreCommands';\nimport { IEditorMouseEvent, IPartialEditorMouseEvent } from 'vs/editor/browser/editorBrowser';\nimport { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IConfiguration } from 'vs/editor/common/editorCommon';\nimport { IViewModel } from 'vs/editor/common/viewModel/viewModel';\nimport { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\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}\n\nexport interface ICommandDelegate {\n\texecuteEditorCommand(editorCommand: CoreEditorCommand, args: any): void;\n\n\tpaste(source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null): void;\n\ttype(source: string, text: string): void;\n\treplacePreviousChar(source: string, text: string, replaceCharCnt: number): void;\n\tcompositionStart(source: string): void;\n\tcompositionEnd(source: string): void;\n\tcut(source: string): void;\n}\n\nexport class ViewController {\n\n\tprivate readonly configuration: IConfiguration;\n\tprivate readonly viewModel: IViewModel;\n\tprivate readonly outgoingEvents: ViewOutgoingEvents;\n\tprivate readonly commandDelegate: ICommandDelegate;\n\n\tconstructor(\n\t\tconfiguration: IConfiguration,\n\t\tviewModel: IViewModel,\n\t\toutgoingEvents: ViewOutgoingEvents,\n\t\tcommandDelegate: ICommandDelegate\n\t) {\n\t\tthis.configuration = configuration;\n\t\tthis.viewModel = viewModel;\n\t\tthis.outgoingEvents = outgoingEvents;\n\t\tthis.commandDelegate = commandDelegate;\n\t}\n\n\tprivate _execMouseCommand(editorCommand: CoreEditorCommand, args: any): void {\n\t\targs.source = 'mouse';\n\t\tthis.commandDelegate.executeEditorCommand(editorCommand, args);\n\t}\n\n\tpublic paste(source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null): void {\n\t\tthis.commandDelegate.paste(source, text, pasteOnNewLine, multicursorText);\n\t}\n\n\tpublic type(source: string, text: string): void {\n\t\tthis.commandDelegate.type(source, text);\n\t}\n\n\tpublic replacePreviousChar(source: string, text: string, replaceCharCnt: number): void {\n\t\tthis.commandDelegate.replacePreviousChar(source, text, replaceCharCnt);\n\t}\n\n\tpublic compositionStart(source: string): void {\n\t\tthis.commandDelegate.compositionStart(source);\n\t}\n\n\tpublic compositionEnd(source: string): void {\n\t\tthis.commandDelegate.compositionEnd(source);\n\t}\n\n\tpublic cut(source: string): void {\n\t\tthis.commandDelegate.cut(source);\n\t}\n\n\tpublic setSelection(source: string, modelSelection: Selection): void {\n\t\tthis.commandDelegate.executeEditorCommand(CoreNavigationCommands.SetSelection, {\n\t\t\tsource: source,\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.editor.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}\n\t\treturn false;\n\t}\n\n\tprivate _hasNonMulticursorModifier(data: IMouseDispatchData): boolean {\n\t\tswitch (this.configuration.editor.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}\n\t\treturn false;\n\t}\n\n\tpublic dispatchMouse(data: IMouseDispatchData): void {\n\t\tif (data.middleButton) {\n\t\t\tif (data.inSelectionMode) {\n\t\t\t\tthis._columnSelect(data.position, data.mouseColumn);\n\t\t\t} else {\n\t\t\t\tthis.moveTo(data.position);\n\t\t\t}\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 (this._hasMulticursorModifier(data)) {\n\t\t\t\tthis._lastCursorWordSelect(data.position);\n\t\t\t} else {\n\t\t\t\tif (data.inSelectionMode) {\n\t\t\t\t\tthis._wordSelectDrag(data.position);\n\t\t\t\t} else {\n\t\t\t\t\tthis._wordSelect(data.position);\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);\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);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._moveToSelect(data.position);\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\tposition: this._convertViewToModelPosition(viewPosition),\n\t\t\tviewPosition: viewPosition\n\t\t};\n\t}\n\n\tpublic moveTo(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.MoveTo, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _moveToSelect(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.MoveToSelect, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _columnSelect(viewPosition: Position, mouseColumn: number): void {\n\t\tviewPosition = this._validateViewColumn(viewPosition);\n\t\tthis._execMouseCommand(CoreNavigationCommands.ColumnSelect, {\n\t\t\tposition: this._convertViewToModelPosition(viewPosition),\n\t\t\tviewPosition: viewPosition,\n\t\t\tmouseColumn: mouseColumn\n\t\t});\n\t}\n\n\tprivate _createCursor(viewPosition: Position, wholeLine: boolean): void {\n\t\tviewPosition = this._validateViewColumn(viewPosition);\n\t\tthis._execMouseCommand(CoreNavigationCommands.CreateCursor, {\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\tthis._execMouseCommand(CoreNavigationCommands.LastCursorMoveToSelect, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _wordSelect(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.WordSelect, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _wordSelectDrag(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.WordSelectDrag, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lastCursorWordSelect(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.LastCursorWordSelect, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lineSelect(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.LineSelect, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lineSelectDrag(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.LineSelectDrag, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lastCursorLineSelect(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.LastCursorLineSelect, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _lastCursorLineSelectDrag(viewPosition: Position): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.LastCursorLineSelectDrag, this._usualArgs(viewPosition));\n\t}\n\n\tprivate _selectAll(): void {\n\t\tthis._execMouseCommand(CoreNavigationCommands.SelectAll, {});\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.outgoingEvents.emitKeyDown(e);\n\t}\n\n\tpublic emitKeyUp(e: IKeyboardEvent): void {\n\t\tthis.outgoingEvents.emitKeyUp(e);\n\t}\n\n\tpublic emitContextMenu(e: IEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitContextMenu(e);\n\t}\n\n\tpublic emitMouseMove(e: IEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitMouseMove(e);\n\t}\n\n\tpublic emitMouseLeave(e: IPartialEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitMouseLeave(e);\n\t}\n\n\tpublic emitMouseUp(e: IEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitMouseUp(e);\n\t}\n\n\tpublic emitMouseDown(e: IEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitMouseDown(e);\n\t}\n\n\tpublic emitMouseDrag(e: IEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitMouseDrag(e);\n\t}\n\n\tpublic emitMouseDrop(e: IPartialEditorMouseEvent): void {\n\t\tthis.outgoingEvents.emitMouseDrop(e);\n\t}\n\n\tpublic emitMouseWheel(e: IMouseWheelEvent): void {\n\t\tthis.outgoingEvents.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 nls from 'vs/nls';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, ServicesAccessor, registerEditorAction } 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/moveCaretCommand';\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\tlet commands: ICommand[] = [];\n\t\tlet 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 Caret Left\"),\n\t\t\talias: 'Move Caret 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 Caret Right\"),\n\t\t\talias: 'Move Caret 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 * as nls from 'vs/nls';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { isHighSurrogate, isLowSurrogate } from 'vs/base/common/strings';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';\nimport { IPosition, Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nclass TransposeLettersAction extends EditorAction {\n\n\tprivate positionLeftOf(start: IPosition, model: ITextModel): Position {\n\t\tlet column = start.column;\n\t\tlet lineNumber = start.lineNumber;\n\n\t\tif (column > model.getLineMinColumn(lineNumber)) {\n\t\t\tif (isLowSurrogate(model.getLineContent(lineNumber).charCodeAt(column - 2))) {\n\t\t\t\t// character before column is a low surrogate\n\t\t\t\tcolumn = column - 2;\n\t\t\t} else {\n\t\t\t\tcolumn = column - 1;\n\t\t\t}\n\t\t} else if (lineNumber > 1) {\n\t\t\tlineNumber = lineNumber - 1;\n\t\t\tcolumn = model.getLineMaxColumn(lineNumber);\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\n\n\tprivate positionRightOf(start: IPosition, model: ITextModel): Position {\n\t\tlet column = start.column;\n\t\tlet lineNumber = start.lineNumber;\n\n\t\tif (column < model.getLineMaxColumn(lineNumber)) {\n\t\t\tif (isHighSurrogate(model.getLineContent(lineNumber).charCodeAt(column - 1))) {\n\t\t\t\t// character after column is a high surrogate\n\t\t\t\tcolumn = column + 2;\n\t\t\t} else {\n\t\t\t\tcolumn = column + 1;\n\t\t\t}\n\t\t} else if (lineNumber < model.getLineCount()) {\n\t\t\tlineNumber = lineNumber + 1;\n\t\t\tcolumn = 0;\n\t\t}\n\n\t\treturn new Position(lineNumber, column);\n\t}\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.KEY_T\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\tthis.positionRightOf(selection.getPosition(), model);\n\n\t\t\tlet middlePosition = this.positionLeftOf(endPosition, model);\n\t\t\tlet beginPosition = this.positionLeftOf(middlePosition, model);\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 'vs/css!./clipboard';\nimport * as nls from 'vs/nls';\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 } from 'vs/editor/browser/controller/textAreaInput';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, ICommandKeybindingsOptions, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { MenuId } from 'vs/platform/actions/common/actions';\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// IE and Edge have trouble with setting html content in clipboard\nconst supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE);\n// Chrome incorrectly returns true for document.queryCommandSupported('paste')\n// when the paste feature is available but the calling script has insufficient\n// privileges to actually perform the action\nconst supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));\n\ntype ExecCommand = 'cut' | 'copy' | 'paste';\n\nabstract class ExecCommandAction extends EditorAction {\n\n\tprivate readonly browserCommand: ExecCommand;\n\n\tconstructor(browserCommand: ExecCommand, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis.browserCommand = browserCommand;\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void {\n\t\tlet focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n\t\t// Only if editor text focus (i.e. not if editor has widget focus).\n\t\tif (focusedEditor && focusedEditor.hasTextFocus()) {\n\t\t\tfocusedEditor.trigger('keyboard', this.id, args);\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.execCommand(this.browserCommand);\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\teditor.focus();\n\t\tdocument.execCommand(this.browserCommand);\n\t}\n}\n\nclass ExecCommandCutAction extends ExecCommandAction {\n\n\tconstructor() {\n\t\tlet kbOpts: ICommandKeybindingsOptions | null = {\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_X,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t};\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\tif (!platform.isNative) {\n\t\t\tkbOpts = null;\n\t\t}\n\t\tsuper('cut', {\n\t\t\tid: 'editor.action.clipboardCutAction',\n\t\t\tlabel: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n\t\t\talias: 'Cut',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: kbOpts,\n\t\t\tmenuOpts: {\n\t\t\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\t\t\torder: 1\n\t\t\t},\n\t\t\tmenubarOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '2_ccp',\n\t\t\t\ttitle: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n\t\t\t\torder: 1\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.getConfiguration().emptySelectionClipboard;\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.run(accessor, editor);\n\t}\n}\n\nclass ExecCommandCopyAction extends ExecCommandAction {\n\n\tconstructor() {\n\t\tlet kbOpts: ICommandKeybindingsOptions | null = {\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_C,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t};\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\tif (!platform.isNative) {\n\t\t\tkbOpts = null;\n\t\t}\n\n\t\tsuper('copy', {\n\t\t\tid: 'editor.action.clipboardCopyAction',\n\t\t\tlabel: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n\t\t\talias: 'Copy',\n\t\t\tprecondition: null,\n\t\t\tkbOpts: kbOpts,\n\t\t\tmenuOpts: {\n\t\t\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\t\t\torder: 2\n\t\t\t},\n\t\t\tmenubarOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '2_ccp',\n\t\t\t\ttitle: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\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\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard;\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\t// Prevent copying an empty line by accident\n\t\tif (editor.getSelections().length === 1 && editor.getSelection().isEmpty()) {\n\t\t\tif (editor.getModel().getLineFirstNonWhitespaceColumn(editor.getSelection().positionLineNumber) === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tsuper.run(accessor, editor);\n\t}\n}\n\nclass ExecCommandPasteAction extends ExecCommandAction {\n\n\tconstructor() {\n\t\tlet kbOpts: ICommandKeybindingsOptions | null = {\n\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_V,\n\t\t\twin: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },\n\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t};\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\tif (!platform.isNative) {\n\t\t\tkbOpts = null;\n\t\t}\n\n\t\tsuper('paste', {\n\t\t\tid: 'editor.action.clipboardPasteAction',\n\t\t\tlabel: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n\t\t\talias: 'Paste',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: kbOpts,\n\t\t\tmenuOpts: {\n\t\t\t\tgroup: CLIPBOARD_CONTEXT_MENU_GROUP,\n\t\t\t\torder: 3\n\t\t\t},\n\t\t\tmenubarOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '2_ccp',\n\t\t\t\ttitle: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {\n\n\tconstructor() {\n\t\tsuper('copy', {\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: null,\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.getConfiguration().emptySelectionClipboard;\n\n\t\tif (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = true;\n\t\tsuper.run(accessor, editor);\n\t\tCopyOptions.forceCopyWithSyntaxHighlighting = false;\n\t}\n}\n\nif (supportsCut) {\n\tregisterEditorAction(ExecCommandCutAction);\n}\nif (supportsCopy) {\n\tregisterEditorAction(ExecCommandCopyAction);\n}\nif (supportsPaste) {\n\tregisterEditorAction(ExecCommandPasteAction);\n}\nif (supportsCopyWithSyntaxHighlighting) {\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 { equals, flatten, isNonEmptyArray, mergeSort } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { illegalArgument, isPromiseCanceledError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { registerLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CodeAction, CodeActionContext, CodeActionProviderRegistry, CodeActionTrigger as CodeActionTriggerKind } from 'vs/editor/common/modes';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { CodeActionFilter, CodeActionKind, CodeActionTrigger, filtersAction, mayIncludeActionsOfKind } from './codeActionTrigger';\nimport { TextModelCancellationTokenSource } from 'vs/editor/browser/core/editorState';\n\nexport class CodeActionSet {\n\n\tprivate static codeActionsComparator(a: CodeAction, b: CodeAction): number {\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 actions: readonly CodeAction[];\n\n\tpublic constructor(actions: CodeAction[]) {\n\t\tthis.actions = mergeSort(actions, CodeActionSet.codeActionsComparator);\n\t}\n\n\tpublic get hasAutoFix() {\n\t\treturn this.actions.some(fix => !!fix.kind && CodeActionKind.QuickFix.contains(new CodeActionKind(fix.kind)) && !!fix.isPreferred);\n\t}\n}\n\nexport function getCodeActions(\n\tmodel: ITextModel,\n\trangeOrSelection: Range | Selection,\n\ttrigger: CodeActionTrigger,\n\ttoken: CancellationToken\n): Promise<CodeActionSet> {\n\tconst filter = trigger.filter || {};\n\n\tconst codeActionContext: CodeActionContext = {\n\t\tonly: filter.kind ? filter.kind.value : undefined,\n\t\ttrigger: trigger.type === 'manual' ? CodeActionTriggerKind.Manual : CodeActionTriggerKind.Automatic\n\t};\n\n\tconst cts = new TextModelCancellationTokenSource(model, token);\n\tconst providers = getCodeActionProviders(model, filter);\n\n\tconst promises = providers.map(provider => {\n\t\treturn Promise.resolve(provider.provideCodeActions(model, rangeOrSelection, codeActionContext, cts.token)).then(providedCodeActions => {\n\t\t\tif (cts.token.isCancellationRequested || !Array.isArray(providedCodeActions)) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn providedCodeActions.filter(action => action && filtersAction(filter, action));\n\t\t}, (err): CodeAction[] => {\n\t\t\tif (isPromiseCanceledError(err)) {\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tonUnexpectedExternalError(err);\n\t\t\treturn [];\n\t\t});\n\t});\n\n\tconst listener = CodeActionProviderRegistry.onDidChange(() => {\n\t\tconst newProviders = CodeActionProviderRegistry.all(model);\n\t\tif (!equals(newProviders, providers)) {\n\t\t\tcts.cancel();\n\t\t}\n\t});\n\n\treturn Promise.all(promises)\n\t\t.then(flatten)\n\t\t.then(actions => new CodeActionSet(actions))\n\t\t.finally(() => {\n\t\t\tlistener.dispose();\n\t\t\tcts.dispose();\n\t\t});\n}\n\nfunction getCodeActionProviders(\n\tmodel: ITextModel,\n\tfilter: CodeActionFilter\n) {\n\treturn CodeActionProviderRegistry.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\nregisterLanguageCommand('_executeCodeActionProvider', function (accessor, args): Promise<ReadonlyArray<CodeAction>> {\n\tconst { resource, range, kind } = args;\n\tif (!(resource instanceof URI) || !Range.isIRange(range)) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument();\n\t}\n\n\treturn getCodeActions(\n\t\tmodel,\n\t\tmodel.validateRange(range),\n\t\t{ type: 'manual', filter: { includeSourceActions: true, kind: kind && kind.value ? new CodeActionKind(kind.value) : undefined } },\n\t\tCancellationToken.None).then(actions => actions.actions);\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Emitter, Event } from 'vs/base/common/event';\nimport { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\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 { CodeActionProviderRegistry } from 'vs/editor/common/modes';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IMarkerService } from 'vs/platform/markers/common/markers';\nimport { IProgressService } from 'vs/platform/progress/common/progress';\nimport { getCodeActions, CodeActionSet } from './codeAction';\nimport { CodeActionTrigger } from './codeActionTrigger';\n\nexport const SUPPORTED_CODE_ACTIONS = new RawContextKey<string>('supportedCodeAction', '');\n\nexport class CodeActionOracle {\n\n\tprivate _disposables: IDisposable[] = [];\n\tprivate readonly _autoTriggerTimer = new TimeoutTimer();\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _markerService: IMarkerService,\n\t\tprivate readonly _signalChange: (newState: CodeActionsState.State) => void,\n\t\tprivate readonly _delay: number = 250,\n\t\tprivate readonly _progressService?: IProgressService,\n\t) {\n\t\tthis._disposables.push(\n\t\t\tthis._markerService.onMarkerChanged(e => this._onMarkerChanges(e)),\n\t\t\tthis._editor.onDidChangeCursorPosition(() => this._onCursorChange()),\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables = dispose(this._disposables);\n\t\tthis._autoTriggerTimer.cancel();\n\t}\n\n\ttrigger(trigger: CodeActionTrigger) {\n\t\tconst selection = this._getRangeOfSelectionUnlessWhitespaceEnclosed(trigger);\n\t\treturn this._createEventAndSignalChange(trigger, selection);\n\t}\n\n\tprivate _onMarkerChanges(resources: 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 => resource.toString() === model.uri.toString())) {\n\t\t\tthis._autoTriggerTimer.cancelAndSet(() => {\n\t\t\t\tthis.trigger({ type: '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: '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\tif (Range.intersectRanges(marker, selection)) {\n\t\t\t\treturn Range.lift(marker);\n\t\t\t}\n\t\t}\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 === '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 ? selection : undefined;\n\t}\n\n\tprivate _createEventAndSignalChange(trigger: CodeActionTrigger, selection: Selection | undefined): Promise<CodeActionSet | undefined> {\n\t\tif (!selection) {\n\t\t\t// cancel\n\t\t\tthis._signalChange(CodeActionsState.Empty);\n\t\t\treturn Promise.resolve(undefined);\n\t\t} else {\n\t\t\tconst model = this._editor.getModel();\n\t\t\tif (!model) {\n\t\t\t\t// cancel\n\t\t\t\tthis._signalChange(CodeActionsState.Empty);\n\t\t\t\treturn Promise.resolve(undefined);\n\t\t\t}\n\n\t\t\tconst markerRange = this._getRangeOfMarker(selection);\n\t\t\tconst position = markerRange ? markerRange.getStartPosition() : selection.getStartPosition();\n\t\t\tconst actions = createCancelablePromise(token => getCodeActions(model, selection, trigger, token));\n\n\t\t\tif (this._progressService && trigger.type === 'manual') {\n\t\t\t\tthis._progressService.showWhile(actions, 250);\n\t\t\t}\n\n\t\t\tthis._signalChange(new CodeActionsState.Triggered(\n\t\t\t\ttrigger,\n\t\t\t\tselection,\n\t\t\t\tposition,\n\t\t\t\tactions\n\t\t\t));\n\t\t\treturn actions;\n\t\t}\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 = new class { readonly type = Type.Empty; };\n\n\texport class Triggered {\n\t\treadonly type = Type.Triggered;\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\tpublic readonly actions: CancelablePromise<CodeActionSet>,\n\t\t) { }\n\t}\n\n\texport type State = typeof Empty | Triggered;\n}\n\nexport class CodeActionModel {\n\n\tprivate _codeActionOracle?: CodeActionOracle;\n\tprivate _state: CodeActionsState.State = CodeActionsState.Empty;\n\tprivate _onDidChangeState = new Emitter<CodeActionsState.State>();\n\tprivate _disposables: IDisposable[] = [];\n\tprivate readonly _supportedCodeActions: IContextKey<string>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _markerService: IMarkerService,\n\t\tcontextKeyService: IContextKeyService,\n\t\tprivate readonly _progressService: IProgressService\n\t) {\n\t\tthis._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService);\n\n\t\tthis._disposables.push(this._editor.onDidChangeModel(() => this._update()));\n\t\tthis._disposables.push(this._editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._disposables.push(CodeActionProviderRegistry.onDidChange(() => this._update()));\n\n\t\tthis._update();\n\t}\n\n\tdispose(): void {\n\t\tthis._disposables = dispose(this._disposables);\n\t\tdispose(this._codeActionOracle);\n\t}\n\n\tget onDidChangeState(): Event<CodeActionsState.State> {\n\t\treturn this._onDidChangeState.event;\n\t}\n\n\tprivate _update(): void {\n\t\tif (this._codeActionOracle) {\n\t\t\tthis._codeActionOracle.dispose();\n\t\t\tthis._codeActionOracle = undefined;\n\t\t}\n\n\t\tif (this._state.type === CodeActionsState.Type.Triggered) {\n\t\t\tthis._state.actions.cancel();\n\t\t}\n\t\tthis.setState(CodeActionsState.Empty);\n\n\t\tconst model = this._editor.getModel();\n\t\tif (model\n\t\t\t&& CodeActionProviderRegistry.has(model)\n\t\t\t&& !this._editor.getConfiguration().readOnly\n\t\t) {\n\t\t\tconst supportedActions: string[] = [];\n\t\t\tfor (const provider of CodeActionProviderRegistry.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 = new CodeActionOracle(this._editor, this._markerService, newState => this.setState(newState), undefined, this._progressService);\n\t\t\tthis._codeActionOracle.trigger({ type: 'auto' });\n\t\t} else {\n\t\t\tthis._supportedCodeActions.reset();\n\t\t}\n\t}\n\n\tpublic trigger(trigger: CodeActionTrigger): Promise<CodeActionSet | undefined> {\n\t\tif (this._codeActionOracle) {\n\t\t\treturn this._codeActionOracle.trigger(trigger);\n\t\t}\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tprivate setState(newState: CodeActionsState.State) {\n\t\tif (newState === this._state) {\n\t\t\treturn;\n\t\t}\n\t\tthis._state = newState;\n\t\tthis._onDidChangeState.fire(newState);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { CancellationTokenSource } from 'vs/base/common/cancellation';\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 { TextModel } from 'vs/editor/common/model/textModel';\nimport { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction';\nimport { CodeActionsState } from './codeActionModel';\n\nexport class LightBulbWidget extends Disposable implements IContentWidget {\n\n\tprivate static readonly _posPref = [ContentWidgetPositionPreference.EXACT];\n\n\tprivate readonly _domNode: HTMLDivElement;\n\tprivate readonly _editor: ICodeEditor;\n\n\tprivate readonly _onClick = this._register(new Emitter<{ x: number; y: number; state: CodeActionsState.Triggered }>());\n\tpublic readonly onClick = this._onClick.event;\n\n\tprivate _position: IContentWidgetPosition | null;\n\tprivate _state: CodeActionsState.State = CodeActionsState.Empty;\n\tprivate _futureFixes = new CancellationTokenSource();\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'lightbulb-glyph';\n\n\t\tthis._editor = editor;\n\t\tthis._editor.addContentWidget(this);\n\n\t\tthis._register(this._editor.onDidChangeModel(_ => this._futureFixes.cancel()));\n\t\tthis._register(this._editor.onDidChangeModelLanguage(_ => this._futureFixes.cancel()));\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 !== CodeActionsState.Type.Triggered || !editorModel || this._state.position.lineNumber >= editorModel.getLineCount()) {\n\t\t\t\tthis._futureFixes.cancel();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._domNode, 'click', e => {\n\t\t\tif (this._state.type !== CodeActionsState.Type.Triggered) {\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\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.getConfiguration();\n\n\t\t\tlet pad = Math.floor(lineHeight / 3);\n\t\t\tif (this._position && this._position.position !== null && this._position.position.lineNumber < this._state.position.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\tstate: this._state\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(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.contribInfo && !this._editor.getConfiguration().contribInfo.lightbulbEnabled) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): 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._position;\n\t}\n\n\ttryShow(newState: CodeActionsState.State) {\n\n\t\tif (newState.type !== CodeActionsState.Type.Triggered || this._position && (!newState.position || this._position.position && this._position.position.lineNumber !== newState.position.lineNumber)) {\n\t\t\t// hide when getting a 'hide'-request or when currently\n\t\t\t// showing on another line\n\t\t\tthis.hide();\n\t\t} else if (this._futureFixes) {\n\t\t\t// cancel pending show request in any case\n\t\t\tthis._futureFixes.cancel();\n\t\t}\n\n\t\tthis._futureFixes = new CancellationTokenSource();\n\t\tconst { token } = this._futureFixes;\n\t\tthis._state = newState;\n\n\t\tif (this._state.type === CodeActionsState.Empty.type) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selection = this._state.rangeOrSelection;\n\t\tthis._state.actions.then(fixes => {\n\t\t\tif (!token.isCancellationRequested && fixes.actions.length > 0 && selection) {\n\t\t\t\tthis._show(fixes);\n\t\t\t} else {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}).catch(() => {\n\t\t\tthis.hide();\n\t\t});\n\t}\n\n\tset title(value: string) {\n\t\tthis._domNode.title = value;\n\t}\n\n\tget title(): string {\n\t\treturn this._domNode.title;\n\t}\n\n\tprivate _show(codeActions: CodeActionSet): void {\n\t\tconst config = this._editor.getConfiguration();\n\t\tif (!config.contribInfo.lightbulbEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._state.type !== CodeActionsState.Type.Triggered) {\n\t\t\treturn;\n\t\t}\n\t\tconst { lineNumber, column } = this._state.position;\n\t\tconst model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tabSize = model.getOptions().tabSize;\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\t\tconst indent = TextModel.computeIndentLevel(lineContent, tabSize);\n\t\tconst lineHasSpace = config.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 * config.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\tthis.hide();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis._position = {\n\t\t\tposition: { lineNumber: effectiveLineNumber, column: 1 },\n\t\t\tpreference: LightBulbWidget._posPref\n\t\t};\n\t\tdom.toggleClass(this._domNode, 'autofixable', codeActions.hasAutoFix);\n\t\tthis._editor.layoutContentWidget(this);\n\t}\n\n\thide(): void {\n\t\tthis._position = null;\n\t\tthis._state = CodeActionsState.Empty;\n\t\tthis._futureFixes.cancel();\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 { mergeSort } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { registerLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { CodeLensProvider, CodeLensProviderRegistry, ICodeLensSymbol } from 'vs/editor/common/modes';\nimport { IModelService } from 'vs/editor/common/services/modelService';\n\nexport interface ICodeLensData {\n\tsymbol: ICodeLensSymbol;\n\tprovider: CodeLensProvider;\n}\n\nexport function getCodeLensData(model: ITextModel, token: CancellationToken): Promise<ICodeLensData[]> {\n\n\tconst symbols: ICodeLensData[] = [];\n\tconst provider = CodeLensProviderRegistry.ordered(model);\n\n\tconst promises = provider.map(provider => Promise.resolve(provider.provideCodeLenses(model, token)).then(result => {\n\t\tif (Array.isArray(result)) {\n\t\t\tfor (let symbol of result) {\n\t\t\t\tsymbols.push({ symbol, provider });\n\t\t\t}\n\t\t}\n\t}).catch(onUnexpectedExternalError));\n\n\treturn Promise.all(promises).then(() => {\n\n\t\treturn mergeSort(symbols, (a, b) => {\n\t\t\t// sort by lineNumber, provider-rank, and column\n\t\t\tif (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) {\n\t\t\t\treturn -1;\n\t\t\t} else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) {\n\t\t\t\treturn 1;\n\t\t\t} else if (provider.indexOf(a.provider) < provider.indexOf(b.provider)) {\n\t\t\t\treturn -1;\n\t\t\t} else if (provider.indexOf(a.provider) > provider.indexOf(b.provider)) {\n\t\t\t\treturn 1;\n\t\t\t} else if (a.symbol.range.startColumn < b.symbol.range.startColumn) {\n\t\t\t\treturn -1;\n\t\t\t} else if (a.symbol.range.startColumn > b.symbol.range.startColumn) {\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\t});\n}\n\nregisterLanguageCommand('_executeCodeLensProvider', function (accessor, args) {\n\n\tlet { resource, itemResolveCount } = args;\n\tif (!(resource instanceof URI)) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument();\n\t}\n\n\tconst result: ICodeLensSymbol[] = [];\n\treturn getCodeLensData(model, CancellationToken.None).then(value => {\n\n\t\tlet resolve: Promise<any>[] = [];\n\n\t\tfor (const item of value) {\n\t\t\tif (typeof itemResolveCount === 'undefined' || 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});\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { registerLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { ColorProviderRegistry, DocumentColorProvider, IColorInformation, IColorPresentation } from 'vs/editor/common/modes';\nimport { IModelService } from 'vs/editor/common/services/modelService';\n\n\nexport interface IColorData {\n\tcolorInfo: IColorInformation;\n\tprovider: DocumentColorProvider;\n}\n\nexport function getColors(model: ITextModel, token: CancellationToken): Promise<IColorData[]> {\n\tconst colors: IColorData[] = [];\n\tconst providers = ColorProviderRegistry.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\nregisterLanguageCommand('_executeDocumentColorProvider', function (accessor, args) {\n\n\tconst { resource } = args;\n\tif (!(resource instanceof URI)) {\n\t\tthrow illegalArgument();\n\t}\n\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\nregisterLanguageCommand('_executeColorPresentationProvider', function (accessor, args) {\n\n\tconst { resource, color, range } = args;\n\tif (!(resource 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 model = accessor.get(IModelService).getModel(resource);\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 { CancelablePromise, TimeoutTimer, createCancelablePromise } from 'vs/base/common/async';\nimport { RGBA } from 'vs/base/common/color';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { hash } from 'vs/base/common/hash';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } 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 { IModelDeltaDecoration } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { ColorProviderRegistry } from 'vs/editor/common/modes';\nimport { IColorData, getColors } from 'vs/editor/contrib/colorPicker/color';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\n\nconst MAX_DECORATORS = 500;\n\nexport class ColorDetector implements IEditorContribution {\n\n\tprivate static readonly ID: string = 'editor.contrib.colorDetector';\n\n\tstatic RECOMPUTE_TIME = 1000; // ms\n\n\tprivate _globalToDispose: IDisposable[] = [];\n\tprivate _localToDispose: IDisposable[] = [];\n\tprivate _computePromise: CancelablePromise<IColorData[]> | null;\n\tprivate _timeoutTimer: TimeoutTimer | null;\n\n\tprivate _decorationsIds: string[] = [];\n\tprivate _colorDatas = new Map<string, IColorData>();\n\n\tprivate _colorDecoratorIds: string[] = [];\n\tprivate readonly _decorationsTypes: { [key: string]: boolean } = {};\n\n\tprivate _isEnabled: boolean;\n\n\tconstructor(private readonly _editor: ICodeEditor,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService\n\t) {\n\t\tthis._globalToDispose.push(_editor.onDidChangeModel((e) => {\n\t\t\tthis._isEnabled = this.isEnabled();\n\t\t\tthis.onModelChanged();\n\t\t}));\n\t\tthis._globalToDispose.push(_editor.onDidChangeModelLanguage((e) => this.onModelChanged()));\n\t\tthis._globalToDispose.push(ColorProviderRegistry.onDidChange((e) => this.onModelChanged()));\n\t\tthis._globalToDispose.push(_editor.onDidChangeConfiguration((e) => {\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.getLanguageIdentifier();\n\t\t// handle deprecated settings. [languageId].colorDecorators.enable\n\t\tlet deprecatedConfig = this._configurationService.getValue(languageId.language);\n\t\tif (deprecatedConfig) {\n\t\t\tlet colorDecorators = deprecatedConfig['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.getConfiguration().contribInfo.colorDecorators;\n\t}\n\n\tgetId(): string {\n\t\treturn ColorDetector.ID;\n\t}\n\n\tstatic get(editor: ICodeEditor): ColorDetector {\n\t\treturn editor.getContribution<ColorDetector>(this.ID);\n\t}\n\n\tdispose(): void {\n\t\tthis.stop();\n\t\tthis.removeAllDecorations();\n\t\tthis._globalToDispose = dispose(this._globalToDispose);\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 || !ColorProviderRegistry.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._localToDispose.push(this._editor.onDidChangeModelContent((e) => {\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}, ColorDetector.RECOMPUTE_TIME);\n\t\t\t}\n\t\t}));\n\t\tthis.beginCompute();\n\t}\n\n\tprivate beginCompute(): void {\n\t\tthis._computePromise = createCancelablePromise(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\treturn getColors(model, token);\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 = dispose(this._localToDispose);\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 updateColorDecorators(colorData: IColorData[]): void {\n\t\tlet decorations: IModelDeltaDecoration[] = [];\n\t\tlet newDecorationsTypes: { [key: string]: boolean } = {};\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 subKey = hash(rgba).toString(16);\n\t\t\tlet color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;\n\t\t\tlet key = 'colorBox-' + subKey;\n\n\t\t\tif (!this._decorationsTypes[key] && !newDecorationsTypes[key]) {\n\t\t\t\tthis._codeEditorService.registerDecorationType(key, {\n\t\t\t\t\tbefore: {\n\t\t\t\t\t\tcontentText: ' ',\n\t\t\t\t\t\tborder: 'solid 0.1em #000',\n\t\t\t\t\t\tmargin: '0.1em 0.2em 0 0.2em',\n\t\t\t\t\t\twidth: '0.8em',\n\t\t\t\t\t\theight: '0.8em',\n\t\t\t\t\t\tbackgroundColor: color\n\t\t\t\t\t},\n\t\t\t\t\tdark: {\n\t\t\t\t\t\tbefore: {\n\t\t\t\t\t\t\tborder: 'solid 0.1em #eee'\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\tnewDecorationsTypes[key] = true;\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: this._codeEditorService.resolveDecorationOptions(key, true)\n\t\t\t});\n\t\t}\n\n\t\tfor (let subType in this._decorationsTypes) {\n\t\t\tif (!newDecorationsTypes[subType]) {\n\t\t\t\tthis._codeEditorService.removeDecorationType(subType);\n\t\t\t}\n\t\t}\n\n\t\tthis._colorDecoratorIds = 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 = this._editor.deltaDecorations(this._colorDecoratorIds, []);\n\n\t\tfor (let subType in this._decorationsTypes) {\n\t\t\tthis._codeEditorService.removeDecorationType(subType);\n\t\t}\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\nregisterEditorContribution(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 * as nls from 'vs/nls';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { BlockCommentCommand } from 'vs/editor/contrib/comment/blockCommentCommand';\nimport { LineCommentCommand, Type } from 'vs/editor/contrib/comment/lineCommentCommand';\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\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\t\tlet opts = model.getOptions();\n\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new LineCommentCommand(selection, opts.tabSize, this._type));\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.US_SLASH,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_C),\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.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_U),\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.KEY_A,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet commands: ICommand[] = [];\n\t\tlet selections = editor.getSelections();\n\t\tfor (const selection of selections) {\n\t\t\tcommands.push(new BlockCommentCommand(selection));\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 nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { IAnchor } from 'vs/base/browser/ui/contextview/contextview';\nimport { IAction } from 'vs/base/common/actions';\nimport { KeyCode, KeyMod, ResolvedKeybinding } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IMenuService, MenuId } 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';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\n\nexport class ContextMenuController implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.contextmenu';\n\n\tpublic static get(editor: ICodeEditor): ContextMenuController {\n\t\treturn editor.getContribution<ContextMenuController>(ContextMenuController.ID);\n\t}\n\n\tprivate _toDispose: IDisposable[] = [];\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.push(this._editor.onContextMenu((e: IEditorMouseEvent) => this._onContextMenu(e)));\n\t\tthis._toDispose.push(this._editor.onMouseWheel((e: IMouseWheelEvent) => {\n\t\t\tif (this._contextMenuIsBeingShownCount > 0) {\n\t\t\t\tthis._contextViewService.hideContextView();\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.push(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.getConfiguration().contribInfo.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\n\t\te.event.preventDefault();\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 && !this._editor.getSelection().containsPosition(e.target.position)) {\n\t\t\tthis._editor.setPosition(e.target.position);\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.getConfiguration().contribInfo.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\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): IAction[] {\n\t\tconst result: IAction[] = [];\n\n\t\tlet contextMenu = this._menuService.createMenu(MenuId.EditorContext, this._contextKeyService);\n\t\tconst groups = contextMenu.getActions({ arg: model.uri });\n\t\tcontextMenu.dispose();\n\n\t\tfor (let group of groups) {\n\t\t\tconst [, actions] = group;\n\t\t\tresult.push(...actions);\n\t\t\tresult.push(new Separator());\n\t\t}\n\t\tresult.pop(); // remove last separator\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.getConfiguration().contribInfo.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\t// Show menu\n\t\tthis._contextMenuIsBeingShownCount++;\n\t\tthis._contextMenuService.showContextMenu({\n\t\t\tgetAnchor: () => anchor!,\n\n\t\t\tgetActions: () => actions,\n\n\t\t\tgetActionItem: (action) => {\n\t\t\t\tconst keybinding = this._keybindingFor(action);\n\t\t\t\tif (keybinding) {\n\t\t\t\t\treturn new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });\n\t\t\t\t}\n\n\t\t\t\tconst customActionItem = <any>action;\n\t\t\t\tif (typeof customActionItem.getActionItem === 'function') {\n\t\t\t\t\treturn customActionItem.getActionItem();\n\t\t\t\t}\n\n\t\t\t\treturn new ActionItem(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 getId(): string {\n\t\treturn ContextMenuController.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(this._toDispose);\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: null,\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\tlet contribution = ContextMenuController.get(editor);\n\t\tcontribution.showContextMenu();\n\t}\n}\n\nregisterEditorContribution(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 * as nls from 'vs/nls';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nclass CursorState {\n\treadonly selections: Selection[];\n\n\tconstructor(selections: 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\nexport class CursorUndoController extends Disposable implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.cursorUndoController';\n\n\tpublic static get(editor: ICodeEditor): CursorUndoController {\n\t\treturn editor.getContribution<CursorUndoController>(CursorUndoController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _isCursorUndo: boolean;\n\n\tprivate _undoStack: CursorState[];\n\tprivate _prevState: CursorState | null;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._isCursorUndo = false;\n\n\t\tthis._undoStack = [];\n\t\tthis._prevState = this._readState();\n\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tthis._undoStack = [];\n\t\t\tthis._prevState = null;\n\t\t}));\n\t\tthis._register(editor.onDidChangeModelContent((e) => {\n\t\t\tthis._undoStack = [];\n\t\t\tthis._prevState = null;\n\t\t}));\n\t\tthis._register(editor.onDidChangeCursorSelection((e) => {\n\n\t\t\tif (!this._isCursorUndo && this._prevState) {\n\t\t\t\tthis._undoStack.push(this._prevState);\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\n\t\t\tthis._prevState = this._readState();\n\t\t}));\n\t}\n\n\tprivate _readState(): CursorState | null {\n\t\tif (!this._editor.hasModel()) {\n\t\t\t// no model => no state\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new CursorState(this._editor.getSelections());\n\t}\n\n\tpublic getId(): string {\n\t\treturn CursorUndoController.ID;\n\t}\n\n\tpublic cursorUndo(): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currState = new CursorState(this._editor.getSelections());\n\n\t\twhile (this._undoStack.length > 0) {\n\t\t\tconst prevState = this._undoStack.pop()!;\n\n\t\t\tif (!prevState.equals(currState)) {\n\t\t\t\tthis._isCursorUndo = true;\n\t\t\t\tthis._editor.setSelections(prevState.selections);\n\t\t\t\tthis._editor.revealRangeInCenterIfOutsideViewport(prevState.selections[0], ScrollType.Smooth);\n\t\t\t\tthis._isCursorUndo = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\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', \"Soft Undo\"),\n\t\t\talias: 'Soft Undo',\n\t\t\tprecondition: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_U,\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\tCursorUndoController.get(editor).cursorUndo();\n\t}\n}\n\nregisterEditorContribution(CursorUndoController);\nregisterEditorAction(CursorUndo);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./dnd';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { isMacintosh } from 'vs/base/common/platform';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { ICodeEditor, IEditorMouseEvent, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\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 { DragAndDropCommand } from 'vs/editor/contrib/dnd/dragAndDropCommand';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { IModelDeltaDecoration } from 'vs/editor/common/model';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';\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 implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.dragAndDrop';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _toUnhook: IDisposable[];\n\tprivate _dragSelection: Selection | null;\n\tprivate _dndDecorationIds: string[];\n\tprivate _mouseDown: boolean;\n\tprivate _modifierPressed: boolean;\n\tstatic TRIGGER_KEY_VALUE = isMacintosh ? KeyCode.Alt : KeyCode.Ctrl;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis._editor = editor;\n\t\tthis._toUnhook = [];\n\t\tthis._toUnhook.push(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\tthis._toUnhook.push(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));\n\t\tthis._toUnhook.push(this._editor.onMouseDrag((e: IEditorMouseEvent) => this._onEditorMouseDrag(e)));\n\t\tthis._toUnhook.push(this._editor.onMouseDrop((e: IEditorMouseEvent) => this._onEditorMouseDrop(e)));\n\t\tthis._toUnhook.push(this._editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e)));\n\t\tthis._toUnhook.push(this._editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e)));\n\t\tthis._toUnhook.push(this._editor.onDidBlurEditorWidget(() => 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.getConfiguration().dragAndDrop) {\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.getConfiguration().dragAndDrop) {\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 _onEditorMouseDrop(mouseEvent: IEditorMouseEvent): 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`.\n\t\t\t\t(<CodeEditorWidget>this._editor).setSelections(newSelections || [], 'mouse');\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\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, editorCommon.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 getId(): string {\n\t\treturn DragAndDropController.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._removeDecoration();\n\t\tthis._dragSelection = null;\n\t\tthis._mouseDown = false;\n\t\tthis._modifierPressed = false;\n\t\tthis._toUnhook = dispose(this._toUnhook);\n\t}\n}\n\nregisterEditorContribution(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 'vs/css!./folding';\nimport * as nls from 'vs/nls';\nimport * as types from 'vs/base/common/types';\nimport { escapeRegExpCharacters } from 'vs/base/common/strings';\nimport { RunOnceScheduler, Delayer, CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\nimport { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ScrollType, IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction, registerInstantiatedEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { FoldingModel, setCollapseStateAtLevel, CollapseMemento, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateForMatchingLines, setCollapseStateForType } from 'vs/editor/contrib/folding/foldingModel';\nimport { FoldingDecorationProvider } from './foldingDecorations';\nimport { FoldingRegions, FoldingRegion } from './foldingRanges';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport { IMarginData, IEmptyContentData } from 'vs/editor/browser/controller/mouseTarget';\nimport { HiddenRangeModel } from 'vs/editor/contrib/folding/hiddenRangeModel';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { IndentRangeProvider } from 'vs/editor/contrib/folding/indentRangeProvider';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { FoldingRangeProviderRegistry, FoldingRangeKind } from 'vs/editor/common/modes';\nimport { SyntaxRangeProvider, ID_SYNTAX_PROVIDER } from './syntaxRangeProvider';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { InitializingRangeProvider, ID_INIT_PROVIDER } from 'vs/editor/contrib/folding/intializingRangeProvider';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { onUnexpectedError } from 'vs/base/common/errors';\n\nexport const ID = 'editor.contrib.folding';\n\nexport interface RangeProvider {\n\treadonly id: string;\n\tcompute(cancelationToken: CancellationToken): Promise<FoldingRegions | null>;\n\tdispose(): void;\n}\n\ninterface FoldingStateMemento {\n\tcollapsedRegions?: CollapseMemento;\n\tlineCount?: number;\n\tprovider?: string;\n}\n\nexport class FoldingController implements IEditorContribution {\n\n\n\tpublic static get(editor: ICodeEditor): FoldingController {\n\t\treturn editor.getContribution<FoldingController>(ID);\n\t}\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate _isEnabled: boolean;\n\tprivate _autoHideFoldingControls: boolean;\n\tprivate _useFoldingProviders: boolean;\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\n\tprivate globalToDispose: IDisposable[];\n\n\tprivate cursorChangedScheduler: RunOnceScheduler | null;\n\n\tprivate localToDispose: IDisposable[];\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis.editor = editor;\n\t\tthis._isEnabled = this.editor.getConfiguration().contribInfo.folding;\n\t\tthis._autoHideFoldingControls = this.editor.getConfiguration().contribInfo.showFoldingControls === 'mouseover';\n\t\tthis._useFoldingProviders = this.editor.getConfiguration().contribInfo.foldingStrategy !== 'indentation';\n\n\t\tthis.globalToDispose = [];\n\t\tthis.localToDispose = [];\n\n\t\tthis.foldingDecorationProvider = new FoldingDecorationProvider(editor);\n\t\tthis.foldingDecorationProvider.autoHideFoldingControls = this._autoHideFoldingControls;\n\n\t\tthis.globalToDispose.push(this.editor.onDidChangeModel(() => this.onModelChanged()));\n\n\t\tthis.globalToDispose.push(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {\n\t\t\tif (e.contribInfo) {\n\t\t\t\tlet oldIsEnabled = this._isEnabled;\n\t\t\t\tthis._isEnabled = this.editor.getConfiguration().contribInfo.folding;\n\t\t\t\tif (oldIsEnabled !== this._isEnabled) {\n\t\t\t\t\tthis.onModelChanged();\n\t\t\t\t}\n\t\t\t\tlet oldShowFoldingControls = this._autoHideFoldingControls;\n\t\t\t\tthis._autoHideFoldingControls = this.editor.getConfiguration().contribInfo.showFoldingControls === 'mouseover';\n\t\t\t\tif (oldShowFoldingControls !== this._autoHideFoldingControls) {\n\t\t\t\t\tthis.foldingDecorationProvider.autoHideFoldingControls = this._autoHideFoldingControls;\n\t\t\t\t\tthis.onModelContentChanged();\n\t\t\t\t}\n\t\t\t\tlet oldUseFoldingProviders = this._useFoldingProviders;\n\t\t\t\tthis._useFoldingProviders = this.editor.getConfiguration().contribInfo.foldingStrategy !== 'indentation';\n\t\t\t\tif (oldUseFoldingProviders !== this._useFoldingProviders) {\n\t\t\t\t\tthis.onFoldingStrategyChanged();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis.globalToDispose.push({ dispose: () => dispose(this.localToDispose) });\n\t\tthis.onModelChanged();\n\t}\n\n\tpublic getId(): string {\n\t\treturn ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.globalToDispose = dispose(this.globalToDispose);\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 };\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.collapsedRegions || state.lineCount !== model.getLineCount()) {\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\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\tfoldingModel.applyMemento(collapsedRegions);\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 = dispose(this.localToDispose);\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.foldingModel = new FoldingModel(model, this.foldingDecorationProvider);\n\t\tthis.localToDispose.push(this.foldingModel);\n\n\t\tthis.hiddenRangeModel = new HiddenRangeModel(this.foldingModel);\n\t\tthis.localToDispose.push(this.hiddenRangeModel);\n\t\tthis.localToDispose.push(this.hiddenRangeModel.onDidChange(hr => this.onHiddenRangesChanges(hr)));\n\n\t\tthis.updateScheduler = new Delayer<FoldingModel>(200);\n\n\t\tthis.cursorChangedScheduler = new RunOnceScheduler(() => this.revealCursor(), 200);\n\t\tthis.localToDispose.push(this.cursorChangedScheduler);\n\t\tthis.localToDispose.push(FoldingRangeProviderRegistry.onDidChange(() => this.onFoldingStrategyChanged()));\n\t\tthis.localToDispose.push(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())); // covers model language changes as well\n\t\tthis.localToDispose.push(this.editor.onDidChangeModelContent(() => this.onModelContentChanged()));\n\t\tthis.localToDispose.push(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged()));\n\t\tthis.localToDispose.push(this.editor.onMouseDown(e => this.onEditorMouseDown(e)));\n\t\tthis.localToDispose.push(this.editor.onMouseUp(e => this.onEditorMouseUp(e)));\n\t\tthis.localToDispose.push({\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.onModelContentChanged();\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.onModelContentChanged();\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); // fallback\n\n\n\t\tif (this._useFoldingProviders && this.foldingModel) {\n\t\t\tlet foldingProviders = FoldingRangeProviderRegistry.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);\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 onModelContentChanged() {\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\tlet foldingRegionPromise = this.foldingRegionPromise = createCancelablePromise(token => this.getRangeProvider(foldingModel.textModel).compute(token));\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\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\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) {\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 mouseDownInfo: { lineNumber: number, iconClicked: boolean } | null;\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 as IMarginData;\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\tcase MouseTargetType.CONTENT_EMPTY: {\n\t\t\t\tif (this.hiddenRangeModel.hasRanges()) {\n\t\t\t\t\tconst data = e.target.detail as IEmptyContentData;\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 toToggle = [region];\n\t\t\t\t\t\tif (e.event.middleButton || e.event.shiftKey) {\n\t\t\t\t\t\t\ttoToggle.push(...foldingModel.getRegionsInside(region, r => r.isCollapsed === isCollapsed));\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): void;\n\n\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: T): void | Promise<void> {\n\t\tlet foldingController = FoldingController.get(editor);\n\t\tif (!foldingController) {\n\t\t\treturn;\n\t\t}\n\t\tlet 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);\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_CLOSE_SQUARE_BRACKET,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_CLOSE_SQUARE_BRACKET\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET),\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_OPEN_SQUARE_BRACKET,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_OPEN_SQUARE_BRACKET\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. Defaults to 1.\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`,\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, true, levels, lineNumbers);\n\t\t} else {\n\t\t\tsetCollapseStateLevelsDown(foldingModel, true, levels, lineNumbers);\n\t\t}\n\t}\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET),\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_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): 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\tlet comments = LanguageConfigurationRegistry.getComments(editorModel.getLanguageIdentifier().id);\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_8),\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\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\tlet foldingRules = LanguageConfigurationRegistry.getFoldingRules(editorModel.getLanguageIdentifier().id);\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_9),\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\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\tlet foldingRules = LanguageConfigurationRegistry.getFoldingRules(editorModel.getLanguageIdentifier().id);\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 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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_0),\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_J),\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\nregisterEditorContribution(FoldingController);\nregisterEditorAction(UnfoldAction);\nregisterEditorAction(UnFoldRecursivelyAction);\nregisterEditorAction(FoldAction);\nregisterEditorAction(FoldRecursivelyAction);\nregisterEditorAction(FoldAllAction);\nregisterEditorAction(UnfoldAllAction);\nregisterEditorAction(FoldAllBlockCommentsAction);\nregisterEditorAction(FoldAllRegionsAction);\nregisterEditorAction(UnfoldAllRegionsAction);\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | (KeyCode.KEY_0 + i)),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { EditorZoom } from 'vs/editor/common/config/editorZoom';\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: null\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: null\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: null\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 { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { CodeEditorStateFlag, EditorState, EditorStateCancellationTokenSource, TextModelCancellationTokenSource } from 'vs/editor/browser/core/editorState';\nimport { IActiveCodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerLanguageCommand, 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 * as editorCommon from 'vs/editor/common/editorCommon';\nimport { ISingleEditOperation, ITextModel } from 'vs/editor/common/model';\nimport { DocumentFormattingEditProvider, DocumentFormattingEditProviderRegistry, DocumentRangeFormattingEditProvider, DocumentRangeFormattingEditProviderRegistry, FormattingOptions, OnTypeFormattingEditProviderRegistry, TextEdit } from 'vs/editor/common/modes';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { FormattingEdit } from 'vs/editor/contrib/format/formattingEdit';\nimport * as nls from 'vs/nls';\nimport { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { LinkedList } from 'vs/base/common/linkedList';\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(model: ITextModel): DocumentFormattingEditProvider[] {\n\tconst result: DocumentFormattingEditProvider[] = [];\n\tconst seen = new Set<string>();\n\n\t// (1) add all document formatter\n\tconst docFormatter = DocumentFormattingEditProviderRegistry.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 = DocumentRangeFormattingEditProviderRegistry.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 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 { value: selector } = FormattingConflicts._selectors.iterator().next();\n\t\tif (selector) {\n\t\t\treturn await selector(formatter, document, mode);\n\t\t}\n\t\treturn formatter[0];\n\t}\n}\n\nexport async function formatDocumentRangeWithSelectedProvider(\n\taccessor: ServicesAccessor,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\trange: Range,\n\tmode: FormattingMode,\n\ttoken: CancellationToken\n): Promise<void> {\n\n\tconst instaService = accessor.get(IInstantiationService);\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\tawait instaService.invokeFunction(formatDocumentRangeWithProvider, selected, editorOrModel, range, token);\n\t}\n}\n\nexport async function formatDocumentRangeWithProvider(\n\taccessor: ServicesAccessor,\n\tprovider: DocumentRangeFormattingEditProvider,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\trange: Range,\n\ttoken: CancellationToken\n): Promise<boolean> {\n\tconst workerService = accessor.get(IEditorWorkerService);\n\n\tlet model: ITextModel;\n\tlet validate: () => boolean;\n\tif (isCodeEditor(editorOrModel)) {\n\t\tmodel = editorOrModel.getModel();\n\t\tconst state = new EditorState(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position);\n\t\tvalidate = () => state.validate(editorOrModel);\n\t} else {\n\t\tmodel = editorOrModel;\n\t\tconst versionNow = editorOrModel.getVersionId();\n\t\tvalidate = () => versionNow === editorOrModel.getVersionId();\n\t}\n\n\tconst rawEdits = await provider.provideDocumentRangeFormattingEdits(\n\t\tmodel,\n\t\trange,\n\t\tmodel.getFormattingOptions(),\n\t\ttoken\n\t);\n\n\tconst edits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits);\n\n\tif (!validate()) {\n\t\treturn true;\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);\n\t\talertFormattingEdits(edits);\n\t\teditorOrModel.pushUndoStop();\n\t\teditorOrModel.focus();\n\t\teditorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), editorCommon.ScrollType.Immediate);\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 formatDocumentWithSelectedProvider(\n\taccessor: ServicesAccessor,\n\teditorOrModel: ITextModel | IActiveCodeEditor,\n\tmode: FormattingMode,\n\ttoken: CancellationToken\n): Promise<void> {\n\n\tconst instaService = accessor.get(IInstantiationService);\n\tconst model = isCodeEditor(editorOrModel) ? editorOrModel.getModel() : editorOrModel;\n\tconst provider = getRealAndSyntheticDocumentFormattersOrdered(model);\n\tconst selected = await FormattingConflicts.select(provider, model, mode);\n\tif (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, token);\n\t} else {\n\t\tmodel = editorOrModel;\n\t\tcts = new TextModelCancellationTokenSource(editorOrModel, token);\n\t}\n\n\tconst rawEdits = await provider.provideDocumentFormattingEdits(\n\t\tmodel,\n\t\tmodel.getFormattingOptions(),\n\t\tcts.token\n\t);\n\n\tconst edits = await workerService.computeMoreMinimalEdits(model.uri, rawEdits);\n\n\tif (cts.token.isCancellationRequested) {\n\t\treturn true;\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);\n\n\t\tif (mode !== FormattingMode.Silent) {\n\t\t\talertFormattingEdits(edits);\n\t\t\teditorOrModel.pushUndoStop();\n\t\t\teditorOrModel.focus();\n\t\t\teditorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), editorCommon.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\tmodel: ITextModel,\n\trange: Range,\n\toptions: FormattingOptions,\n\ttoken: CancellationToken\n): Promise<TextEdit[] | undefined> {\n\n\tconst providers = DocumentRangeFormattingEditProviderRegistry.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\tmodel: ITextModel,\n\toptions: FormattingOptions,\n\ttoken: CancellationToken\n): Promise<TextEdit[] | undefined> {\n\n\tconst providers = getRealAndSyntheticDocumentFormattersOrdered(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\tmodel: ITextModel,\n\tposition: Position,\n\tch: string,\n\toptions: FormattingOptions\n): Promise<TextEdit[] | null | undefined> {\n\n\tconst providers = OnTypeFormattingEditProviderRegistry.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, CancellationToken.None)).catch(onUnexpectedExternalError).then(edits => {\n\t\treturn workerService.computeMoreMinimalEdits(model.uri, edits);\n\t});\n}\n\nregisterLanguageCommand('_executeFormatRangeProvider', function (accessor, args) {\n\tconst { resource, range, options } = args;\n\tif (!(resource instanceof URI) || !Range.isIRange(range)) {\n\t\tthrow illegalArgument();\n\t}\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument('resource');\n\t}\n\treturn getDocumentRangeFormattingEditsUntilResult(accessor.get(IEditorWorkerService), model, Range.lift(range), options, CancellationToken.None);\n});\n\nregisterLanguageCommand('_executeFormatDocumentProvider', function (accessor, args) {\n\tconst { resource, options } = args;\n\tif (!(resource instanceof URI)) {\n\t\tthrow illegalArgument('resource');\n\t}\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument('resource');\n\t}\n\n\treturn getDocumentFormattingEditsUntilResult(accessor.get(IEditorWorkerService), model, options, CancellationToken.None);\n});\n\nregisterLanguageCommand('_executeFormatOnTypeProvider', function (accessor, args) {\n\tconst { resource, position, ch, options } = args;\n\tif (!(resource instanceof URI) || !Position.isIPosition(position) || typeof ch !== 'string') {\n\t\tthrow illegalArgument();\n\t}\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (!model) {\n\t\tthrow illegalArgument('resource');\n\t}\n\n\treturn getOnTypeFormattingEdits(accessor.get(IEditorWorkerService), model, Position.lift(position), ch, options);\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 } from 'vs/base/common/cancellation';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { dispose, IDisposable } 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 { CharacterSet } from 'vs/editor/common/core/characterClassifier';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { DocumentRangeFormattingEditProviderRegistry, OnTypeFormattingEditProviderRegistry } from 'vs/editor/common/modes';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { getOnTypeFormattingEdits, alertFormattingEdits, formatDocumentRangeWithSelectedProvider, formatDocumentWithSelectedProvider, FormattingMode } from 'vs/editor/contrib/format/format';\nimport { FormattingEdit } from 'vs/editor/contrib/format/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 { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { onUnexpectedError } from 'vs/base/common/errors';\n\nclass FormatOnType implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.autoFormat';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _callOnDispose: IDisposable[] = [];\n\tprivate _callOnModel: IDisposable[] = [];\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IEditorWorkerService private readonly _workerService: IEditorWorkerService\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._callOnDispose.push(editor.onDidChangeConfiguration(() => this._update()));\n\t\tthis._callOnDispose.push(editor.onDidChangeModel(() => this._update()));\n\t\tthis._callOnDispose.push(editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._callOnDispose.push(OnTypeFormattingEditProviderRegistry.onDidChange(this._update, this));\n\t}\n\n\tgetId(): string {\n\t\treturn FormatOnType.ID;\n\t}\n\n\tdispose(): void {\n\t\tthis._callOnDispose = dispose(this._callOnDispose);\n\t\tthis._callOnModel = dispose(this._callOnModel);\n\t}\n\n\tprivate _update(): void {\n\n\t\t// clean up\n\t\tthis._callOnModel = dispose(this._callOnModel);\n\n\t\t// we are disabled\n\t\tif (!this._editor.getConfiguration().contribInfo.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] = OnTypeFormattingEditProviderRegistry.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._callOnModel.push(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) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst position = this._editor.getPosition();\n\t\tlet canceled = false;\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\tcanceled = true;\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\tcanceled = true;\n\t\t\t\t\tunbind.dispose();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\n\t\tgetOnTypeFormattingEdits(\n\t\t\tthis._workerService,\n\t\t\tmodel,\n\t\t\tposition,\n\t\t\tch,\n\t\t\tmodel.getFormattingOptions()\n\t\t).then(edits => {\n\n\t\t\tunbind.dispose();\n\n\t\t\tif (canceled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isNonEmptyArray(edits)) {\n\t\t\t\tFormattingEdit.execute(this._editor, edits);\n\t\t\t\talertFormattingEdits(edits);\n\t\t\t}\n\n\t\t}, (err) => {\n\t\t\tunbind.dispose();\n\t\t\tthrow err;\n\t\t});\n\t}\n}\n\nclass FormatOnPaste implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.formatOnPaste';\n\n\tprivate _callOnDispose: IDisposable[];\n\tprivate _callOnModel: IDisposable[];\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t) {\n\t\tthis._callOnDispose = [];\n\t\tthis._callOnModel = [];\n\n\t\tthis._callOnDispose.push(editor.onDidChangeConfiguration(() => this._update()));\n\t\tthis._callOnDispose.push(editor.onDidChangeModel(() => this._update()));\n\t\tthis._callOnDispose.push(editor.onDidChangeModelLanguage(() => this._update()));\n\t\tthis._callOnDispose.push(DocumentRangeFormattingEditProviderRegistry.onDidChange(this._update, this));\n\t}\n\n\tgetId(): string {\n\t\treturn FormatOnPaste.ID;\n\t}\n\n\tdispose(): void {\n\t\tthis._callOnDispose = dispose(this._callOnDispose);\n\t\tthis._callOnModel = dispose(this._callOnModel);\n\t}\n\n\tprivate _update(): void {\n\n\t\t// clean up\n\t\tthis._callOnModel = dispose(this._callOnModel);\n\n\t\t// we are disabled\n\t\tif (!this.editor.getConfiguration().contribInfo.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 (!DocumentRangeFormattingEditProviderRegistry.has(this.editor.getModel())) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._callOnModel.push(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(formatDocumentRangeWithSelectedProvider, this.editor, range, FormattingMode.Silent, 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.writable, EditorContextKeys.hasDocumentFormattingProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.editorTextFocus, EditorContextKeys.hasDocumentFormattingProvider),\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_F,\n\t\t\t\tlinux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\twhen: EditorContextKeys.hasDocumentFormattingProvider,\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\tawait instaService.invokeFunction(formatDocumentWithSelectedProvider, editor, FormattingMode.Explicit, CancellationToken.None);\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 Code',\n\t\t\tprecondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasDocumentSelectionFormattingProvider),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.editorTextFocus, EditorContextKeys.hasDocumentSelectionFormattingProvider),\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_F),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\twhen: ContextKeyExpr.and(EditorContextKeys.hasDocumentSelectionFormattingProvider, 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\t\tlet range: Range = editor.getSelection();\n\t\tif (range.isEmpty()) {\n\t\t\trange = new Range(range.startLineNumber, 1, range.startLineNumber, model.getLineMaxColumn(range.startLineNumber));\n\t\t}\n\t\tawait instaService.invokeFunction(formatDocumentRangeWithSelectedProvider, editor, range, FormattingMode.Explicit, CancellationToken.None);\n\t}\n}\n\nregisterEditorContribution(FormatOnType);\nregisterEditorContribution(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 { flatten, coalesce } from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { LocationLink, DefinitionProviderRegistry, ImplementationProviderRegistry, TypeDefinitionProviderRegistry, DeclarationProviderRegistry, ProviderResult } from 'vs/editor/common/modes';\nimport { LanguageFeatureRegistry } from 'vs/editor/common/modes/languageFeatureRegistry';\n\n\nfunction getDefinitions<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\treturn Promise.all(promises)\n\t\t.then(flatten)\n\t\t.then(coalesce);\n}\n\n\nexport function getDefinitionsAtPosition(model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getDefinitions(model, position, DefinitionProviderRegistry, (provider, model, position) => {\n\t\treturn provider.provideDefinition(model, position, token);\n\t});\n}\n\nexport function getDeclarationsAtPosition(model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getDefinitions(model, position, DeclarationProviderRegistry, (provider, model, position) => {\n\t\treturn provider.provideDeclaration(model, position, token);\n\t});\n}\n\nexport function getImplementationsAtPosition(model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getDefinitions(model, position, ImplementationProviderRegistry, (provider, model, position) => {\n\t\treturn provider.provideImplementation(model, position, token);\n\t});\n}\n\nexport function getTypeDefinitionsAtPosition(model: ITextModel, position: Position, token: CancellationToken): Promise<LocationLink[]> {\n\treturn getDefinitions(model, position, TypeDefinitionProviderRegistry, (provider, model, position) => {\n\t\treturn provider.provideTypeDefinition(model, position, token);\n\t});\n}\n\nregisterDefaultLanguageCommand('_executeDefinitionProvider', (model, position) => getDefinitionsAtPosition(model, position, CancellationToken.None));\nregisterDefaultLanguageCommand('_executeDeclarationProvider', (model, position) => getDeclarationsAtPosition(model, position, CancellationToken.None));\nregisterDefaultLanguageCommand('_executeImplementationProvider', (model, position) => getImplementationsAtPosition(model, position, CancellationToken.None));\nregisterDefaultLanguageCommand('_executeTypeDefinitionProvider', (model, position) => getTypeDefinitionsAtPosition(model, position, CancellationToken.None));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Hover, HoverProviderRegistry } from 'vs/editor/common/modes';\n\nexport function getHover(model: ITextModel, position: Position, token: CancellationToken): Promise<Hover[]> {\n\n\tconst supports = HoverProviderRegistry.ordered(model);\n\n\tconst promises = supports.map(support => {\n\t\treturn Promise.resolve(support.provideHover(model, position, token)).then(hover => {\n\t\t\treturn hover && isValid(hover) ? hover : undefined;\n\t\t}, err => {\n\t\t\tonUnexpectedExternalError(err);\n\t\t\treturn undefined;\n\t\t});\n\t});\n\n\treturn Promise.all(promises).then(coalesce);\n}\n\nregisterDefaultLanguageCommand('_executeHoverProvider', (model, position) => getHover(model, position, CancellationToken.None));\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 nls from 'vs/nls';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands';\nimport { ICodeEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand';\nimport { TrimTrailingWhitespaceCommand } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand';\nimport { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations';\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 { Selection } from 'vs/editor/common/core/selection';\nimport { ICommand } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model';\nimport { CopyLinesCommand } from 'vs/editor/contrib/linesOperations/copyLinesCommand';\nimport { MoveLinesCommand } from 'vs/editor/contrib/linesOperations/moveLinesCommand';\nimport { SortLinesCommand } from 'vs/editor/contrib/linesOperations/sortLinesCommand';\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\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 CopyLinesCommand(selection, this.down));\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\tmenubarOpts: {\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\tmenubarOpts: {\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\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\tlet autoIndent = editor.getConfiguration().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\tmenubarOpts: {\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\tmenubarOpts: {\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 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.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_X),\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.KEY_K,\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: IIdentifiedSingleEditOperation[] = [];\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.US_CLOSE_SQUARE_BRACKET,\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 cursors = editor._getCursors();\n\t\tif (!cursors) {\n\t\t\treturn;\n\t\t}\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, TypeOperations.indent(cursors.context.config, 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.US_OPEN_SQUARE_BRACKET,\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 cursors = editor._getCursors();\n\t\tif (!cursors) {\n\t\t\treturn;\n\t\t}\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, TypeOperations.lineInsertBefore(cursors.context.config, 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 cursors = editor._getCursors();\n\t\tif (!cursors) {\n\t\t\treturn;\n\t\t}\n\t\teditor.pushUndoStop();\n\t\teditor.executeCommands(this.id, TypeOperations.lineInsertAfter(cursors.context.config, 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: IIdentifiedSingleEditOperation[] = 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 selection;\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.KEY_K, 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.KEY_J },\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: IIdentifiedSingleEditOperation[] = [];\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\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 wordSeparators = editor.getConfiguration().wordSeparators;\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\t\t\tif (selection.isEmpty()) {\n\t\t\t\tlet cursor = selection.getStartPosition();\n\t\t\t\tlet word = model.getWordAtPosition(cursor);\n\n\t\t\t\tif (!word) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet wordRange = new Range(cursor.lineNumber, word.startColumn, cursor.lineNumber, word.endColumn);\n\t\t\t\tlet text = model.getValueInRange(wordRange);\n\t\t\t\tcommands.push(new ReplaceCommandThatPreservesSelection(wordRange, this._modifyText(text, wordSeparators),\n\t\t\t\t\tnew Selection(cursor.lineNumber, cursor.column, cursor.lineNumber, cursor.column)));\n\n\t\t\t} else {\n\t\t\t\tlet text = model.getValueInRange(selection);\n\t\t\t\tcommands.push(new ReplaceCommandThatPreservesSelection(selection, this._modifyText(text, wordSeparators), 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\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\nexport class TitleCaseAction extends AbstractCaseAction {\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 separators = '\\r\\n\\t ' + wordSeparators;\n\t\tconst excludedChars = separators.split('');\n\n\t\tlet title = '';\n\t\tlet startUpperCase = true;\n\n\t\tfor (let i = 0; i < text.length; i++) {\n\t\t\tlet currentChar = text[i];\n\n\t\t\tif (excludedChars.indexOf(currentChar) >= 0) {\n\t\t\t\tstartUpperCase = true;\n\n\t\t\t\ttitle += currentChar;\n\t\t\t} else if (startUpperCase) {\n\t\t\t\tstartUpperCase = false;\n\n\t\t\t\ttitle += currentChar.toLocaleUpperCase();\n\t\t\t} else {\n\t\t\t\ttitle += currentChar.toLocaleLowerCase();\n\t\t\t}\n\t\t}\n\n\t\treturn title;\n\t}\n}\n\nregisterEditorAction(CopyLinesUpAction);\nregisterEditorAction(CopyLinesDownAction);\nregisterEditorAction(MoveLinesUpAction);\nregisterEditorAction(MoveLinesDownAction);\nregisterEditorAction(SortLinesAscendingAction);\nregisterEditorAction(SortLinesDescendingAction);\nregisterEditorAction(TrimTrailingWhitespaceAction);\nregisterEditorAction(DeleteLinesAction);\nregisterEditorAction(IndentLinesAction);\nregisterEditorAction(OutdentLinesAction);\nregisterEditorAction(InsertLineBeforeAction);\nregisterEditorAction(InsertLineAfterAction);\nregisterEditorAction(DeleteAllLeftAction);\nregisterEditorAction(DeleteAllRightAction);\nregisterEditorAction(JoinLinesAction);\nregisterEditorAction(TransposeAction);\nregisterEditorAction(UpperCaseAction);\nregisterEditorAction(LowerCaseAction);\nregisterEditorAction(TitleCaseAction);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { first } from 'vs/base/common/async';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as modes from 'vs/editor/common/modes';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { CancellationToken } from 'vs/base/common/cancellation';\n\nexport const Context = {\n\tVisible: new RawContextKey<boolean>('parameterHintsVisible', false),\n\tMultipleSignatures: new RawContextKey<boolean>('parameterHintsMultipleSignatures', false),\n};\n\nexport function provideSignatureHelp(model: ITextModel, position: Position, context: modes.SignatureHelpContext, token: CancellationToken): Promise<modes.SignatureHelp | null | undefined> {\n\n\tconst supports = modes.SignatureHelpProviderRegistry.ordered(model);\n\n\treturn first(supports.map(support => () => {\n\t\treturn Promise.resolve(support.provideSignatureHelp(model, position, token, context)).catch(onUnexpectedExternalError);\n\t}));\n}\n\nregisterDefaultLanguageCommand('_executeSignatureHelpProvider', (model, position, args) =>\n\tprovideSignatureHelp(model, position, {\n\t\ttriggerKind: modes.SignatureHelpTriggerKind.Invoke,\n\t\tisRetrigger: false,\n\t\ttriggerCharacter: args['triggerCharacter']\n\t}, CancellationToken.None));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';\nimport { CharacterSet } from 'vs/editor/common/core/characterClassifier';\nimport * as modes from 'vs/editor/common/modes';\nimport { provideSignatureHelp } from 'vs/editor/contrib/parameterHints/provideSignatureHelp';\n\nexport interface TriggerContext {\n\treadonly triggerKind: modes.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 = new class { readonly type = Type.Default; };\n\n\texport class Pending {\n\t\treadonly type = Type.Pending;\n\t\tconstructor(\n\t\t\treadonly request: CancelablePromise<any>\n\t\t) { }\n\t}\n\n\texport class Active {\n\t\treadonly type = Type.Active;\n\t\tconstructor(\n\t\t\treadonly hints: modes.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<modes.SignatureHelp | undefined>());\n\tpublic readonly onChangedHints = this._onChangedHints.event;\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate enabled: boolean;\n\tprivate _state: ParameterHintState.State = ParameterHintState.Default;\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\tdelay: number = ParameterHintsModel.DEFAULT_DELAY\n\t) {\n\t\tsuper();\n\n\t\tthis.editor = editor;\n\t\tthis.enabled = false;\n\n\t\tthis.throttledDelayer = new Delayer(delay);\n\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(modes.SignatureHelpProviderRegistry.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\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 || !modes.SignatureHelpProviderRegistry.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst triggerId = ++this.triggerId;\n\t\tthis.throttledDelayer.trigger(\n\t\t\t() => this.doTrigger({\n\t\t\t\ttriggerKind: context.triggerKind,\n\t\t\t\ttriggerCharacter: context.triggerCharacter,\n\t\t\t\tisRetrigger: this.state.type === ParameterHintState.Type.Active || this.state.type === ParameterHintState.Type.Pending,\n\t\t\t\tactiveSignatureHelp: this.state.type === ParameterHintState.Type.Active ? this.state.hints : undefined\n\t\t\t}, triggerId), delay).then(undefined, 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.getConfiguration().contribInfo.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.getConfiguration().contribInfo.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 doTrigger(triggerContext: modes.SignatureHelpContext, triggerId: number): Promise<boolean> {\n\t\tthis.cancel(true);\n\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn Promise.resolve(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(createCancelablePromise(token =>\n\t\t\tprovideSignatureHelp(model, position, triggerContext, token)));\n\n\t\treturn this.state.request.then(result => {\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\treturn false;\n\t\t\t}\n\n\t\t\tif (!result || !result.signatures || result.signatures.length === 0) {\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);\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 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 modes.SignatureHelpProviderRegistry.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.enabled) {\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: modes.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: modes.SignatureHelpTriggerKind.ContentChange });\n\t\t}\n\t}\n\n\tprivate onModelContentChange(): void {\n\t\tif (this.isTriggered) {\n\t\t\tthis.trigger({ triggerKind: modes.SignatureHelpTriggerKind.ContentChange });\n\t\t}\n\t}\n\n\tprivate onEditorConfigurationChange(): void {\n\t\tthis.enabled = this.editor.getConfiguration().contribInfo.parameterHints.enabled;\n\n\t\tif (!this.enabled) {\n\t\t\tthis.cancel();\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel(true);\n\t\tsuper.dispose();\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 { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { URI } from 'vs/base/common/uri';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { registerLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { DocumentSymbol, DocumentSymbolProviderRegistry } from 'vs/editor/common/modes';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\n\nexport function getDocumentSymbols(model: ITextModel, flat: boolean, token: CancellationToken): Promise<DocumentSymbol[]> {\n\n\tlet roots: DocumentSymbol[] = [];\n\n\tlet promises = DocumentSymbolProviderRegistry.all(model).map(support => {\n\n\t\treturn Promise.resolve(support.provideDocumentSymbols(model, token)).then(result => {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\troots.push(...result);\n\t\t\t}\n\t\t}, err => {\n\t\t\tonUnexpectedExternalError(err);\n\t\t});\n\t});\n\n\treturn Promise.all(promises).then(() => {\n\t\tlet flatEntries: DocumentSymbol[] = [];\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn flatEntries;\n\t\t}\n\t\tif (flat) {\n\t\t\tflatten(flatEntries, roots, '');\n\t\t} else {\n\t\t\tflatEntries = roots;\n\t\t}\n\t\tflatEntries.sort(compareEntriesUsingStart);\n\t\treturn flatEntries;\n\t});\n}\n\nfunction compareEntriesUsingStart(a: DocumentSymbol, b: DocumentSymbol): number {\n\treturn Range.compareRangesUsingStarts(a.range, b.range);\n}\n\nfunction flatten(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideContainerLabel: string): void {\n\tfor (let entry of entries) {\n\t\tbucket.push({\n\t\t\tkind: entry.kind,\n\t\t\tname: entry.name,\n\t\t\tdetail: entry.detail,\n\t\t\tcontainerName: entry.containerName || overrideContainerLabel,\n\t\t\trange: entry.range,\n\t\t\tselectionRange: entry.selectionRange,\n\t\t\tchildren: undefined, // we flatten it...\n\t\t});\n\t\tif (entry.children) {\n\t\t\tflatten(bucket, entry.children, entry.name);\n\t\t}\n\t}\n}\n\n\nregisterLanguageCommand('_executeDocumentSymbolProvider', function (accessor, args) {\n\tconst { resource } = args;\n\tif (!(resource instanceof URI)) {\n\t\tthrow illegalArgument('resource');\n\t}\n\tconst model = accessor.get(IModelService).getModel(resource);\n\tif (model) {\n\t\treturn getDocumentSymbols(model, false, CancellationToken.None);\n\t}\n\n\treturn accessor.get(ITextModelService).createModelReference(resource).then(reference => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst result = getDocumentSymbols(reference.object.textEditorModel, false, CancellationToken.None);\n\t\t\t\tresolve(result);\n\t\t\t} catch (err) {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t}).finally(() => {\n\t\t\treference.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 * as arrays from 'vs/base/common/arrays';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, registerEditorContribution, ServicesAccessor, registerDefaultLanguageCommand } 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 { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport * as modes from 'vs/editor/common/modes';\nimport * as nls from 'vs/nls';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/wordSelections';\nimport { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/bracketSelections';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\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\tprivate static readonly _id = 'editor.contrib.smartSelectController';\n\n\tstatic get(editor: ICodeEditor): SmartSelectController {\n\t\treturn editor.getContribution<SmartSelectController>(SmartSelectController._id);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\n\tprivate _state?: SelectionRanges[];\n\tprivate _selectionListener?: IDisposable;\n\tprivate _ignoreSelection: boolean = false;\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis._editor = editor;\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._selectionListener);\n\t}\n\n\tgetId(): string {\n\t\treturn SmartSelectController._id;\n\t}\n\n\trun(forward: boolean): Promise<void> | 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 (!modes.SelectionRangeRegistry.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tlet promise: Promise<void> = Promise.resolve(undefined);\n\n\t\tif (!this._state) {\n\t\t\tpromise = provideSelectionRanges(model, selections.map(s => s.getPosition()), 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\tdispose(this._selectionListener);\n\t\t\t\tthis._selectionListener = this._editor.onDidChangeCursorPosition(() => {\n\t\t\t\t\tif (!this._ignoreSelection) {\n\t\t\t\t\t\tdispose(this._selectionListener);\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\treturn promise.then(() => {\n\t\t\tif (!this._state) {\n\t\t\t\t// no state\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._state = this._state.map(state => state.mov(forward));\n\t\t\tconst selections = this._state.map(state => Selection.fromPositions(state.ranges[state.index].getStartPosition(), state.ranges[state.index].getEndPosition()));\n\t\t\tthis._ignoreSelection = true;\n\t\t\ttry {\n\t\t\t\tthis._editor.setSelections(selections);\n\t\t\t} finally {\n\t\t\t\tthis._ignoreSelection = false;\n\t\t\t}\n\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: null,\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: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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: null,\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: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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);\nregisterEditorAction(GrowSelectionAction);\nregisterEditorAction(ShrinkSelectionAction);\n\n// word selection\nmodes.SelectionRangeRegistry.register('*', new WordSelectionRangeProvider());\n\nexport function provideSelectionRanges(model: ITextModel, positions: Position[], token: CancellationToken): Promise<Range[][]> {\n\n\tconst providers = modes.SelectionRangeRegistry.all(model);\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\treturn Promise.all(work).then(() => {\n\n\t\treturn allRawRanges.map(oneRawRanges => {\n\n\t\t\tif (oneRawRanges.length === 0) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// sort all by start/end position\n\t\t\toneRawRanges.sort((a, b) => {\n\t\t\t\tif (Position.isBefore(a.getStartPosition(), b.getStartPosition())) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (Position.isBefore(b.getStartPosition(), a.getStartPosition())) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (Position.isBefore(a.getEndPosition(), b.getEndPosition())) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (Position.isBefore(b.getEndPosition(), a.getEndPosition())) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// remove ranges that don't contain the former range or that are equal to the\n\t\t\t// former range\n\t\t\tlet oneRanges: Range[] = [];\n\t\t\tlet last: Range | undefined;\n\t\t\tfor (const range of oneRawRanges) {\n\t\t\t\tif (!last || (Range.containsRange(range, last) && !Range.equalsRange(range, last))) {\n\t\t\t\t\toneRanges.push(range);\n\t\t\t\t\tlast = range;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add ranges that expand trivia at line starts and ends whenever a range\n\t\t\t// wraps onto the a new line\n\t\t\tlet oneRangesWithTrivia: Range[] = [oneRanges[0]];\n\t\t\tfor (let i = 1; i < oneRanges.length; i++) {\n\t\t\t\tconst prev = oneRanges[i - 1];\n\t\t\t\tconst cur = oneRanges[i];\n\t\t\t\tif (cur.startLineNumber !== prev.startLineNumber || cur.endLineNumber !== prev.endLineNumber) {\n\t\t\t\t\t// add line/block range without leading/failing whitespace\n\t\t\t\t\tconst rangeNoWhitespace = new Range(prev.startLineNumber, model.getLineFirstNonWhitespaceColumn(prev.startLineNumber), prev.endLineNumber, model.getLineLastNonWhitespaceColumn(prev.endLineNumber));\n\t\t\t\t\tif (rangeNoWhitespace.containsRange(prev) && !rangeNoWhitespace.equalsRange(prev)) {\n\t\t\t\t\t\toneRangesWithTrivia.push(rangeNoWhitespace);\n\t\t\t\t\t}\n\t\t\t\t\t// add line/block range\n\t\t\t\t\tconst rangeFull = new Range(prev.startLineNumber, 1, prev.endLineNumber, model.getLineMaxColumn(prev.endLineNumber));\n\t\t\t\t\tif (rangeFull.containsRange(prev) && !rangeFull.equalsRange(rangeNoWhitespace)) {\n\t\t\t\t\t\toneRangesWithTrivia.push(rangeFull);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toneRangesWithTrivia.push(cur);\n\t\t\t}\n\t\t\treturn oneRangesWithTrivia;\n\t\t});\n\t});\n}\n\nregisterDefaultLanguageCommand('_executeSelectionRangeProvider', function (model, _position, args) {\n\treturn provideSelectionRanges(model, args.positions, CancellationToken.None);\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { first } from 'vs/base/common/async';\nimport { assign } from 'vs/base/common/objects';\nimport { onUnexpectedExternalError, canceled, isPromiseCanceledError } from 'vs/base/common/errors';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport * as modes from 'vs/editor/common/modes';\nimport { Position, IPosition } from 'vs/editor/common/core/position';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { Range } from 'vs/editor/common/core/range';\nimport { FuzzyScore } from 'vs/base/common/filters';\n\nexport const Context = {\n\tVisible: new RawContextKey<boolean>('suggestWidgetVisible', false),\n\tMultipleSuggestions: new RawContextKey<boolean>('suggestWidgetMultipleSuggestions', false),\n\tMakesTextEdit: new RawContextKey('suggestionMakesTextEdit', true),\n\tAcceptSuggestionsOnEnter: new RawContextKey<boolean>('acceptSuggestionOnEnter', true)\n};\n\nexport class CompletionItem {\n\n\treadonly resolve: (token: CancellationToken) => Promise<void>;\n\n\t// perf\n\treadonly labelLow: string;\n\treadonly sortTextLow?: string;\n\treadonly filterTextLow?: string;\n\n\t// sorting, filtering\n\tscore: FuzzyScore = FuzzyScore.Default;\n\tdistance: number = 0;\n\tidx?: number;\n\tword?: string;\n\n\tconstructor(\n\t\treadonly position: IPosition,\n\t\treadonly completion: modes.CompletionItem,\n\t\treadonly container: modes.CompletionList,\n\t\treadonly provider: modes.CompletionItemProvider,\n\t\tmodel: ITextModel\n\t) {\n\t\t// ensure lower-variants (perf)\n\t\tthis.labelLow = completion.label.toLowerCase();\n\t\tthis.sortTextLow = completion.sortText && completion.sortText.toLowerCase();\n\t\tthis.filterTextLow = completion.filterText && completion.filterText.toLowerCase();\n\n\t\t// create the suggestion resolver\n\t\tconst { resolveCompletionItem } = provider;\n\t\tif (typeof resolveCompletionItem !== 'function') {\n\t\t\tthis.resolve = () => Promise.resolve();\n\t\t} else {\n\t\t\tlet cached: Promise<void> | undefined;\n\t\t\tthis.resolve = (token) => {\n\t\t\t\tif (!cached) {\n\t\t\t\t\tlet isDone = false;\n\t\t\t\t\tcached = Promise.resolve(resolveCompletionItem.call(provider, model, position, completion, token)).then(value => {\n\t\t\t\t\t\tassign(completion, value);\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t}, err => {\n\t\t\t\t\t\tif (isPromiseCanceledError(err)) {\n\t\t\t\t\t\t\t// the IPC queue will reject the request with the\n\t\t\t\t\t\t\t// cancellation error -> reset cached\n\t\t\t\t\t\t\tcached = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\ttoken.onCancellationRequested(() => {\n\t\t\t\t\t\tif (!isDone) {\n\t\t\t\t\t\t\t// cancellation after the request has been\n\t\t\t\t\t\t\t// dispatched -> reset cache\n\t\t\t\t\t\t\tcached = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t};\n\t\t}\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<modes.CompletionItemKind>(),\n\t\treadonly providerFilter = new Set<modes.CompletionItemProvider>(),\n\t) { }\n}\n\nlet _snippetSuggestSupport: modes.CompletionItemProvider;\n\nexport function getSnippetSuggestSupport(): modes.CompletionItemProvider {\n\treturn _snippetSuggestSupport;\n}\n\nexport function provideSuggestionItems(\n\tmodel: ITextModel,\n\tposition: Position,\n\toptions: CompletionOptions = CompletionOptions.default,\n\tcontext: modes.CompletionContext = { triggerKind: modes.CompletionTriggerKind.Invoke },\n\ttoken: CancellationToken = CancellationToken.None\n): Promise<CompletionItem[]> {\n\n\tconst allSuggestions: CompletionItem[] = [];\n\tconst wordUntil = model.getWordUntilPosition(position);\n\tconst defaultRange = new Range(position.lineNumber, wordUntil.startColumn, position.lineNumber, wordUntil.endColumn);\n\n\tposition = position.clone();\n\n\t// get provider groups, always add snippet suggestion provider\n\tconst supports = modes.CompletionProviderRegistry.orderedGroups(model);\n\n\t// add snippets provider unless turned off\n\tif (!options.kindFilter.has(modes.CompletionItemKind.Snippet) && _snippetSuggestSupport) {\n\t\tsupports.unshift([_snippetSuggestSupport]);\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\tlet hasResult = false;\n\tconst factory = supports.map(supports => () => {\n\t\t// for each support in the group ask for suggestions\n\t\treturn Promise.all(supports.map(provider => {\n\n\t\t\tif (options.providerFilter.size > 0 && !options.providerFilter.has(provider)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn Promise.resolve(provider.provideCompletionItems(model, position, context, token)).then(container => {\n\n\t\t\t\tconst len = allSuggestions.length;\n\n\t\t\t\tif (container) {\n\t\t\t\t\tfor (let suggestion of container.suggestions || []) {\n\t\t\t\t\t\tif (!options.kindFilter.has(suggestion.kind)) {\n\n\t\t\t\t\t\t\t// fill in default range when missing\n\t\t\t\t\t\t\tif (!suggestion.range) {\n\t\t\t\t\t\t\t\tsuggestion.range = defaultRange;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tallSuggestions.push(new CompletionItem(position, suggestion, container, provider, model));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (len !== allSuggestions.length && provider !== _snippetSuggestSupport) {\n\t\t\t\t\thasResult = true;\n\t\t\t\t}\n\n\t\t\t}, onUnexpectedExternalError);\n\t\t}));\n\t});\n\n\tconst result = first(factory, () => {\n\t\t// stop on result or cancellation\n\t\treturn hasResult || token.isCancellationRequested;\n\t}).then(() => {\n\t\tif (token.isCancellationRequested) {\n\t\t\treturn Promise.reject<any>(canceled());\n\t\t}\n\t\treturn allSuggestions.sort(getSuggestionComparator(options.snippetSortOrder));\n\t});\n\n\t// result.then(items => {\n\t// \tconsole.log(model.getWordUntilPosition(position), items.map(item => `${item.suggestion.label}, type=${item.suggestion.type}, incomplete?${item.container.incomplete}, overwriteBefore=${item.suggestion.overwriteBefore}`));\n\t// \treturn items;\n\t// }, err => {\n\t// \tconsole.warn(model.getWordUntilPosition(position), err);\n\t// });\n\n\treturn result;\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 === modes.CompletionItemKind.Snippet) {\n\t\t\treturn -1;\n\t\t} else if (b.completion.kind === modes.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 === modes.CompletionItemKind.Snippet) {\n\t\t\treturn 1;\n\t\t} else if (b.completion.kind === modes.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\nregisterDefaultLanguageCommand('_executeCompletionItemProvider', (model, position, args) => {\n\n\tconst result: modes.CompletionList = {\n\t\tincomplete: false,\n\t\tsuggestions: []\n\t};\n\n\tlet resolving: Promise<any>[] = [];\n\tlet maxItemsToResolve = args['maxItemsToResolve'] || 0;\n\n\treturn provideSuggestionItems(model, position).then(items => {\n\t\tfor (const item of items) {\n\t\t\tif (resolving.length < maxItemsToResolve) {\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\t}).then(() => {\n\t\treturn Promise.all(resolving);\n\t}).then(() => {\n\t\treturn result;\n\t});\n});\n\ninterface SuggestController extends IEditorContribution {\n\ttriggerSuggest(onlyFrom?: Set<modes.CompletionItemProvider>): void;\n}\n\nconst _provider = new class implements modes.CompletionItemProvider {\n\n\tonlyOnceSuggestions: modes.CompletionItem[] = [];\n\n\tprovideCompletionItems(): modes.CompletionList {\n\t\tlet suggestions = this.onlyOnceSuggestions.slice(0);\n\t\tlet result = { suggestions };\n\t\tthis.onlyOnceSuggestions.length = 0;\n\t\treturn result;\n\t}\n};\n\nmodes.CompletionProviderRegistry.register('*', _provider);\n\nexport function showSimpleSuggestions(editor: ICodeEditor, suggestions: modes.CompletionItem[]) {\n\tsetTimeout(() => {\n\t\t_provider.onlyOnceSuggestions.push(...suggestions);\n\t\teditor.getContribution<SuggestController>('editor.contrib.suggestController').triggerSuggest(new Set<modes.CompletionItemProvider>().add(_provider));\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 * as nls from 'vs/nls';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { TabFocus } from 'vs/editor/common/config/commonEditorConfig';\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_M,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_M },\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 * as nls from 'vs/nls';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { StopWatch } from 'vs/base/common/stopwatch';\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: null\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.flushTokens();\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\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 { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorCommand, ICommandOptions, ServicesAccessor, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';\nimport { CursorState } from 'vs/editor/common/controller/cursorCommon';\nimport { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';\nimport { WordNavigationType, WordOperations } from 'vs/editor/common/controller/cursorWordOperations';\nimport { WordCharacterClassifier, getMapForWordSeparators } from 'vs/editor/common/controller/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 { 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 config = editor.getConfiguration();\n\t\tconst wordSeparators = getMapForWordSeparators(config.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\teditor._getCursors().setStates('moveWordCommand', CursorChangeReason.NotSet, 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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\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 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: null\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: null\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\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\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: null\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.WordStart,\n\t\t\tid: 'cursorWordLeftSelect',\n\t\t\tprecondition: null\n\t\t});\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: null\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\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: null\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: null\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.textInputFocus,\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: null\n\t\t});\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\tif (!editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst config = editor.getConfiguration();\n\t\tconst wordSeparators = getMapForWordSeparators(config.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 = this._delete(wordSeparators, model, sel, this._whitespaceHeuristics, 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(wordSeparators: WordCharacterClassifier, model: ITextModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range;\n}\n\nexport class DeleteWordLeftCommand extends DeleteWordCommand {\n\tprotected _delete(wordSeparators: WordCharacterClassifier, model: ITextModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordOperations.deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, 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(wordSeparators: WordCharacterClassifier, model: ITextModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordOperations.deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\t\tconst lineCount = model.getLineCount();\n\t\tconst maxColumn = 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\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 DeleteWordStartLeft());\nregisterEditorCommand(new DeleteWordEndLeft());\nregisterEditorCommand(new DeleteWordLeft());\nregisterEditorCommand(new DeleteWordStartRight());\nregisterEditorCommand(new DeleteWordEndRight());\nregisterEditorCommand(new DeleteWordRight());\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { WordNavigationType, WordPartOperations } from 'vs/editor/common/controller/cursorWordOperations';\nimport { WordCharacterClassifier } from 'vs/editor/common/controller/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 { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { DeleteWordCommand, MoveWordCommand } from 'vs/editor/contrib/wordOperations/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(wordSeparators: WordCharacterClassifier, model: ITextModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordPartOperations.deleteWordPartLeft(wordSeparators, model, selection, whitespaceHeuristics);\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(wordSeparators: WordCharacterClassifier, model: ITextModel, selection: Selection, whitespaceHeuristics: boolean, wordNavigationType: WordNavigationType): Range {\n\t\tlet r = WordPartOperations.deleteWordPartRight(wordSeparators, model, selection, whitespaceHeuristics);\n\t\tif (r) {\n\t\t\treturn r;\n\t\t}\n\t\tconst lineCount = model.getLineCount();\n\t\tconst maxColumn = 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: null,\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: null,\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: null,\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: null,\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!./iPadShowKeyboard';\nimport * as browser from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { IDisposable, dispose } 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';\n\nexport class IPadShowKeyboard implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.iPadShowKeyboard';\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate widget: ShowKeyboardWidget | null;\n\tprivate toDispose: IDisposable[];\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis.editor = editor;\n\t\tthis.toDispose = [];\n\t\tif (browser.isIPad) {\n\t\t\tthis.toDispose.push(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.getConfiguration().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 getId(): string {\n\t\treturn IPadShowKeyboard.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.toDispose = dispose(this.toDispose);\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 implements IOverlayWidget {\n\n\tprivate static readonly ID = 'editor.contrib.ShowKeyboardWidget';\n\n\tprivate readonly editor: ICodeEditor;\n\n\tprivate readonly _domNode: HTMLElement;\n\tprivate _toDispose: IDisposable[];\n\n\tconstructor(editor: ICodeEditor) {\n\t\tthis.editor = editor;\n\t\tthis._domNode = document.createElement('textarea');\n\t\tthis._domNode.className = 'iPadShowKeyboard';\n\n\t\tthis._toDispose = [];\n\t\tthis._toDispose.push(dom.addDisposableListener(this._domNode, 'touchstart', (e) => {\n\t\t\tthis.editor.focus();\n\t\t}));\n\t\tthis._toDispose.push(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 dispose(): void {\n\t\tthis.editor.removeOverlayWidget(this);\n\t\tthis._toDispose = dispose(this._toDispose);\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);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/standaloneThemeService';\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: null\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.getTheme().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 * as platform from 'vs/platform/registry/common/platform';\nimport { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';\nimport { Color, RGBA } from 'vs/base/common/color';\nimport { ITheme } from 'vs/platform/theme/common/themeService';\nimport { Event, Emitter } from 'vs/base/common/event';\n\nimport * as nls from 'vs/nls';\nimport { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';\nimport { RunOnceScheduler } from 'vs/base/common/async';\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\nexport interface ColorFunction {\n\t(theme: ITheme): Color | undefined;\n}\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 refence to other color or a derived color\n */\nexport type ColorValue = Color | string | ColorIdentifier | ColorFunction;\n\n// color registry\nexport const Extensions = {\n\tColorContribution: 'base.contributions.colors'\n};\n\nexport interface IColorRegistry {\n\n\t/**\n\t * Gets the default color of the given id\n\t */\n\tresolveDefaultColor(id: ColorIdentifier, theme: ITheme): Color | undefined;\n\n}\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', default: '#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 resolveDefaultColor(id: ColorIdentifier, theme: ITheme): 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.\"));\n\nexport const focusBorder = registerColor('focusBorder', { dark: Color.fromHex('#0E639C').transparent(0.8), light: Color.fromHex('#007ACC').transparent(0.4), 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.\"));\nexport const textLinkForeground = registerColor('textLink.foreground', { light: '#006AB1', dark: '#3794FF', hc: '#3794FF' }, nls.localize('textLinkForeground', \"Foreground color for links 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: '#000000', light: '#A8A8A8', 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: '#007ACC', light: '#007ACC', hc: activeContrastBorder }, nls.localize('inputBoxActiveOptionBorder', \"Border color of activated options in input fields.\"));\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 selectForeground = registerColor('dropdown.foreground', { dark: '#F0F0F0', light: null, hc: Color.white }, nls.localize('dropdownForeground', \"Dropdown foreground.\"));\n\nexport const listFocusBackground = registerColor('list.focusBackground', { dark: '#062F4A', light: '#D6EBFF', 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 listActiveSelectionBackground = registerColor('list.activeSelectionBackground', { dark: '#094771', light: '#0074E8', 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 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 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 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: listFocusBackground, light: listFocusBackground, 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: '#0097fb', light: '#0066BF', hc: focusBorder }, nls.localize('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.'));\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.'));\n\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\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 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 * 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 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 * 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 * 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 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/**\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 * 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 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.'));\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 stabstop of a snippet.\"));\n\nconst findMatchColorDefault = new Color(new RGBA(246, 185, 77, 0.7));\nexport const overviewRulerFindMatchForeground = registerColor('editorOverviewRuler.findMatchForeground', { dark: findMatchColorDefault, light: findMatchColorDefault, hc: findMatchColorDefault }, 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\n// ----- color functions\n\nexport function darken(colorValue: ColorValue, factor: number): ColorFunction {\n\treturn (theme) => {\n\t\tlet color = resolveColorValue(colorValue, theme);\n\t\tif (color) {\n\t\t\treturn color.darken(factor);\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport function lighten(colorValue: ColorValue, factor: number): ColorFunction {\n\treturn (theme) => {\n\t\tlet color = resolveColorValue(colorValue, theme);\n\t\tif (color) {\n\t\t\treturn color.lighten(factor);\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport function transparent(colorValue: ColorValue, factor: number): ColorFunction {\n\treturn (theme) => {\n\t\tlet color = resolveColorValue(colorValue, theme);\n\t\tif (color) {\n\t\t\treturn color.transparent(factor);\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport function oneOf(...colorValues: ColorValue[]): ColorFunction {\n\treturn (theme) => {\n\t\tfor (let colorValue of colorValues) {\n\t\t\tlet color = resolveColorValue(colorValue, theme);\n\t\t\tif (color) {\n\t\t\t\treturn color;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nfunction lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue, factor: number, transparency: number): ColorFunction {\n\treturn (theme) => {\n\t\tlet from = resolveColorValue(colorValue, theme);\n\t\tif (from) {\n\t\t\tlet backgroundColor = resolveColorValue(backgroundColorValue, theme);\n\t\t\tif (backgroundColor) {\n\t\t\t\tif (from.isDarkerThan(backgroundColor)) {\n\t\t\t\t\treturn Color.getLighterColor(from, backgroundColor, factor).transparent(transparency);\n\t\t\t\t}\n\t\t\t\treturn Color.getDarkerColor(from, backgroundColor, factor).transparent(transparency);\n\t\t\t}\n\t\t\treturn from.transparent(factor * transparency);\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\n// ----- implementation\n\n/**\n * @param colorValue Resolve a color value in the context of a theme\n */\nfunction resolveColorValue(colorValue: ColorValue | null, theme: ITheme): 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 === 'function') {\n\t\treturn 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\n\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./renameInputField';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } 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 { inputBackground, inputBorder, inputForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey<boolean>('renameInputVisible', false);\n\nexport class RenameInputField implements IContentWidget, IDisposable {\n\n\tprivate _editor: ICodeEditor;\n\tprivate _position: Position;\n\tprivate _domNode: HTMLElement;\n\tprivate _inputField: HTMLInputElement;\n\tprivate _visible: boolean;\n\tprivate readonly _visibleContextKey: IContextKey<boolean>;\n\tprivate _disposables: IDisposable[] = [];\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\tpublic allowEditorOverflow: boolean = true;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tprivate readonly themeService: IThemeService,\n\t\tcontextKeyService: IContextKeyService,\n\t) {\n\t\tthis._visibleContextKey = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(contextKeyService);\n\n\t\tthis._editor = editor;\n\t\tthis._editor.addContentWidget(this);\n\n\t\tthis._disposables.push(editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.fontInfo) {\n\t\t\t\tthis.updateFont();\n\t\t\t}\n\t\t}));\n\n\t\tthis._disposables.push(themeService.onThemeChange(theme => this.onThemeChange(theme)));\n\t}\n\n\tprivate onThemeChange(theme: ITheme): void {\n\t\tthis.updateStyles(theme);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._disposables = dispose(this._disposables);\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tpublic getId(): string {\n\t\treturn '__renameInputWidget';\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\tif (!this._domNode) {\n\t\t\tthis._inputField = document.createElement('input');\n\t\t\tthis._inputField.className = 'rename-input';\n\t\t\tthis._inputField.type = 'text';\n\t\t\tthis._inputField.setAttribute('aria-label', localize('renameAriaLabel', \"Rename input. Type new name and press Enter to commit.\"));\n\t\t\tthis._domNode = document.createElement('div');\n\t\t\tthis._domNode.style.height = `${this._editor.getConfiguration().lineHeight}px`;\n\t\t\tthis._domNode.className = 'monaco-editor rename-box';\n\t\t\tthis._domNode.appendChild(this._inputField);\n\n\t\t\tthis.updateFont();\n\t\t\tthis.updateStyles(this.themeService.getTheme());\n\t\t}\n\t\treturn this._domNode;\n\t}\n\n\tprivate updateStyles(theme: ITheme): void {\n\t\tif (!this._inputField) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst background = theme.getColor(inputBackground);\n\t\tconst foreground = theme.getColor(inputForeground);\n\t\tconst widgetShadowColor = theme.getColor(widgetShadow);\n\t\tconst border = theme.getColor(inputBorder);\n\n\t\tthis._inputField.style.backgroundColor = background ? background.toString() : null;\n\t\tthis._inputField.style.color = foreground ? foreground.toString() : null;\n\n\t\tthis._inputField.style.borderWidth = border ? '1px' : '0px';\n\t\tthis._inputField.style.borderStyle = border ? 'solid' : 'none';\n\t\tthis._inputField.style.borderColor = border ? border.toString() : 'none';\n\n\t\tthis._domNode.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : null;\n\t}\n\n\tprivate updateFont(): void {\n\t\tif (!this._inputField) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst fontInfo = this._editor.getConfiguration().fontInfo;\n\t\tthis._inputField.style.fontFamily = fontInfo.fontFamily;\n\t\tthis._inputField.style.fontWeight = fontInfo.fontWeight;\n\t\tthis._inputField.style.fontSize = `${fontInfo.fontSize}px`;\n\t}\n\n\tpublic getPosition(): IContentWidgetPosition | null {\n\t\treturn this._visible\n\t\t\t? { position: this._position, preference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE] }\n\t\t\t: null;\n\t}\n\n\tprivate _currentAcceptInput: (() => void) | null = null;\n\tprivate _currentCancelInput: ((focusEditor: boolean) => void) | null = null;\n\n\tpublic acceptInput(): void {\n\t\tif (this._currentAcceptInput) {\n\t\t\tthis._currentAcceptInput();\n\t\t}\n\t}\n\n\tpublic cancelInput(focusEditor: boolean): void {\n\t\tif (this._currentCancelInput) {\n\t\t\tthis._currentCancelInput(focusEditor);\n\t\t}\n\t}\n\n\tpublic getInput(where: IRange, value: string, selectionStart: number, selectionEnd: number): Promise<string | boolean> {\n\n\t\tthis._position = new Position(where.startLineNumber, where.startColumn);\n\t\tthis._inputField.value = value;\n\t\tthis._inputField.setAttribute('selectionStart', selectionStart.toString());\n\t\tthis._inputField.setAttribute('selectionEnd', selectionEnd.toString());\n\t\tthis._inputField.size = Math.max((where.endColumn - where.startColumn) * 1.1, 20);\n\n\t\tconst disposeOnDone: IDisposable[] = [];\n\t\tconst always = () => {\n\t\t\tdispose(disposeOnDone);\n\t\t\tthis._hide();\n\t\t};\n\n\t\treturn new Promise<string | boolean>(resolve => {\n\n\t\t\tthis._currentCancelInput = (focusEditor) => {\n\t\t\t\tthis._currentAcceptInput = null;\n\t\t\t\tthis._currentCancelInput = null;\n\t\t\t\tresolve(focusEditor);\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tthis._currentAcceptInput = () => {\n\t\t\t\tif (this._inputField.value.trim().length === 0 || this._inputField.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 = null;\n\t\t\t\tthis._currentCancelInput = null;\n\t\t\t\tresolve(this._inputField.value);\n\t\t\t};\n\n\t\t\tlet onCursorChanged = () => {\n\t\t\t\tconst editorPosition = this._editor.getPosition();\n\t\t\t\tif (!editorPosition || !Range.containsPosition(where, editorPosition)) {\n\t\t\t\t\tthis.cancelInput(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tdisposeOnDone.push(this._editor.onDidChangeCursorSelection(onCursorChanged));\n\t\t\tdisposeOnDone.push(this._editor.onDidBlurEditorWidget(() => this.cancelInput(false)));\n\n\t\t\tthis._show();\n\n\t\t}).then(newValue => {\n\t\t\talways();\n\t\t\treturn newValue;\n\t\t}, err => {\n\t\t\talways();\n\t\t\treturn Promise.reject(err);\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._inputField.focus();\n\t\t\tthis._inputField.setSelectionRange(\n\t\t\t\tparseInt(this._inputField.getAttribute('selectionStart')!),\n\t\t\t\tparseInt(this._inputField.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 { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';\nimport { inputBackground, inputForeground, ColorIdentifier, inputBorder, foreground, editorBackground, contrastBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetBackground } from 'vs/platform/theme/common/colorRegistry';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { Color } from 'vs/base/common/color';\nimport { mixin } from 'vs/base/common/objects';\n\nexport type styleFn = (colors: { [name: string]: Color | undefined }) => void;\n\nexport interface IStyleOverrides {\n\t[color: string]: ColorIdentifier | undefined;\n}\n\nexport interface IThemable {\n\tstyle: styleFn;\n}\n\nexport interface IColorMapping {\n\t[optionsKey: string]: ColorIdentifier | ColorFunction | undefined;\n}\n\nexport interface IComputedStyles {\n\t[color: string]: Color | undefined;\n}\n\nexport function computeStyles(theme: ITheme, styleMap: IColorMapping): IComputedStyles {\n\tconst styles = Object.create(null) as IComputedStyles;\n\tfor (let key in styleMap) {\n\t\tconst value = styleMap[key as string];\n\t\tif (typeof value === 'string') {\n\t\t\tstyles[key] = theme.getColor(value);\n\t\t} else if (typeof value === 'function') {\n\t\t\tstyles[key] = 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(theme: ITheme): void {\n\t\tconst styles = computeStyles(themeService.getTheme(), 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(themeService.getTheme());\n\n\treturn themeService.onThemeChange(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 && style.badgeBackground) || badgeBackground,\n\t\tbadgeForeground: (style && style.badgeForeground) || badgeForeground,\n\t\tbadgeBorder: contrastBorder\n\t} as IBadgeStyleOverrides, widget);\n}\n\nexport interface IInputBoxStyleOverrides extends IStyleOverrides {\n\tinputBackground?: ColorIdentifier;\n\tinputForeground?: ColorIdentifier;\n\tinputBorder?: ColorIdentifier;\n\tinputValidationInfoBorder?: ColorIdentifier;\n\tinputValidationInfoBackground?: ColorIdentifier;\n\tinputValidationInfoForeground?: ColorIdentifier;\n\tinputValidationWarningBorder?: ColorIdentifier;\n\tinputValidationWarningBackground?: ColorIdentifier;\n\tinputValidationWarningForeground?: ColorIdentifier;\n\tinputValidationErrorBorder?: ColorIdentifier;\n\tinputValidationErrorBackground?: ColorIdentifier;\n\tinputValidationErrorForeground?: ColorIdentifier;\n}\n\nexport interface IQuickOpenStyleOverrides extends IListStyleOverrides, IInputBoxStyleOverrides, IProgressBarStyleOverrides {\n\tforeground?: ColorIdentifier;\n\tbackground?: ColorIdentifier;\n\tborderColor?: ColorIdentifier;\n\twidgetShadow?: ColorIdentifier;\n\tpickerGroupForeground?: ColorIdentifier;\n\tpickerGroupBorder?: ColorIdentifier;\n}\n\nexport function attachQuickOpenStyler(widget: IThemable, themeService: IThemeService, style?: IQuickOpenStyleOverrides): IDisposable {\n\treturn attachStyler(themeService, {\n\t\tforeground: (style && style.foreground) || foreground,\n\t\tbackground: (style && style.background) || editorBackground,\n\t\tborderColor: style && style.borderColor || contrastBorder,\n\t\twidgetShadow: style && style.widgetShadow || widgetShadow,\n\t\tprogressBarBackground: style && style.progressBarBackground || progressBarBackground,\n\t\tpickerGroupForeground: style && style.pickerGroupForeground || pickerGroupForeground,\n\t\tpickerGroupBorder: style && style.pickerGroupBorder || pickerGroupBorder,\n\t\tinputBackground: (style && style.inputBackground) || inputBackground,\n\t\tinputForeground: (style && style.inputForeground) || inputForeground,\n\t\tinputBorder: (style && style.inputBorder) || inputBorder,\n\t\tinputValidationInfoBorder: (style && style.inputValidationInfoBorder) || inputValidationInfoBorder,\n\t\tinputValidationInfoBackground: (style && style.inputValidationInfoBackground) || inputValidationInfoBackground,\n\t\tinputValidationInfoForeground: (style && style.inputValidationInfoForeground) || inputValidationInfoForeground,\n\t\tinputValidationWarningBorder: (style && style.inputValidationWarningBorder) || inputValidationWarningBorder,\n\t\tinputValidationWarningBackground: (style && style.inputValidationWarningBackground) || inputValidationWarningBackground,\n\t\tinputValidationWarningForeground: (style && style.inputValidationWarningForeground) || inputValidationWarningForeground,\n\t\tinputValidationErrorBorder: (style && style.inputValidationErrorBorder) || inputValidationErrorBorder,\n\t\tinputValidationErrorBackground: (style && style.inputValidationErrorBackground) || inputValidationErrorBackground,\n\t\tinputValidationErrorForeground: (style && style.inputValidationErrorForeground) || inputValidationErrorForeground,\n\t\tlistFocusBackground: (style && style.listFocusBackground) || listFocusBackground,\n\t\tlistFocusForeground: (style && style.listFocusForeground) || listFocusForeground,\n\t\tlistActiveSelectionBackground: (style && style.listActiveSelectionBackground) || darken(listActiveSelectionBackground, 0.1),\n\t\tlistActiveSelectionForeground: (style && style.listActiveSelectionForeground) || listActiveSelectionForeground,\n\t\tlistFocusAndSelectionBackground: style && style.listFocusAndSelectionBackground || listActiveSelectionBackground,\n\t\tlistFocusAndSelectionForeground: (style && style.listFocusAndSelectionForeground) || listActiveSelectionForeground,\n\t\tlistInactiveSelectionBackground: (style && style.listInactiveSelectionBackground) || listInactiveSelectionBackground,\n\t\tlistInactiveSelectionForeground: (style && style.listInactiveSelectionForeground) || listInactiveSelectionForeground,\n\t\tlistInactiveFocusBackground: (style && style.listInactiveFocusBackground) || listInactiveFocusBackground,\n\t\tlistHoverBackground: (style && style.listHoverBackground) || listHoverBackground,\n\t\tlistHoverForeground: (style && style.listHoverForeground) || listHoverForeground,\n\t\tlistDropBackground: (style && style.listDropBackground) || listDropBackground,\n\t\tlistFocusOutline: (style && style.listFocusOutline) || activeContrastBorder,\n\t\tlistSelectionOutline: (style && style.listSelectionOutline) || activeContrastBorder,\n\t\tlistHoverOutline: (style && style.listHoverOutline) || activeContrastBorder\n\t} as IQuickOpenStyleOverrides, widget);\n}\n\nexport interface IListStyleOverrides extends IStyleOverrides {\n\tlistFocusBackground?: ColorIdentifier;\n\tlistFocusForeground?: ColorIdentifier;\n\tlistActiveSelectionBackground?: ColorIdentifier;\n\tlistActiveSelectionForeground?: ColorIdentifier;\n\tlistFocusAndSelectionBackground?: ColorIdentifier;\n\tlistFocusAndSelectionForeground?: ColorIdentifier;\n\tlistInactiveSelectionBackground?: ColorIdentifier;\n\tlistInactiveSelectionForeground?: ColorIdentifier;\n\tlistInactiveFocusBackground?: ColorIdentifier;\n\tlistHoverBackground?: ColorIdentifier;\n\tlistHoverForeground?: ColorIdentifier;\n\tlistDropBackground?: ColorIdentifier;\n\tlistFocusOutline?: ColorIdentifier;\n\tlistInactiveFocusOutline?: ColorIdentifier;\n\tlistSelectionOutline?: ColorIdentifier;\n\tlistHoverOutline?: ColorIdentifier;\n}\n\nexport function attachListStyler(widget: IThemable, themeService: IThemeService, overrides?: IListStyleOverrides): IDisposable {\n\treturn attachStyler(themeService, mixin(overrides || Object.create(null), defaultListStyles, false) as IListStyleOverrides, widget);\n}\n\nexport const defaultListStyles: IColorMapping = {\n\tlistFocusBackground: listFocusBackground,\n\tlistFocusForeground: listFocusForeground,\n\tlistActiveSelectionBackground: darken(listActiveSelectionBackground, 0.1),\n\tlistActiveSelectionForeground: listActiveSelectionForeground,\n\tlistFocusAndSelectionBackground: listActiveSelectionBackground,\n\tlistFocusAndSelectionForeground: listActiveSelectionForeground,\n\tlistInactiveSelectionBackground: listInactiveSelectionBackground,\n\tlistInactiveSelectionForeground: listInactiveSelectionForeground,\n\tlistInactiveFocusBackground: listInactiveFocusBackground,\n\tlistHoverBackground: listHoverBackground,\n\tlistHoverForeground: listHoverForeground,\n\tlistDropBackground: listDropBackground,\n\tlistFocusOutline: activeContrastBorder,\n\tlistSelectionOutline: activeContrastBorder,\n\tlistHoverOutline: activeContrastBorder,\n\tlistFilterWidgetBackground: listFilterWidgetBackground,\n\tlistFilterWidgetOutline: listFilterWidgetOutline,\n\tlistFilterWidgetNoMatchesOutline: listFilterWidgetNoMatchesOutline,\n\tlistMatchesShadow: widgetShadow\n};\n\nexport interface IProgressBarStyleOverrides extends IStyleOverrides {\n\tprogressBarBackground?: ColorIdentifier;\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};\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 { Dimension } from 'vs/base/browser/dom';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';\nimport { QuickOpenWidget } from 'vs/base/parts/quickopen/browser/quickOpenWidget';\nimport { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { foreground } from 'vs/platform/theme/common/colorRegistry';\nimport { attachQuickOpenStyler } from 'vs/platform/theme/common/styler';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport interface IQuickOpenEditorWidgetOptions {\n\tinputAriaLabel: string;\n}\n\nexport class QuickOpenEditorWidget implements IOverlayWidget {\n\n\tprivate static readonly ID = 'editor.contrib.quickOpenEditorWidget';\n\n\tprivate readonly codeEditor: ICodeEditor;\n\tprivate readonly themeService: IThemeService;\n\tprivate visible: boolean;\n\tprivate quickOpenWidget: QuickOpenWidget;\n\tprivate domNode: HTMLElement;\n\tprivate styler: IDisposable;\n\n\tconstructor(codeEditor: ICodeEditor, onOk: () => void, onCancel: () => void, onType: (value: string) => void, configuration: IQuickOpenEditorWidgetOptions, themeService: IThemeService) {\n\t\tthis.codeEditor = codeEditor;\n\t\tthis.themeService = themeService;\n\n\t\tthis.create(onOk, onCancel, onType, configuration);\n\t}\n\n\tprivate create(onOk: () => void, onCancel: () => void, onType: (value: string) => void, configuration: IQuickOpenEditorWidgetOptions): void {\n\t\tthis.domNode = document.createElement('div');\n\n\t\tthis.quickOpenWidget = new QuickOpenWidget(\n\t\t\tthis.domNode,\n\t\t\t{\n\t\t\t\tonOk: onOk,\n\t\t\t\tonCancel: onCancel,\n\t\t\t\tonType: onType\n\t\t\t}, {\n\t\t\t\tinputPlaceHolder: undefined,\n\t\t\t\tinputAriaLabel: configuration.inputAriaLabel,\n\t\t\t\tkeyboardSupport: true\n\t\t\t}\n\t\t);\n\t\tthis.styler = attachQuickOpenStyler(this.quickOpenWidget, this.themeService, {\n\t\t\tpickerGroupForeground: foreground\n\t\t});\n\n\t\tthis.quickOpenWidget.create();\n\t\tthis.codeEditor.addOverlayWidget(this);\n\t}\n\n\tpublic setInput(model: QuickOpenModel, focus: IAutoFocus): void {\n\t\tthis.quickOpenWidget.setInput(model, focus);\n\t}\n\n\tpublic getId(): string {\n\t\treturn QuickOpenEditorWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tpublic destroy(): void {\n\t\tthis.codeEditor.removeOverlayWidget(this);\n\t\tthis.quickOpenWidget.dispose();\n\t\tthis.styler.dispose();\n\t}\n\n\tpublic show(value: string): void {\n\t\tthis.visible = true;\n\n\t\tconst editorLayout = this.codeEditor.getLayoutInfo();\n\t\tif (editorLayout) {\n\t\t\tthis.quickOpenWidget.layout(new Dimension(editorLayout.width, editorLayout.height));\n\t\t}\n\n\t\tthis.quickOpenWidget.show(value);\n\t\tthis.codeEditor.layoutOverlayWidget(this);\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\tif (this.visible) {\n\t\t\treturn {\n\t\t\t\tpreference: OverlayWidgetPositionPreference.TOP_CENTER\n\t\t\t};\n\t\t}\n\n\t\treturn null;\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 'vs/css!./contextMenuHandler';\n\nimport { combinedDisposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { ActionRunner, IRunEvent } from 'vs/base/common/actions';\nimport { Menu } from 'vs/base/browser/ui/menu/menu';\nimport { IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IContextMenuDelegate } from 'vs/base/browser/contextmenu';\nimport { EventType, $, removeNode } from 'vs/base/browser/dom';\nimport { attachMenuStyler } from 'vs/platform/theme/common/styler';\nimport { domEvent } from 'vs/base/browser/event';\nimport { StandardMouseEvent } from 'vs/base/browser/mouseEvent';\n\nexport interface IContextMenuHandlerOptions {\n\tblockMouse: boolean;\n}\n\nexport class ContextMenuHandler {\n\tprivate focusToReturn: HTMLElement;\n\tprivate block: HTMLElement | 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\tthis.contextViewService.showContextView({\n\t\t\tgetAnchor: () => delegate.getAnchor(),\n\t\t\tcanRelayout: false,\n\t\t\tanchorAlignment: delegate.anchorAlignment,\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}\n\n\t\t\t\tconst menuDisposables: IDisposable[] = [];\n\n\t\t\t\tconst actionRunner = delegate.actionRunner || new ActionRunner();\n\t\t\t\tactionRunner.onDidBeforeRun(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\tactionItemProvider: delegate.getActionItem,\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.push(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\tdomEvent(window, EventType.BLUR)(() => { this.contextViewService.hideContextView(true); }, null, menuDisposables);\n\t\t\t\tdomEvent(window, EventType.MOUSE_DOWN)((e: MouseEvent) => {\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}, null, menuDisposables);\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\tremoveNode(this.block);\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});\n\t}\n\n\tprivate onActionRun(e: IRunEvent): void {\n\t\tif (this.telemetryService) {\n\t\t\t/* __GDPR__\n\t\t\t\t\"workbenchActionExecuted\" : {\n\t\t\t\t\t\"id\" : { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" },\n\t\t\t\t\t\"from\": { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" }\n\t\t\t\t}\n\t\t\t*/\n\t\t\tthis.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'contextMenu' });\n\t\t}\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 && this.notificationService) {\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\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { Color } from 'vs/base/common/color';\nimport { IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/platform/registry/common/platform';\nimport { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { IEnvironmentService } from 'vs/platform/environment/common/environment';\n\nexport const IThemeService = createDecorator<IThemeService>('themeService');\n\nexport interface ThemeColor {\n\tid: string;\n}\n\nexport function themeColorFromId(id: ColorIdentifier) {\n\treturn { id };\n}\n\n// base themes\nexport const DARK: ThemeType = 'dark';\nexport const HIGH_CONTRAST: ThemeType = 'hc';\nexport type ThemeType = 'light' | 'dark' | 'hc';\n\nexport function getThemeTypeSelector(type: ThemeType): string {\n\tswitch (type) {\n\t\tcase DARK: return 'vs-dark';\n\t\tcase HIGH_CONTRAST: return 'hc-black';\n\t\tdefault: return 'vs';\n\t}\n}\n\nexport interface ITheme {\n\treadonly type: ThemeType;\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\nexport interface IIconTheme {\n\treadonly hasFileIcons: boolean;\n\treadonly hasFolderIcons: boolean;\n\treadonly hidesExplorerArrows: boolean;\n}\n\nexport interface ICssStyleCollector {\n\taddRule(rule: string): void;\n}\n\nexport interface IThemingParticipant {\n\t(theme: ITheme, collector: ICssStyleCollector, environment: IEnvironmentService): void;\n}\n\nexport interface IThemeService {\n\t_serviceBrand: any;\n\n\tgetTheme(): ITheme;\n\n\treadonly onThemeChange: Event<ITheme>;\n\n\tgetIconTheme(): IIconTheme;\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 onThemeChange(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.onThemeChange(participant);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IDisposable, dispose as disposeAll } 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 { AbstractCodeEditorService } from 'vs/editor/browser/services/abstractCodeEditorService';\nimport { IContentDecorationRenderOptions, IDecorationRenderOptions, IThemeDecorationRenderOptions, isThemeColor } from 'vs/editor/common/editorCommon';\nimport { IModelDecorationOptions, IModelDecorationOverviewRulerOptions, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { IResourceInput } from 'vs/platform/editor/common/editor';\nimport { ITheme, IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';\n\nexport abstract class CodeEditorServiceImpl extends AbstractCodeEditorService {\n\n\tprivate readonly _styleSheet: HTMLStyleElement;\n\tprivate readonly _decorationOptionProviders: { [key: string]: IModelDecorationOptionsProvider };\n\tprivate readonly _themeService: IThemeService;\n\n\tconstructor(@IThemeService themeService: IThemeService, styleSheet = dom.createStyleSheet()) {\n\t\tsuper();\n\t\tthis._styleSheet = styleSheet;\n\t\tthis._decorationOptionProviders = Object.create(null);\n\t\tthis._themeService = themeService;\n\t}\n\n\tpublic registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void {\n\t\tlet provider = this._decorationOptionProviders[key];\n\t\tif (!provider) {\n\t\t\tconst providerArgs: ProviderArguments = {\n\t\t\t\tstyleSheet: this._styleSheet,\n\t\t\t\tkey: key,\n\t\t\t\tparentTypeKey: parentTypeKey,\n\t\t\t\toptions: options || Object.create(null)\n\t\t\t};\n\t\t\tif (!parentTypeKey) {\n\t\t\t\tprovider = new DecorationTypeOptionsProvider(this._themeService, providerArgs);\n\t\t\t} else {\n\t\t\t\tprovider = new DecorationSubTypeOptionsProvider(this._themeService, providerArgs);\n\t\t\t}\n\t\t\tthis._decorationOptionProviders[key] = provider;\n\t\t}\n\t\tprovider.refCount++;\n\t}\n\n\tpublic removeDecorationType(key: string): void {\n\t\tconst provider = this._decorationOptionProviders[key];\n\t\tif (provider) {\n\t\t\tprovider.refCount--;\n\t\t\tif (provider.refCount <= 0) {\n\t\t\t\tdelete this._decorationOptionProviders[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\n\tpublic resolveDecorationOptions(decorationTypeKey: string, writable: boolean): IModelDecorationOptions {\n\t\tconst provider = this._decorationOptionProviders[decorationTypeKey];\n\t\tif (!provider) {\n\t\t\tthrow new Error('Unknown decoration type key: ' + decorationTypeKey);\n\t\t}\n\t\treturn provider.getOptions(this, writable);\n\t}\n\n\tabstract getActiveCodeEditor(): ICodeEditor | null;\n\tabstract openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;\n}\n\ninterface IModelDecorationOptionsProvider extends IDisposable {\n\trefCount: number;\n\tgetOptions(codeEditorService: AbstractCodeEditorService, writable: boolean): IModelDecorationOptions;\n}\n\nclass DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvider {\n\n\tpublic refCount: number;\n\n\tprivate readonly _parentTypeKey: string | undefined;\n\tprivate _beforeContentRules: DecorationCSSRules | null;\n\tprivate _afterContentRules: DecorationCSSRules | null;\n\n\tconstructor(themeService: IThemeService, providerArgs: ProviderArguments) {\n\t\tthis._parentTypeKey = providerArgs.parentTypeKey;\n\t\tthis.refCount = 0;\n\n\t\tthis._beforeContentRules = new DecorationCSSRules(ModelDecorationCSSRuleType.BeforeContentClassName, providerArgs, themeService);\n\t\tthis._afterContentRules = new DecorationCSSRules(ModelDecorationCSSRuleType.AfterContentClassName, providerArgs, themeService);\n\t}\n\n\tpublic getOptions(codeEditorService: AbstractCodeEditorService, writable: boolean): IModelDecorationOptions {\n\t\tconst options = codeEditorService.resolveDecorationOptions(this._parentTypeKey, true);\n\t\tif (this._beforeContentRules) {\n\t\t\toptions.beforeContentClassName = this._beforeContentRules.className;\n\t\t}\n\t\tif (this._afterContentRules) {\n\t\t\toptions.afterContentClassName = this._afterContentRules.className;\n\t\t}\n\t\treturn options;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._beforeContentRules) {\n\t\t\tthis._beforeContentRules.dispose();\n\t\t\tthis._beforeContentRules = null;\n\t\t}\n\t\tif (this._afterContentRules) {\n\t\t\tthis._afterContentRules.dispose();\n\t\t\tthis._afterContentRules = null;\n\t\t}\n\t}\n}\n\ninterface ProviderArguments {\n\tstyleSheet: HTMLStyleElement;\n\tkey: string;\n\tparentTypeKey?: string;\n\toptions: IDecorationRenderOptions;\n}\n\n\nclass DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider {\n\n\tprivate _disposables: IDisposable[];\n\tpublic refCount: number;\n\n\tpublic className: string | undefined;\n\tpublic inlineClassName: string;\n\tpublic inlineClassNameAffectsLetterSpacing: boolean;\n\tpublic beforeContentClassName: string | undefined;\n\tpublic afterContentClassName: string | undefined;\n\tpublic glyphMarginClassName: string | undefined;\n\tpublic isWholeLine: boolean;\n\tpublic overviewRuler: IModelDecorationOverviewRulerOptions;\n\tpublic stickiness: TrackedRangeStickiness | undefined;\n\n\tconstructor(themeService: IThemeService, providerArgs: ProviderArguments) {\n\t\tthis.refCount = 0;\n\t\tthis._disposables = [];\n\n\t\tconst createCSSRules = (type: ModelDecorationCSSRuleType) => {\n\t\t\tconst rules = new DecorationCSSRules(type, providerArgs, themeService);\n\t\t\tthis._disposables.push(rules);\n\t\t\tif (rules.hasContent) {\n\t\t\t\treturn rules.className;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t};\n\t\tconst createInlineCSSRules = (type: ModelDecorationCSSRuleType) => {\n\t\t\tconst rules = new DecorationCSSRules(type, providerArgs, themeService);\n\t\t\tthis._disposables.push(rules);\n\t\t\tif (rules.hasContent) {\n\t\t\t\treturn { className: rules.className, hasLetterSpacing: rules.hasLetterSpacing };\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\n\t\tthis.className = createCSSRules(ModelDecorationCSSRuleType.ClassName);\n\t\tconst inlineData = createInlineCSSRules(ModelDecorationCSSRuleType.InlineClassName);\n\t\tif (inlineData) {\n\t\t\tthis.inlineClassName = inlineData.className;\n\t\t\tthis.inlineClassNameAffectsLetterSpacing = inlineData.hasLetterSpacing;\n\t\t}\n\t\tthis.beforeContentClassName = createCSSRules(ModelDecorationCSSRuleType.BeforeContentClassName);\n\t\tthis.afterContentClassName = createCSSRules(ModelDecorationCSSRuleType.AfterContentClassName);\n\t\tthis.glyphMarginClassName = createCSSRules(ModelDecorationCSSRuleType.GlyphMarginClassName);\n\n\t\tconst options = providerArgs.options;\n\t\tthis.isWholeLine = Boolean(options.isWholeLine);\n\t\tthis.stickiness = options.rangeBehavior;\n\n\t\tconst lightOverviewRulerColor = options.light && options.light.overviewRulerColor || options.overviewRulerColor;\n\t\tconst darkOverviewRulerColor = options.dark && options.dark.overviewRulerColor || options.overviewRulerColor;\n\t\tif (\n\t\t\ttypeof lightOverviewRulerColor !== 'undefined'\n\t\t\t|| typeof darkOverviewRulerColor !== 'undefined'\n\t\t) {\n\t\t\tthis.overviewRuler = {\n\t\t\t\tcolor: lightOverviewRulerColor || darkOverviewRulerColor,\n\t\t\t\tdarkColor: darkOverviewRulerColor || lightOverviewRulerColor,\n\t\t\t\tposition: options.overviewRulerLane || OverviewRulerLane.Center\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic getOptions(codeEditorService: AbstractCodeEditorService, writable: boolean): IModelDecorationOptions {\n\t\tif (!writable) {\n\t\t\treturn this;\n\t\t}\n\t\treturn {\n\t\t\tinlineClassName: this.inlineClassName,\n\t\t\tbeforeContentClassName: this.beforeContentClassName,\n\t\t\tafterContentClassName: this.afterContentClassName,\n\t\t\tclassName: this.className,\n\t\t\tglyphMarginClassName: this.glyphMarginClassName,\n\t\t\tisWholeLine: this.isWholeLine,\n\t\t\toverviewRuler: this.overviewRuler,\n\t\t\tstickiness: this.stickiness\n\t\t};\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._disposables = disposeAll(this._disposables);\n\t}\n}\n\n\nconst _CSS_MAP: { [prop: string]: string; } = {\n\tcolor: 'color:{0} !important;',\n\topacity: 'opacity:{0};',\n\tbackgroundColor: 'background-color:{0};',\n\n\toutline: 'outline:{0};',\n\toutlineColor: 'outline-color:{0};',\n\toutlineStyle: 'outline-style:{0};',\n\toutlineWidth: 'outline-width:{0};',\n\n\tborder: 'border:{0};',\n\tborderColor: 'border-color:{0};',\n\tborderRadius: 'border-radius:{0};',\n\tborderSpacing: 'border-spacing:{0};',\n\tborderStyle: 'border-style:{0};',\n\tborderWidth: 'border-width:{0};',\n\n\tfontStyle: 'font-style:{0};',\n\tfontWeight: 'font-weight:{0};',\n\ttextDecoration: 'text-decoration:{0};',\n\tcursor: 'cursor:{0};',\n\tletterSpacing: 'letter-spacing:{0};',\n\n\tgutterIconPath: 'background:url(\\'{0}\\') center center no-repeat;',\n\tgutterIconSize: 'background-size:{0};',\n\n\tcontentText: 'content:\\'{0}\\';',\n\tcontentIconPath: 'content:url(\\'{0}\\');',\n\tmargin: 'margin:{0};',\n\twidth: 'width:{0};',\n\theight: 'height:{0};'\n};\n\n\nclass DecorationCSSRules {\n\n\tprivate _theme: ITheme;\n\tprivate readonly _className: string;\n\tprivate readonly _unThemedSelector: string;\n\tprivate _hasContent: boolean;\n\tprivate _hasLetterSpacing: boolean;\n\tprivate readonly _ruleType: ModelDecorationCSSRuleType;\n\tprivate _themeListener: IDisposable | null;\n\tprivate readonly _providerArgs: ProviderArguments;\n\tprivate _usesThemeColors: boolean;\n\n\tpublic constructor(ruleType: ModelDecorationCSSRuleType, providerArgs: ProviderArguments, themeService: IThemeService) {\n\t\tthis._theme = themeService.getTheme();\n\t\tthis._ruleType = ruleType;\n\t\tthis._providerArgs = providerArgs;\n\t\tthis._usesThemeColors = false;\n\t\tthis._hasContent = false;\n\t\tthis._hasLetterSpacing = false;\n\n\t\tlet className = CSSNameHelper.getClassName(this._providerArgs.key, ruleType);\n\t\tif (this._providerArgs.parentTypeKey) {\n\t\t\tclassName = className + ' ' + CSSNameHelper.getClassName(this._providerArgs.parentTypeKey, ruleType);\n\t\t}\n\t\tthis._className = className;\n\n\t\tthis._unThemedSelector = CSSNameHelper.getSelector(this._providerArgs.key, this._providerArgs.parentTypeKey, ruleType);\n\n\t\tthis._buildCSS();\n\n\t\tif (this._usesThemeColors) {\n\t\t\tthis._themeListener = themeService.onThemeChange(theme => {\n\t\t\t\tthis._theme = themeService.getTheme();\n\t\t\t\tthis._removeCSS();\n\t\t\t\tthis._buildCSS();\n\t\t\t});\n\t\t} else {\n\t\t\tthis._themeListener = null;\n\t\t}\n\t}\n\n\tpublic dispose() {\n\t\tif (this._hasContent) {\n\t\t\tthis._removeCSS();\n\t\t\tthis._hasContent = false;\n\t\t}\n\t\tif (this._themeListener) {\n\t\t\tthis._themeListener.dispose();\n\t\t\tthis._themeListener = null;\n\t\t}\n\t}\n\n\tpublic get hasContent(): boolean {\n\t\treturn this._hasContent;\n\t}\n\n\tpublic get hasLetterSpacing(): boolean {\n\t\treturn this._hasLetterSpacing;\n\t}\n\n\tpublic get className(): string {\n\t\treturn this._className;\n\t}\n\n\tprivate _buildCSS(): void {\n\t\tconst options = this._providerArgs.options;\n\t\tlet unthemedCSS: string, lightCSS: string, darkCSS: string;\n\t\tswitch (this._ruleType) {\n\t\t\tcase ModelDecorationCSSRuleType.ClassName:\n\t\t\t\tunthemedCSS = this.getCSSTextForModelDecorationClassName(options);\n\t\t\t\tlightCSS = this.getCSSTextForModelDecorationClassName(options.light);\n\t\t\t\tdarkCSS = this.getCSSTextForModelDecorationClassName(options.dark);\n\t\t\t\tbreak;\n\t\t\tcase ModelDecorationCSSRuleType.InlineClassName:\n\t\t\t\tunthemedCSS = this.getCSSTextForModelDecorationInlineClassName(options);\n\t\t\t\tlightCSS = this.getCSSTextForModelDecorationInlineClassName(options.light);\n\t\t\t\tdarkCSS = this.getCSSTextForModelDecorationInlineClassName(options.dark);\n\t\t\t\tbreak;\n\t\t\tcase ModelDecorationCSSRuleType.GlyphMarginClassName:\n\t\t\t\tunthemedCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options);\n\t\t\t\tlightCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options.light);\n\t\t\t\tdarkCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options.dark);\n\t\t\t\tbreak;\n\t\t\tcase ModelDecorationCSSRuleType.BeforeContentClassName:\n\t\t\t\tunthemedCSS = this.getCSSTextForModelDecorationContentClassName(options.before);\n\t\t\t\tlightCSS = this.getCSSTextForModelDecorationContentClassName(options.light && options.light.before);\n\t\t\t\tdarkCSS = this.getCSSTextForModelDecorationContentClassName(options.dark && options.dark.before);\n\t\t\t\tbreak;\n\t\t\tcase ModelDecorationCSSRuleType.AfterContentClassName:\n\t\t\t\tunthemedCSS = this.getCSSTextForModelDecorationContentClassName(options.after);\n\t\t\t\tlightCSS = this.getCSSTextForModelDecorationContentClassName(options.light && options.light.after);\n\t\t\t\tdarkCSS = this.getCSSTextForModelDecorationContentClassName(options.dark && options.dark.after);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Unknown rule type: ' + this._ruleType);\n\t\t}\n\t\tconst sheet = <CSSStyleSheet>this._providerArgs.styleSheet.sheet;\n\n\t\tlet hasContent = false;\n\t\tif (unthemedCSS.length > 0) {\n\t\t\tsheet.insertRule(`${this._unThemedSelector} {${unthemedCSS}}`, 0);\n\t\t\thasContent = true;\n\t\t}\n\t\tif (lightCSS.length > 0) {\n\t\t\tsheet.insertRule(`.vs${this._unThemedSelector} {${lightCSS}}`, 0);\n\t\t\thasContent = true;\n\t\t}\n\t\tif (darkCSS.length > 0) {\n\t\t\tsheet.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${darkCSS}}`, 0);\n\t\t\thasContent = true;\n\t\t}\n\t\tthis._hasContent = hasContent;\n\t}\n\n\tprivate _removeCSS(): void {\n\t\tdom.removeCSSRulesContainingSelector(this._unThemedSelector, this._providerArgs.styleSheet);\n\t}\n\n\t/**\n\t * Build the CSS for decorations styled via `className`.\n\t */\n\tprivate getCSSTextForModelDecorationClassName(opts: IThemeDecorationRenderOptions | undefined): string {\n\t\tif (!opts) {\n\t\t\treturn '';\n\t\t}\n\t\tconst cssTextArr: string[] = [];\n\t\tthis.collectCSSText(opts, ['backgroundColor'], cssTextArr);\n\t\tthis.collectCSSText(opts, ['outline', 'outlineColor', 'outlineStyle', 'outlineWidth'], cssTextArr);\n\t\tthis.collectBorderSettingsCSSText(opts, cssTextArr);\n\t\treturn cssTextArr.join('');\n\t}\n\n\t/**\n\t * Build the CSS for decorations styled via `inlineClassName`.\n\t */\n\tprivate getCSSTextForModelDecorationInlineClassName(opts: IThemeDecorationRenderOptions | undefined): string {\n\t\tif (!opts) {\n\t\t\treturn '';\n\t\t}\n\t\tconst cssTextArr: string[] = [];\n\t\tthis.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'cursor', 'color', 'opacity', 'letterSpacing'], cssTextArr);\n\t\tif (opts.letterSpacing) {\n\t\t\tthis._hasLetterSpacing = true;\n\t\t}\n\t\treturn cssTextArr.join('');\n\t}\n\n\t/**\n\t * Build the CSS for decorations styled before or after content.\n\t */\n\tprivate getCSSTextForModelDecorationContentClassName(opts: IContentDecorationRenderOptions | undefined): string {\n\t\tif (!opts) {\n\t\t\treturn '';\n\t\t}\n\t\tconst cssTextArr: string[] = [];\n\n\t\tif (typeof opts !== 'undefined') {\n\t\t\tthis.collectBorderSettingsCSSText(opts, cssTextArr);\n\t\t\tif (typeof opts.contentIconPath !== 'undefined') {\n\t\t\t\tcssTextArr.push(strings.format(_CSS_MAP.contentIconPath, URI.revive(opts.contentIconPath).toString(true).replace(/'/g, '%27')));\n\t\t\t}\n\t\t\tif (typeof opts.contentText === 'string') {\n\t\t\t\tconst truncated = opts.contentText.match(/^.*$/m)![0]; // only take first line\n\t\t\t\tconst escaped = truncated.replace(/['\\\\]/g, '\\\\$&');\n\n\t\t\t\tcssTextArr.push(strings.format(_CSS_MAP.contentText, escaped));\n\t\t\t}\n\t\t\tthis.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'color', 'opacity', 'backgroundColor', 'margin'], cssTextArr);\n\t\t\tif (this.collectCSSText(opts, ['width', 'height'], cssTextArr)) {\n\t\t\t\tcssTextArr.push('display:inline-block;');\n\t\t\t}\n\t\t}\n\n\t\treturn cssTextArr.join('');\n\t}\n\n\t/**\n\t * Build the CSS for decorations styled via `glpyhMarginClassName`.\n\t */\n\tprivate getCSSTextForModelDecorationGlyphMarginClassName(opts: IThemeDecorationRenderOptions | undefined): string {\n\t\tif (!opts) {\n\t\t\treturn '';\n\t\t}\n\t\tconst cssTextArr: string[] = [];\n\n\t\tif (typeof opts.gutterIconPath !== 'undefined') {\n\t\t\tcssTextArr.push(strings.format(_CSS_MAP.gutterIconPath, URI.revive(opts.gutterIconPath).toString(true).replace(/'/g, '%27')));\n\t\t\tif (typeof opts.gutterIconSize !== 'undefined') {\n\t\t\t\tcssTextArr.push(strings.format(_CSS_MAP.gutterIconSize, opts.gutterIconSize));\n\t\t\t}\n\t\t}\n\n\t\treturn cssTextArr.join('');\n\t}\n\n\tprivate collectBorderSettingsCSSText(opts: any, cssTextArr: string[]): boolean {\n\t\tif (this.collectCSSText(opts, ['border', 'borderColor', 'borderRadius', 'borderSpacing', 'borderStyle', 'borderWidth'], cssTextArr)) {\n\t\t\tcssTextArr.push(strings.format('box-sizing: border-box;'));\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate collectCSSText(opts: any, properties: string[], cssTextArr: string[]): boolean {\n\t\tconst lenBefore = cssTextArr.length;\n\t\tfor (let property of properties) {\n\t\t\tconst value = this.resolveValue(opts[property]);\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tcssTextArr.push(strings.format(_CSS_MAP[property], value));\n\t\t\t}\n\t\t}\n\t\treturn cssTextArr.length !== lenBefore;\n\t}\n\n\tprivate resolveValue(value: string | ThemeColor): string {\n\t\tif (isThemeColor(value)) {\n\t\t\tthis._usesThemeColors = true;\n\t\t\tconst color = this._theme.getColor(value.id);\n\t\t\tif (color) {\n\t\t\t\treturn color.toString();\n\t\t\t}\n\t\t\treturn 'transparent';\n\t\t}\n\t\treturn value;\n\t}\n}\n\nconst enum ModelDecorationCSSRuleType {\n\tClassName = 0,\n\tInlineClassName = 1,\n\tGlyphMarginClassName = 2,\n\tBeforeContentClassName = 3,\n\tAfterContentClassName = 4\n}\n\nclass CSSNameHelper {\n\n\tpublic static getClassName(key: string, type: ModelDecorationCSSRuleType): string {\n\t\treturn 'ced-' + key + '-' + type;\n\t}\n\n\tpublic static getSelector(key: string, parentKey: string | undefined, ruleType: ModelDecorationCSSRuleType): string {\n\t\tlet selector = '.monaco-editor .' + this.getClassName(key, ruleType);\n\t\tif (parentKey) {\n\t\t\tselector = selector + '.' + this.getClassName(parentKey, ruleType);\n\t\t}\n\t\tif (ruleType === ModelDecorationCSSRuleType.BeforeContentClassName) {\n\t\t\tselector += '::before';\n\t\t} else if (ruleType === ModelDecorationCSSRuleType.AfterContentClassName) {\n\t\t\tselector += '::after';\n\t\t}\n\t\treturn selector;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 } from 'vs/editor/common/editorCommon';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { getThemeTypeSelector } from 'vs/platform/theme/common/themeService';\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\t\tconst editor = this._context.configuration.editor;\n\t\tconst configScrollbarOpts = editor.viewInfo.scrollbar;\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: configScrollbarOpts.vertical,\n\t\t\thorizontal: configScrollbarOpts.horizontal,\n\t\t\tverticalHasArrows: configScrollbarOpts.verticalHasArrows,\n\t\t\thorizontalHasArrows: configScrollbarOpts.horizontalHasArrows,\n\t\t\tverticalScrollbarSize: configScrollbarOpts.verticalScrollbarSize,\n\t\t\tverticalSliderSize: configScrollbarOpts.verticalSliderSize,\n\t\t\thorizontalScrollbarSize: configScrollbarOpts.horizontalScrollbarSize,\n\t\t\thorizontalSliderSize: configScrollbarOpts.horizontalSliderSize,\n\t\t\thandleMouseWheel: configScrollbarOpts.handleMouseWheel,\n\t\t\tarrowSize: configScrollbarOpts.arrowSize,\n\t\t\tmouseWheelScrollSensitivity: configScrollbarOpts.mouseWheelScrollSensitivity,\n\t\t\tfastScrollSensitivity: configScrollbarOpts.fastScrollSensitivity,\n\t\t};\n\n\t\tthis.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.scrollable));\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.viewLayout.setScrollPositionNow(newScrollPosition);\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 dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate _setLayout(): void {\n\t\tconst layoutInfo = this._context.configuration.editor.layoutInfo;\n\n\t\tthis.scrollbarDomNode.setLeft(layoutInfo.contentLeft);\n\n\t\tconst side = this._context.configuration.editor.viewInfo.minimap.side;\n\t\tif (side === 'right') {\n\t\t\tthis.scrollbarDomNode.setWidth(layoutInfo.contentWidth + layoutInfo.minimapWidth);\n\t\t} else {\n\t\t\tthis.scrollbarDomNode.setWidth(layoutInfo.contentWidth);\n\t\t}\n\t\tthis.scrollbarDomNode.setHeight(layoutInfo.contentHeight);\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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.viewInfo) {\n\t\t\tconst editor = this._context.configuration.editor;\n\t\t\tconst newOpts: ScrollableElementChangeOptions = {\n\t\t\t\thandleMouseWheel: editor.viewInfo.scrollbar.handleMouseWheel,\n\t\t\t\tmouseWheelScrollSensitivity: editor.viewInfo.scrollbar.mouseWheelScrollSensitivity,\n\t\t\t\tfastScrollSensitivity: editor.viewInfo.scrollbar.fastScrollSensitivity\n\t\t\t};\n\t\t\tthis.scrollbar.updateOptions(newOpts);\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._setLayout();\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IConfiguration } from 'vs/editor/common/editorCommon';\nimport { HorizontalRange } from 'vs/editor/common/view/renderingContext';\nimport { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';\nimport { CharacterMapping, ForeignElementType, RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { InlineDecorationType } from 'vs/editor/common/viewModel/viewModel';\nimport { HIGH_CONTRAST, ThemeType } from 'vs/platform/theme/common/themeService';\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\nconst alwaysRenderInlineSelection = (browser.isEdgeOrIE);\n\nexport class DomReadingContext {\n\n\tprivate readonly _domNode: HTMLElement;\n\tprivate _clientRectDeltaLeft: number;\n\tprivate _clientRectDeltaLeftRead: boolean;\n\tpublic get clientRectDeltaLeft(): number {\n\t\tif (!this._clientRectDeltaLeftRead) {\n\t\t\tthis._clientRectDeltaLeftRead = true;\n\t\t\tthis._clientRectDeltaLeft = this._domNode.getBoundingClientRect().left;\n\t\t}\n\t\treturn this._clientRectDeltaLeft;\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._clientRectDeltaLeftRead = false;\n\t\tthis.endNode = endNode;\n\t}\n\n}\n\nexport class ViewLineOptions {\n\tpublic readonly themeType: ThemeType;\n\tpublic readonly renderWhitespace: 'none' | 'boundary' | 'all';\n\tpublic readonly renderControlCharacters: boolean;\n\tpublic readonly spaceWidth: 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: boolean;\n\n\tconstructor(config: IConfiguration, themeType: ThemeType) {\n\t\tthis.themeType = themeType;\n\t\tthis.renderWhitespace = config.editor.viewInfo.renderWhitespace;\n\t\tthis.renderControlCharacters = config.editor.viewInfo.renderControlCharacters;\n\t\tthis.spaceWidth = config.editor.fontInfo.spaceWidth;\n\t\tthis.useMonospaceOptimizations = (\n\t\t\tconfig.editor.fontInfo.isMonospace\n\t\t\t&& !config.editor.viewInfo.disableMonospaceOptimizations\n\t\t);\n\t\tthis.canUseHalfwidthRightwardsArrow = config.editor.fontInfo.canUseHalfwidthRightwardsArrow;\n\t\tthis.lineHeight = config.editor.lineHeight;\n\t\tthis.stopRenderingLineAfter = config.editor.viewInfo.stopRenderingLineAfter;\n\t\tthis.fontLigatures = config.editor.viewInfo.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.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 (alwaysRenderInlineSelection || this._options.themeType === HIGH_CONTRAST) {\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\tif (alwaysRenderInlineSelection || options.themeType === HIGH_CONTRAST) {\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\tactualInlineDecorations.push(new LineDecoration(startColumn, endColumn, 'inline-selected-text', InlineDecorationType.Regular));\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\toptions.spaceWidth,\n\t\t\toptions.stopRenderingLineAfter,\n\t\t\toptions.renderWhitespace,\n\t\t\toptions.renderControlCharacters,\n\t\t\toptions.fontLigatures\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 (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 getVisibleRangesForRange(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | null {\n\t\tif (!this._renderedViewLine) {\n\t\t\treturn null;\n\t\t}\n\t\tstartColumn = startColumn | 0; // @perf\n\t\tendColumn = endColumn | 0; // @perf\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 | 0; // @perf\n\n\t\tif (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter && endColumn > stopRenderingLineAfter) {\n\t\t\t// This range is obviously not visible\n\t\t\treturn null;\n\t\t}\n\n\t\tif (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter) {\n\t\t\tstartColumn = stopRenderingLineAfter;\n\t\t}\n\n\t\tif (stopRenderingLineAfter !== -1 && endColumn > stopRenderingLineAfter) {\n\t\t\tendColumn = stopRenderingLineAfter;\n\t\t}\n\n\t\treturn this._renderedViewLine.getVisibleRangesForRange(startColumn, endColumn, context);\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(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | 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 this._getCharPosition(this._characterMapping.length);\n\t}\n\n\tpublic getWidthIsFast(): boolean {\n\t\treturn true;\n\t}\n\n\tpublic getVisibleRangesForRange(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | null {\n\t\tconst startPosition = this._getCharPosition(startColumn);\n\t\tconst endPosition = this._getCharPosition(endColumn);\n\t\treturn [new HorizontalRange(startPosition, endPosition - startPosition)];\n\t}\n\n\tprivate _getCharPosition(column: number): number {\n\t\tconst charOffset = this._characterMapping.getAbsoluteOffsets();\n\t\tif (charOffset.length === 0) {\n\t\t\t// No characters on this line\n\t\t\treturn 0;\n\t\t}\n\t\treturn Math.round(this._charWidth * charOffset[column - 1]);\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\tconst charOffset = this._characterMapping.partDataToCharOffset(spanIndex, spanNodeTextContentLength, offset);\n\t\treturn charOffset + 1;\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>;\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: Int32Array | null;\n\n\tconstructor(domNode: FastDomNode<HTMLElement>, 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 Int32Array(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(): HTMLElement {\n\t\treturn <HTMLSpanElement>this.domNode.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._cachedWidth === -1) {\n\t\t\tthis._cachedWidth = this._getReadingTarget().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(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | null {\n\t\tif (this._pixelOffsetCache !== null) {\n\t\t\t// the text is LTR\n\t\t\tconst startOffset = this._readPixelOffset(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(endColumn, context);\n\t\t\tif (endOffset === -1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn [new HorizontalRange(startOffset, endOffset - startOffset)];\n\t\t}\n\n\t\treturn this._readVisibleRangesForRange(startColumn, endColumn, context);\n\t}\n\n\tprotected _readVisibleRangesForRange(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | null {\n\t\tif (startColumn === endColumn) {\n\t\t\tconst pixelOffset = this._readPixelOffset(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 HorizontalRange(pixelOffset, 0)];\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._readRawVisibleRangesForRange(startColumn, endColumn, context);\n\t\t}\n\t}\n\n\tprotected _readPixelOffset(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 element before the (empty) line\n\t\t\t\treturn this.getWidth();\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(column, context);\n\t\t\tthis._pixelOffsetCache[column] = result;\n\t\t\treturn result;\n\t\t}\n\n\t\treturn this._actualReadPixelOffset(column, context);\n\t}\n\n\tprivate _actualReadPixelOffset(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(), 0, 0, 0, 0, context.clientRectDeltaLeft, 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 partData = this._characterMapping.charOffsetToPartData(column - 1);\n\t\tconst partIndex = CharacterMapping.getPartIndex(partData);\n\t\tconst charOffsetInPart = CharacterMapping.getCharIndex(partData);\n\n\t\tconst r = RangeUtil.readHorizontalRanges(this._getReadingTarget(), partIndex, charOffsetInPart, partIndex, charOffsetInPart, context.clientRectDeltaLeft, context.endNode);\n\t\tif (!r || r.length === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn r[0].left;\n\t}\n\n\tprivate _readRawVisibleRangesForRange(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | 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 HorizontalRange(0, this.getWidth())];\n\t\t}\n\n\t\tconst startPartData = this._characterMapping.charOffsetToPartData(startColumn - 1);\n\t\tconst startPartIndex = CharacterMapping.getPartIndex(startPartData);\n\t\tconst startCharOffsetInPart = CharacterMapping.getCharIndex(startPartData);\n\n\t\tconst endPartData = this._characterMapping.charOffsetToPartData(endColumn - 1);\n\t\tconst endPartIndex = CharacterMapping.getPartIndex(endPartData);\n\t\tconst endCharOffsetInPart = CharacterMapping.getCharIndex(endPartData);\n\n\t\treturn RangeUtil.readHorizontalRanges(this._getReadingTarget(), startPartIndex, startCharOffsetInPart, endPartIndex, endCharOffsetInPart, context.clientRectDeltaLeft, 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\tconst charOffset = this._characterMapping.partDataToCharOffset(spanIndex, spanNodeTextContentLength, offset);\n\t\treturn charOffset + 1;\n\t}\n}\n\nclass WebKitRenderedViewLine extends RenderedViewLine {\n\tprotected _readVisibleRangesForRange(startColumn: number, endColumn: number, context: DomReadingContext): HorizontalRange[] | null {\n\t\tconst output = super._readVisibleRangesForRange(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(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>, 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>, 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 * as browser from 'vs/base/browser/browser';\nimport { IPointerHandlerHelper } from 'vs/editor/browser/controller/mouseHandler';\nimport { IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { ClientCoordinates, EditorMouseEvent, EditorPagePosition, PageCoordinates } 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 } 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 { HorizontalRange } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport { IViewModel } from 'vs/editor/common/viewModel/viewModel';\n\nexport interface IViewZoneData {\n\tviewZoneId: number;\n\tpositionBefore: Position | null;\n\tpositionAfter: Position | null;\n\tposition: Position;\n\tafterLineNumber: number;\n}\n\nexport interface IMarginData {\n\tisAfterLines: boolean;\n\tglyphMarginLeft: number;\n\tglyphMarginWidth: number;\n\tlineNumbersWidth: number;\n\toffsetX: number;\n}\n\nexport interface IEmptyContentData {\n\tisAfterLines: boolean;\n\thorizontalDistanceToText?: number;\n}\n\ninterface IETextRange {\n\ttext: string;\n\tcollapse(start?: boolean): void;\n\tduplicate(): IETextRange;\n\tmoveToElementText(element: Element): void;\n\tmoveToPoint(x: number, y: number): void;\n\tparentElement(): Element;\n\tsetEndPoint(how: string, SourceRange: IETextRange): void;\n}\n\ndeclare var IETextRange: {\n\tprototype: IETextRange;\n\tnew(): IETextRange;\n};\n\ninterface IHitTestResult {\n\tposition: Position | null;\n\thitTarget: Element | null;\n}\n\nexport class MouseTarget implements IMouseTarget {\n\n\tpublic readonly element: Element | null;\n\tpublic readonly type: MouseTargetType;\n\tpublic readonly mouseColumn: number;\n\tpublic readonly position: Position | null;\n\tpublic readonly range: EditorRange | null;\n\tpublic readonly detail: any;\n\n\tconstructor(element: Element | null, type: MouseTargetType, mouseColumn: number = 0, position: Position | null = null, range: EditorRange | null = null, detail: any = null) {\n\t\tthis.element = element;\n\t\tthis.type = type;\n\t\tthis.mouseColumn = mouseColumn;\n\t\tthis.position = position;\n\t\tif (!range && position) {\n\t\t\trange = new EditorRange(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\t}\n\t\tthis.range = range;\n\t\tthis.detail = detail;\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 + ' - ' + target.detail;\n\t}\n\n\tpublic toString(): string {\n\t\treturn MouseTarget.toString(this);\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 model: IViewModel;\n\tpublic readonly layoutInfo: EditorLayoutInfo;\n\tpublic readonly viewDomNode: HTMLElement;\n\tpublic readonly lineHeight: number;\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\tpublic readonly lastViewCursorsRenderData: IViewCursorRenderData[];\n\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewHelper: IPointerHandlerHelper;\n\n\tconstructor(context: ViewContext, viewHelper: IPointerHandlerHelper, lastViewCursorsRenderData: IViewCursorRenderData[]) {\n\t\tthis.model = context.model;\n\t\tthis.layoutInfo = context.configuration.editor.layoutInfo;\n\t\tthis.viewDomNode = viewHelper.viewDomNode;\n\t\tthis.lineHeight = context.configuration.editor.lineHeight;\n\t\tthis.typicalHalfwidthCharacterWidth = context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.lastViewCursorsRenderData = lastViewCursorsRenderData;\n\t\tthis._context = context;\n\t\tthis._viewHelper = viewHelper;\n\t}\n\n\tpublic getZoneAtCoord(mouseVerticalOffset: number): IViewZoneData | null {\n\t\treturn HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset);\n\t}\n\n\tpublic static getZoneAtCoord(context: ViewContext, mouseVerticalOffset: number): IViewZoneData | 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\tlet viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2,\n\t\t\t\tlineCount = context.model.getLineCount(),\n\t\t\t\tpositionBefore: Position | null = null,\n\t\t\t\tposition: Position | null,\n\t\t\t\tpositionAfter: 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.model.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.model.getLineCount();\n\t\t\tconst maxLineColumn = this._context.model.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.model.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 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 visibleRangeForPosition2(lineNumber: number, column: number): HorizontalRange | null {\n\t\treturn this._viewHelper.visibleRangeForPosition2(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 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) {\n\t\tthis.editorPos = editorPos;\n\t\tthis.pos = pos;\n\n\t\tthis.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + pos.y - editorPos.y);\n\t\tthis.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + pos.x - editorPos.x - ctx.layoutInfo.contentLeft;\n\t\tthis.isInMarginArea = (pos.x - editorPos.x < ctx.layoutInfo.contentLeft && pos.x - editorPos.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, target: Element | null) {\n\t\tsuper(ctx, editorPos, pos);\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 toString(): string {\n\t\treturn `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\\n\\ttarget: ${this.target ? (<HTMLElement>this.target).outerHTML : null}`;\n\t}\n\n\tpublic fulfill(type: MouseTargetType, position: Position | null = null, range: EditorRange | null = null, detail: any = null): MouseTarget {\n\t\treturn new MouseTarget(this.target, type, this.mouseColumn, position, range, detail);\n\t}\n\n\tpublic withTarget(target: Element | null): HitTestRequest {\n\t\treturn new HitTestRequest(this._ctx, this.editorPos, this.pos, target);\n\t}\n}\n\ninterface ResolvedHitTestRequest extends HitTestRequest {\n\treadonly target: Element;\n}\n\nconst EMPTY_CONTENT_AFTER_LINES: IEmptyContentData = { isAfterLines: true };\n\nfunction createEmptyContentDataInLines(horizontalDistanceToText: number): IEmptyContentData {\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(lastViewCursorsRenderData: IViewCursorRenderData[], editorPos: EditorPagePosition, pos: PageCoordinates, target: HTMLElement | null): IMouseTarget {\n\t\tconst ctx = new HitTestContext(this._context, this._viewHelper, lastViewCursorsRenderData);\n\t\tconst request = new HitTestRequest(ctx, editorPos, pos, target);\n\t\ttry {\n\t\t\tconst r = MouseTargetFactory._createMouseTarget(ctx, request, false);\n\t\t\t// console.log(r.toString());\n\t\t\treturn r;\n\t\t} catch (err) {\n\t\t\t// console.log(err);\n\t\t\treturn request.fulfill(MouseTargetType.UNKNOWN);\n\t\t}\n\t}\n\n\tprivate static _createMouseTarget(ctx: HitTestContext, request: HitTestRequest, domHitTestExecuted: boolean): MouseTarget {\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.fulfill(MouseTargetType.UNKNOWN);\n\t\t\t}\n\n\t\t\tconst hitTestResult = MouseTargetFactory._doHitTest(ctx, request);\n\n\t\t\tif (hitTestResult.position) {\n\t\t\t\treturn MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.position.lineNumber, hitTestResult.position.column);\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: MouseTarget | 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.fulfill(MouseTargetType.UNKNOWN));\n\t}\n\n\tprivate static _hitTestContentWidget(ctx: HitTestContext, request: ResolvedHitTestRequest): MouseTarget | 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.fulfill(MouseTargetType.CONTENT_WIDGET, null, null, widgetId);\n\t\t\t} else {\n\t\t\t\treturn request.fulfill(MouseTargetType.UNKNOWN);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestOverlayWidget(ctx: HitTestContext, request: ResolvedHitTestRequest): MouseTarget | 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.fulfill(MouseTargetType.OVERLAY_WIDGET, null, null, widgetId);\n\t\t\t} else {\n\t\t\t\treturn request.fulfill(MouseTargetType.UNKNOWN);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestViewCursor(ctx: HitTestContext, request: ResolvedHitTestRequest): MouseTarget | 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.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.fulfill(MouseTargetType.CONTENT_TEXT, d.position);\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.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.fulfill(MouseTargetType.CONTENT_TEXT, d.position);\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): MouseTarget | 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.fulfill(mouseTargetType, viewZoneData.position, null, viewZoneData);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestTextArea(ctx: HitTestContext, request: ResolvedHitTestRequest): MouseTarget | null {\n\t\t// Is it the textarea?\n\t\tif (ElementPath.isTextArea(request.targetPath)) {\n\t\t\treturn request.fulfill(MouseTargetType.TEXTAREA);\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestMargin(ctx: HitTestContext, request: ResolvedHitTestRequest): MouseTarget | 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.pos.x - request.editorPos.x);\n\t\t\tconst detail: IMarginData = {\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.fulfill(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.fulfill(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.fulfill(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): MouseTarget | null {\n\t\tif (!ElementPath.isChildOfViewLines(request.targetPath)) {\n\t\t\treturn null;\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)) {\n\t\t\t// This most likely indicates it happened after the last view-line\n\t\t\tconst lineCount = ctx.model.getLineCount();\n\t\t\tconst maxLineColumn = ctx.model.getLineMaxColumn(lineCount);\n\t\t\treturn request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineCount, maxLineColumn), undefined, 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.model.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.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, 1), undefined, 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.fulfill(MouseTargetType.UNKNOWN);\n\t\t}\n\n\t\tconst hitTestResult = MouseTargetFactory._doHitTest(ctx, request);\n\n\t\tif (hitTestResult.position) {\n\t\t\treturn MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.position.lineNumber, hitTestResult.position.column);\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): MouseTarget | null {\n\t\tif (ElementPath.isChildOfMinimap(request.targetPath)) {\n\t\t\tconst possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n\t\t\tconst maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber);\n\t\t\treturn request.fulfill(MouseTargetType.SCROLLBAR, new Position(possibleLineNumber, maxColumn));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate static _hitTestScrollbarSlider(ctx: HitTestContext, request: ResolvedHitTestRequest): MouseTarget | 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.model.getLineMaxColumn(possibleLineNumber);\n\t\t\t\t\treturn request.fulfill(MouseTargetType.SCROLLBAR, 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): MouseTarget | 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.model.getLineMaxColumn(possibleLineNumber);\n\t\t\treturn request.fulfill(MouseTargetType.SCROLLBAR, new Position(possibleLineNumber, maxColumn));\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getMouseColumn(editorPos: EditorPagePosition, pos: PageCoordinates): number {\n\t\tconst layoutInfo = this._context.configuration.editor.layoutInfo;\n\t\tconst mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + pos.x - editorPos.x - layoutInfo.contentLeft;\n\t\treturn MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, this._context.configuration.editor.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, lineNumber: number, column: number): MouseTarget {\n\t\tconst pos = new Position(lineNumber, column);\n\n\t\tconst lineWidth = ctx.getLineWidth(lineNumber);\n\n\t\tif (request.mouseContentHorizontalOffset > lineWidth) {\n\t\t\tif (browser.isEdge && pos.column === 1) {\n\t\t\t\t// See https://github.com/Microsoft/vscode/issues/10875\n\t\t\t\tconst detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n\t\t\t\treturn request.fulfill(MouseTargetType.CONTENT_EMPTY, new Position(lineNumber, ctx.model.getLineMaxColumn(lineNumber)), undefined, detail);\n\t\t\t}\n\t\t\tconst detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n\t\t\treturn request.fulfill(MouseTargetType.CONTENT_EMPTY, pos, undefined, detail);\n\t\t}\n\n\t\tconst visibleRange = ctx.visibleRangeForPosition2(lineNumber, column);\n\n\t\tif (!visibleRange) {\n\t\t\treturn request.fulfill(MouseTargetType.UNKNOWN, pos);\n\t\t}\n\n\t\tconst columnHorizontalOffset = visibleRange.left;\n\n\t\tif (request.mouseContentHorizontalOffset === columnHorizontalOffset) {\n\t\t\treturn request.fulfill(MouseTargetType.CONTENT_TEXT, pos);\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.visibleRangeForPosition2(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.model.getLineMaxColumn(lineNumber);\n\t\tif (column < lineMaxColumn) {\n\t\t\tconst visibleRange = ctx.visibleRangeForPosition2(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\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.fulfill(MouseTargetType.CONTENT_TEXT, pos, rng);\n\t\t\t}\n\t\t}\n\t\treturn request.fulfill(MouseTargetType.CONTENT_TEXT, pos);\n\t}\n\n\t/**\n\t * Most probably WebKit browsers and Edge\n\t */\n\tprivate static _doHitTestWithCaretRangeFromPoint(ctx: HitTestContext, request: BareHitTestRequest): IHitTestResult {\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 + ctx.layoutInfo.height) {\n\t\t\tadjustedPageY = request.editorPos.y + ctx.layoutInfo.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.position) {\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): IHitTestResult {\n\n\t\tconst range: Range = document.caretRangeFromPoint(coords.clientX, coords.clientY);\n\n\t\tif (!range || !range.startContainer) {\n\t\t\treturn {\n\t\t\t\tposition: null,\n\t\t\t\thitTarget: null\n\t\t\t};\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\t\tlet hitTarget: HTMLElement | null = null;\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\tconst p = ctx.getPositionFromDOMInfo(<HTMLElement>parent1, range.startOffset);\n\t\t\t\treturn {\n\t\t\t\t\tposition: p,\n\t\t\t\t\thitTarget: null\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\thitTarget = <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\tconst p = ctx.getPositionFromDOMInfo(<HTMLElement>startContainer, (<HTMLElement>startContainer).textContent!.length);\n\t\t\t\treturn {\n\t\t\t\t\tposition: p,\n\t\t\t\t\thitTarget: null\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\thitTarget = <HTMLElement>startContainer;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tposition: null,\n\t\t\thitTarget: hitTarget\n\t\t};\n\t}\n\n\t/**\n\t * Most probably Gecko\n\t */\n\tprivate static _doHitTestWithCaretPositionFromPoint(ctx: HitTestContext, coords: ClientCoordinates): IHitTestResult {\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\tconst p = ctx.getPositionFromDOMInfo(<HTMLElement>hitResult.offsetNode.parentNode, hitResult.offset);\n\t\t\t\treturn {\n\t\t\t\t\tposition: p,\n\t\t\t\t\thitTarget: null\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tposition: null,\n\t\t\t\t\thitTarget: <HTMLElement>hitResult.offsetNode.parentNode\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tposition: null,\n\t\t\thitTarget: <HTMLElement>hitResult.offsetNode\n\t\t};\n\t}\n\n\t/**\n\t * Most probably IE\n\t */\n\tprivate static _doHitTestWithMoveToPoint(ctx: HitTestContext, coords: ClientCoordinates): IHitTestResult {\n\t\tlet resultPosition: Position | null = null;\n\t\tlet resultHitTarget: Element | null = null;\n\n\t\tconst textRange: IETextRange = (<any>document.body).createTextRange();\n\t\ttry {\n\t\t\ttextRange.moveToPoint(coords.clientX, coords.clientY);\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\tposition: null,\n\t\t\t\thitTarget: null\n\t\t\t};\n\t\t}\n\n\t\ttextRange.collapse(true);\n\n\t\t// Now, let's do our best to figure out what we hit :)\n\t\tconst parentElement = textRange ? textRange.parentElement() : null;\n\t\tconst parent1 = parentElement ? parentElement.parentNode : null;\n\t\tconst parent2 = parent1 ? parent1.parentNode : null;\n\n\t\tconst parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? (<HTMLElement>parent2).className : '';\n\n\t\tif (parent2ClassName === ViewLine.CLASS_NAME) {\n\t\t\tconst rangeToContainEntireSpan = textRange.duplicate();\n\t\t\trangeToContainEntireSpan.moveToElementText(parentElement!);\n\t\t\trangeToContainEntireSpan.setEndPoint('EndToStart', textRange);\n\n\t\t\tresultPosition = ctx.getPositionFromDOMInfo(<HTMLElement>parentElement, rangeToContainEntireSpan.text.length);\n\t\t\t// Move range out of the span node, IE doesn't like having many ranges in\n\t\t\t// the same spot and will act badly for lines containing dashes ('-')\n\t\t\trangeToContainEntireSpan.moveToElementText(ctx.viewDomNode);\n\t\t} else {\n\t\t\t// Looks like we've hit the hover or something foreign\n\t\t\tresultHitTarget = parentElement;\n\t\t}\n\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\ttextRange.moveToElementText(ctx.viewDomNode);\n\n\t\treturn {\n\t\t\tposition: resultPosition,\n\t\t\thitTarget: resultHitTarget\n\t\t};\n\t}\n\n\tprivate static _doHitTest(ctx: HitTestContext, request: BareHitTestRequest): IHitTestResult {\n\t\t// State of the art (18.10.2012):\n\t\t// The spec says browsers should support document.caretPositionFromPoint, but nobody implemented it (http://dev.w3.org/csswg/cssom-view/)\n\t\t// Gecko:\n\t\t// - they tried to implement it once, but failed: https://bugzilla.mozilla.org/show_bug.cgi?id=654352\n\t\t// - however, they do give out rangeParent/rangeOffset properties on mouse events\n\t\t// Webkit:\n\t\t// - they have implemented a previous version of the spec which was using document.caretRangeFromPoint\n\t\t// IE:\n\t\t// - they have a proprietary method on ranges, moveToPoint: https://msdn.microsoft.com/en-us/library/ie/ms536632(v=vs.85).aspx\n\n\t\t// 24.08.2016: Edge has added WebKit's document.caretRangeFromPoint, but it is quite buggy\n\t\t// - when hit testing the cursor it returns the first or the last line in the viewport\n\t\t// - it inconsistently hits text nodes or span nodes, while WebKit only hits text nodes\n\t\t// - when toggling render whitespace on, and hit testing in the empty content after a line, it always hits offset 0 of the first span of the line\n\n\t\t// Thank you browsers for making this so 'easy' :)\n\n\t\tif (document.caretRangeFromPoint) {\n\n\t\t\treturn this._doHitTestWithCaretRangeFromPoint(ctx, request);\n\n\t\t} else if ((<any>document).caretPositionFromPoint) {\n\n\t\t\treturn this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates());\n\n\t\t} else if ((<any>document.body).createTextRange) {\n\n\t\t\treturn this._doHitTestWithMoveToPoint(ctx, request.pos.toClientCoordinates());\n\n\t\t}\n\n\t\treturn {\n\t\t\tposition: null,\n\t\t\thitTarget: 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 browser from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { StandardWheelEvent, IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\nimport { RunOnceScheduler, TimeoutTimer } from 'vs/base/common/async';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { HitTestContext, IViewZoneData, MouseTarget, MouseTargetFactory } from 'vs/editor/browser/controller/mouseTarget';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorMouseMoveMonitor, createEditorPagePosition } from 'vs/editor/browser/editorDom';\nimport { ViewController } from 'vs/editor/browser/view/viewController';\nimport { IViewCursorRenderData } from 'vs/editor/browser/viewParts/viewCursors/viewCursor';\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 { HorizontalRange } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler';\n\n/**\n * Merges mouse events when mouse move events are throttled\n */\nfunction createMouseMoveEventMerger(mouseTargetFactory: MouseTargetFactory | null) {\n\treturn function (lastEvent: EditorMouseEvent, 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\n\t/**\n\t * Get the last rendered information of the cursors.\n\t */\n\tgetLastViewCursorsRenderData(): IViewCursorRenderData[];\n\n\tshouldSuppressMouseDownOnViewZone(viewZoneId: number): 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\tvisibleRangeForPosition2(lineNumber: number, column: number): HorizontalRange | null;\n\tgetLineWidth(lineNumber: number): number;\n}\n\nexport class MouseHandler extends ViewEventHandler {\n\n\tstatic MOUSE_MOVE_MINIMUM_TIME = 100; // ms\n\n\tprotected _context: ViewContext;\n\tprotected viewController: ViewController;\n\tprotected viewHelper: IPointerHandlerHelper;\n\tprotected mouseTargetFactory: MouseTargetFactory;\n\tprivate readonly _asyncFocus: RunOnceScheduler;\n\n\tprivate readonly _mouseDownOperation: MouseDownOperation;\n\tprivate lastMouseLeaveTime: 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._asyncFocus = this._register(new RunOnceScheduler(() => this.viewHelper.focusTextArea(), 0));\n\n\t\tthis.lastMouseLeaveTime = -1;\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.editor.viewInfo.mouseWheelZoom) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst e = new StandardWheelEvent(browserEvent);\n\t\t\tif (e.browserEvent!.ctrlKey || e.browserEvent!.metaKey) {\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, 'mousewheel', onMouseWheel, true));\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onCursorStateChanged(e);\n\t\treturn false;\n\t}\n\tprivate _isFocused = false;\n\tpublic onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis._isFocused = e.isFocused;\n\t\treturn false;\n\t}\n\tpublic 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): editorBrowser.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 lastViewCursorsRenderData = this.viewHelper.getLastViewCursorsRenderData();\n\t\treturn this.mouseTargetFactory.createMouseTarget(lastViewCursorsRenderData, editorPos, pos, null);\n\t}\n\n\tprotected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): editorBrowser.IMouseTarget {\n\t\tconst lastViewCursorsRenderData = this.viewHelper.getLastViewCursorsRenderData();\n\t\treturn this.mouseTargetFactory.createMouseTarget(lastViewCursorsRenderData, e.editorPos, e.pos, testEventTarget ? e.target : null);\n\t}\n\n\tprivate _getMouseColumn(e: EditorMouseEvent): number {\n\t\treturn this.mouseTargetFactory.getMouseColumn(e.editorPos, e.pos);\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\tprivate _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\tprivate _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 === editorBrowser.MouseTargetType.CONTENT_TEXT || t.type === editorBrowser.MouseTargetType.CONTENT_EMPTY);\n\t\tconst targetIsGutter = (t.type === editorBrowser.MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === editorBrowser.MouseTargetType.GUTTER_LINE_NUMBERS || t.type === editorBrowser.MouseTargetType.GUTTER_LINE_DECORATIONS);\n\t\tconst targetIsLineNumbers = (t.type === editorBrowser.MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tconst selectOnLineNumbers = this._context.configuration.editor.viewInfo.selectOnLineNumbers;\n\t\tconst targetIsViewZone = (t.type === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || t.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE);\n\t\tconst targetIsWidget = (t.type === editorBrowser.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\t// In IE11, if the focus is in the browser's address bar and\n\t\t\t// then you click in the editor, calling preventDefault()\n\t\t\t// will not move focus properly (focus remains the address bar)\n\t\t\tif (browser.isIE && !this._isFocused) {\n\t\t\t\tthis._asyncFocus.schedule();\n\t\t\t} else {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.viewHelper.focusTextArea();\n\t\t\t}\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 = <IViewZoneData>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) => editorBrowser.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) => editorBrowser.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 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: editorBrowser.MouseTargetType, e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\n\t\tthis._mouseState.setStartedOnLineNumbers(targetType === editorBrowser.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\tif (!this._context.configuration.editor.readOnly\n\t\t\t&& this._context.configuration.editor.dragAndDrop\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 === editorBrowser.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\tcreateMouseMoveEventMerger(null),\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t() => {\n\t\t\t\t\tconst position = this._findMousePosition(this._lastMouseEvent!, true);\n\n\t\t\t\t\tthis._viewController.emitMouseDrop({\n\t\t\t\t\t\tevent: this._lastMouseEvent!,\n\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});\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\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 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): MouseTarget | null {\n\t\tconst editorContent = e.editorPos;\n\t\tconst model = this._context.model;\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 new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, newPosition);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, 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.posy - editorContent.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 new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, newPosition);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)));\n\t\t}\n\n\t\tconst possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + (e.posy - editorContent.y));\n\n\t\tif (e.posx < editorContent.x) {\n\t\t\treturn new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, 1));\n\t\t}\n\n\t\tif (e.posx > editorContent.x + editorContent.width) {\n\t\t\treturn new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, 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): MouseTarget | 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 === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || t.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(<IViewZoneData>t.detail);\n\t\t\tif (newPosition) {\n\t\t\t\treturn new MouseTarget(t.element, t.type, t.mouseColumn, newPosition, null, t.detail);\n\t\t\t}\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tprivate _helpPositionJumpOverViewZone(viewZoneData: IViewZoneData): 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: MouseTarget, 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\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 { EventType, Gesture, GestureEvent } from 'vs/base/browser/touch';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { IPointerHandlerHelper, MouseHandler } from 'vs/editor/browser/controller/mouseHandler';\nimport { IMouseTarget } from 'vs/editor/browser/editorBrowser';\nimport { EditorMouseEvent } from 'vs/editor/browser/editorDom';\nimport { ViewController } from 'vs/editor/browser/view/viewController';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\n\ninterface IThrottledGestureEvent {\n\ttranslationX: number;\n\ttranslationY: number;\n}\n\nfunction gestureChangeEventMerger(lastEvent: IThrottledGestureEvent, currentEvent: MSGestureEvent): IThrottledGestureEvent {\n\tconst r = {\n\t\ttranslationY: currentEvent.translationY,\n\t\ttranslationX: currentEvent.translationX\n\t};\n\tif (lastEvent) {\n\t\tr.translationY += lastEvent.translationY;\n\t\tr.translationX += lastEvent.translationX;\n\t}\n\treturn r;\n}\n\n/**\n * Basically IE10 and IE11\n */\nclass MsPointerHandler extends MouseHandler implements IDisposable {\n\n\tprivate _lastPointerType: string;\n\tprivate _installGestureHandlerTimeout: number;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper(context, viewController, viewHelper);\n\n\t\tthis.viewHelper.linesContentDomNode.style.msTouchAction = 'none';\n\t\tthis.viewHelper.linesContentDomNode.style.msContentZooming = 'none';\n\n\t\t// TODO@Alex -> this expects that the view is added in 100 ms, might not be the case\n\t\t// This handler should be added when the dom node is in the dom tree\n\t\tthis._installGestureHandlerTimeout = window.setTimeout(() => {\n\t\t\tthis._installGestureHandlerTimeout = -1;\n\t\t\tif ((<any>window).MSGesture) {\n\t\t\t\tconst touchGesture = new MSGesture();\n\t\t\t\tconst penGesture = new MSGesture();\n\t\t\t\ttouchGesture.target = this.viewHelper.linesContentDomNode;\n\t\t\t\tpenGesture.target = this.viewHelper.linesContentDomNode;\n\t\t\t\tthis.viewHelper.linesContentDomNode.addEventListener('MSPointerDown', (e: MSPointerEvent) => {\n\t\t\t\t\t// Circumvent IE11 breaking change in e.pointerType & TypeScript's stale definitions\n\t\t\t\t\tconst pointerType = <any>e.pointerType;\n\t\t\t\t\tif (pointerType === ((<any>e).MSPOINTER_TYPE_MOUSE || 'mouse')) {\n\t\t\t\t\t\tthis._lastPointerType = 'mouse';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (pointerType === ((<any>e).MSPOINTER_TYPE_TOUCH || 'touch')) {\n\t\t\t\t\t\tthis._lastPointerType = 'touch';\n\t\t\t\t\t\ttouchGesture.addPointer(e.pointerId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._lastPointerType = 'pen';\n\t\t\t\t\t\tpenGesture.addPointer(e.pointerId);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._register(dom.addDisposableThrottledListener<IThrottledGestureEvent>(this.viewHelper.linesContentDomNode, 'MSGestureChange', (e) => this._onGestureChange(e), gestureChangeEventMerger));\n\t\t\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, 'MSGestureTap', (e) => this._onCaptureGestureTap(e), true));\n\t\t\t}\n\t\t}, 100);\n\t\tthis._lastPointerType = 'mouse';\n\t}\n\n\tpublic _onMouseDown(e: EditorMouseEvent): void {\n\t\tif (this._lastPointerType === 'mouse') {\n\t\t\tsuper._onMouseDown(e);\n\t\t}\n\t}\n\n\tprivate _onCaptureGestureTap(rawEvent: MSGestureEvent): void {\n\t\tconst e = new EditorMouseEvent(<MouseEvent><any>rawEvent, this.viewHelper.viewDomNode);\n\t\tconst t = this._createMouseTarget(e, false);\n\t\tif (t.position) {\n\t\t\tthis.viewController.moveTo(t.position);\n\t\t}\n\t\t// IE does not want to focus when coming in from the browser's address bar\n\t\tif ((<any>e.browserEvent).fromElement) {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t} else {\n\t\t\t// TODO@Alex -> cancel this is focus is lost\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.viewHelper.focusTextArea();\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _onGestureChange(e: IThrottledGestureEvent): void {\n\t\tthis._context.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);\n\t}\n\n\tpublic dispose(): void {\n\t\twindow.clearTimeout(this._installGestureHandlerTimeout);\n\t\tsuper.dispose();\n\t}\n}\n\n/**\n * Basically Edge but should be modified to handle any pointerEnabled, even without support of MSGesture\n */\nclass StandardPointerHandler extends MouseHandler implements IDisposable {\n\n\tprivate _lastPointerType: string;\n\tprivate _installGestureHandlerTimeout: number;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper(context, viewController, viewHelper);\n\n\t\tthis.viewHelper.linesContentDomNode.style.touchAction = 'none';\n\n\t\t// TODO@Alex -> this expects that the view is added in 100 ms, might not be the case\n\t\t// This handler should be added when the dom node is in the dom tree\n\t\tthis._installGestureHandlerTimeout = window.setTimeout(() => {\n\t\t\tthis._installGestureHandlerTimeout = -1;\n\n\t\t\t// TODO@Alex: replace the usage of MSGesture here with something that works across all browsers\n\t\t\tif ((<any>window).MSGesture) {\n\t\t\t\tconst touchGesture = new MSGesture();\n\t\t\t\tconst penGesture = new MSGesture();\n\t\t\t\ttouchGesture.target = this.viewHelper.linesContentDomNode;\n\t\t\t\tpenGesture.target = this.viewHelper.linesContentDomNode;\n\t\t\t\tthis.viewHelper.linesContentDomNode.addEventListener('pointerdown', (e: MSPointerEvent) => {\n\t\t\t\t\tconst pointerType = <any>e.pointerType;\n\t\t\t\t\tif (pointerType === 'mouse') {\n\t\t\t\t\t\tthis._lastPointerType = 'mouse';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (pointerType === 'touch') {\n\t\t\t\t\t\tthis._lastPointerType = 'touch';\n\t\t\t\t\t\ttouchGesture.addPointer(e.pointerId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._lastPointerType = 'pen';\n\t\t\t\t\t\tpenGesture.addPointer(e.pointerId);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._register(dom.addDisposableThrottledListener<IThrottledGestureEvent>(this.viewHelper.linesContentDomNode, 'MSGestureChange', (e) => this._onGestureChange(e), gestureChangeEventMerger));\n\t\t\t\tthis._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, 'MSGestureTap', (e) => this._onCaptureGestureTap(e), true));\n\t\t\t}\n\t\t}, 100);\n\t\tthis._lastPointerType = 'mouse';\n\t}\n\n\tpublic _onMouseDown(e: EditorMouseEvent): void {\n\t\tif (this._lastPointerType === 'mouse') {\n\t\t\tsuper._onMouseDown(e);\n\t\t}\n\t}\n\n\tprivate _onCaptureGestureTap(rawEvent: MSGestureEvent): void {\n\t\tconst e = new EditorMouseEvent(<MouseEvent><any>rawEvent, this.viewHelper.viewDomNode);\n\t\tconst t = this._createMouseTarget(e, false);\n\t\tif (t.position) {\n\t\t\tthis.viewController.moveTo(t.position);\n\t\t}\n\t\t// IE does not want to focus when coming in from the browser's address bar\n\t\tif ((<any>e.browserEvent).fromElement) {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t} else {\n\t\t\t// TODO@Alex -> cancel this is focus is lost\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.viewHelper.focusTextArea();\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate _onGestureChange(e: IThrottledGestureEvent): void {\n\t\tthis._context.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);\n\t}\n\n\tpublic dispose(): void {\n\t\twindow.clearTimeout(this._installGestureHandlerTimeout);\n\t\tsuper.dispose();\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\tGesture.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\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\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\tthis.viewController.moveTo(target.position);\n\t\t}\n\t}\n\n\tprivate onChange(e: GestureEvent): void {\n\t\tthis._context.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);\n\t}\n}\n\nexport class PointerHandler implements IDisposable {\n\tprivate readonly handler: MouseHandler;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tif (window.navigator.msPointerEnabled) {\n\t\t\tthis.handler = new MsPointerHandler(context, viewController, viewHelper);\n\t\t} else if ((<any>window).TouchEvent) {\n\t\t\tthis.handler = new TouchHandler(context, viewController, viewHelper);\n\t\t} else if (window.navigator.pointerEnabled || (<any>window).PointerEvent) {\n\t\t\tthis.handler = new StandardPointerHandler(context, viewController, viewHelper);\n\t\t} else {\n\t\t\tthis.handler = 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\tpublic dispose(): void {\n\t\tthis.handler.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 { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { MouseTarget } from 'vs/editor/browser/controller/mouseTarget';\nimport { IEditorMouseEvent, IMouseTarget, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IScrollEvent } from 'vs/editor/common/editorCommon';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { IViewModel } from 'vs/editor/common/viewModel/viewModel';\nimport { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';\n\nexport interface EventCallback<T> {\n\t(event: T): void;\n}\n\nexport class ViewOutgoingEvents extends Disposable {\n\n\tpublic onDidScroll: EventCallback<IScrollEvent> | null = null;\n\tpublic onDidGainFocus: EventCallback<void> | null = null;\n\tpublic onDidLoseFocus: EventCallback<void> | null = null;\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 onMouseUp: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseDown: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseDrag: EventCallback<IEditorMouseEvent> | null = null;\n\tpublic onMouseDrop: EventCallback<IPartialEditorMouseEvent> | null = null;\n\tpublic onMouseWheel: EventCallback<IMouseWheelEvent> | null = null;\n\n\tprivate readonly _viewModel: IViewModel;\n\n\tconstructor(viewModel: IViewModel) {\n\t\tsuper();\n\t\tthis._viewModel = viewModel;\n\t}\n\n\tpublic emitScrollChanged(e: viewEvents.ViewScrollChangedEvent): void {\n\t\tif (this.onDidScroll) {\n\t\t\tthis.onDidScroll(e);\n\t\t}\n\t}\n\n\tpublic emitViewFocusGained(): void {\n\t\tif (this.onDidGainFocus) {\n\t\t\tthis.onDidGainFocus(undefined);\n\t\t}\n\t}\n\n\tpublic emitViewFocusLost(): void {\n\t\tif (this.onDidLoseFocus) {\n\t\t\tthis.onDidLoseFocus(undefined);\n\t\t}\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 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 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 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 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 new ExternalMouseTarget(\n\t\t\ttarget.element,\n\t\t\ttarget.type,\n\t\t\ttarget.mouseColumn,\n\t\t\ttarget.position ? this._convertViewToModelPosition(target.position) : null,\n\t\t\ttarget.range ? this._convertViewToModelRange(target.range) : null,\n\t\t\ttarget.detail\n\t\t);\n\t}\n\n\tprivate _convertViewToModelPosition(viewPosition: Position): Position {\n\t\treturn this._viewModel.coordinatesConverter.convertViewPositionToModelPosition(viewPosition);\n\t}\n\n\tprivate _convertViewToModelRange(viewRange: Range): Range {\n\t\treturn this._viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange);\n\t}\n}\n\nclass ExternalMouseTarget implements IMouseTarget {\n\n\tpublic readonly element: Element | null;\n\tpublic readonly type: MouseTargetType;\n\tpublic readonly mouseColumn: number;\n\tpublic readonly position: Position | null;\n\tpublic readonly range: Range | null;\n\tpublic readonly detail: any;\n\n\tconstructor(element: Element | null, type: MouseTargetType, mouseColumn: number, position: Position | null, range: Range | null, detail: any) {\n\t\tthis.element = element;\n\t\tthis.type = type;\n\t\tthis.mouseColumn = mouseColumn;\n\t\tthis.position = position;\n\t\tthis.range = range;\n\t\tthis.detail = detail;\n\t}\n\n\tpublic toString(): string {\n\t\treturn MouseTarget.toString(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 'vs/css!./viewLines';\nimport { FastDomNode } from 'vs/base/browser/fastDomNode';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { Configuration } from 'vs/editor/browser/config/configuration';\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 { ScrollType } from 'vs/editor/common/editorCommon';\nimport { HorizontalRange, IViewLines, LineVisibleRanges } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { Viewport } from 'vs/editor/common/viewModel/viewModel';\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 HorizontalRevealRequest {\n\n\tpublic readonly lineNumber: number;\n\tpublic readonly startColumn: number;\n\tpublic readonly endColumn: number;\n\tpublic readonly startScrollTop: number;\n\tpublic readonly stopScrollTop: number;\n\tpublic readonly scrollType: ScrollType;\n\n\tconstructor(lineNumber: number, startColumn: number, endColumn: number, startScrollTop: number, stopScrollTop: number, scrollType: ScrollType) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.startColumn = startColumn;\n\t\tthis.endColumn = endColumn;\n\t\tthis.startScrollTop = startScrollTop;\n\t\tthis.stopScrollTop = stopScrollTop;\n\t\tthis.scrollType = scrollType;\n\t}\n}\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 _canUseLayerHinting: boolean;\n\tprivate _viewLineOptions: ViewLineOptions;\n\n\t// --- width\n\tprivate _maxLineWidth: number;\n\tprivate readonly _asyncUpdateLineWidths: 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\n\t\tthis._lineHeight = conf.editor.lineHeight;\n\t\tthis._typicalHalfwidthCharacterWidth = conf.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._isViewportWrapping = conf.editor.wrappingInfo.isViewportWrapping;\n\t\tthis._revealHorizontalRightPadding = conf.editor.viewInfo.revealHorizontalRightPadding;\n\t\tthis._canUseLayerHinting = conf.editor.canUseLayerHinting;\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');\n\t\tConfiguration.applyFontInfo(this.domNode, conf.editor.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\n\t\tthis._lastRenderedData = new LastRenderedData();\n\n\t\tthis._horizontalRevealRequest = null;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._asyncUpdateLineWidths.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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tthis._visibleLines.onConfigurationChanged(e);\n\t\tif (e.wrappingInfo) {\n\t\t\tthis._maxLineWidth = 0;\n\t\t}\n\n\t\tconst conf = this._context.configuration;\n\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = conf.editor.lineHeight;\n\t\t}\n\t\tif (e.fontInfo) {\n\t\t\tthis._typicalHalfwidthCharacterWidth = conf.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t}\n\t\tif (e.wrappingInfo) {\n\t\t\tthis._isViewportWrapping = conf.editor.wrappingInfo.isViewportWrapping;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._revealHorizontalRightPadding = conf.editor.viewInfo.revealHorizontalRightPadding;\n\t\t}\n\t\tif (e.canUseLayerHinting) {\n\t\t\tthis._canUseLayerHinting = conf.editor.canUseLayerHinting;\n\t\t}\n\t\tif (e.fontInfo) {\n\t\t\tConfiguration.applyFontInfo(this.domNode, conf.editor.fontInfo);\n\t\t}\n\n\t\tthis._onOptionsMaybeChanged();\n\n\t\tif (e.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 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 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 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 onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn this._visibleLines.onLinesChanged(e);\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn this._visibleLines.onLinesDeleted(e);\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn this._visibleLines.onLinesInserted(e);\n\t}\n\tpublic 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.range, e.verticalType);\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.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 {\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 HorizontalRevealRequest(e.range.startLineNumber, e.range.startColumn, e.range.endColumn, 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\tif (e.scrollType === ScrollType.Smooth && scrollTopDelta > this._lineHeight) {\n\t\t\tthis._context.viewLayout.setScrollPositionSmooth(newScrollPosition);\n\t\t} else {\n\t\t\tthis._context.viewLayout.setScrollPositionNow(newScrollPosition);\n\t\t}\n\n\t\treturn true;\n\t}\n\tpublic 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 onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn this._visibleLines.onTokensChanged(e);\n\t}\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\tthis._context.viewLayout.onMaxLineWidthChanged(this._maxLineWidth);\n\t\treturn this._visibleLines.onZonesChanged(e);\n\t}\n\tpublic 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.model.getLineCount()) {\n\t\t\t// lineNumber is outside range\n\t\t\treturn null;\n\t\t}\n\n\t\tif (this._context.model.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.model.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.model.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.model.getLineMaxColumn(lineNumber);\n\t\t\tconst visibleRangesForLine = this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(startColumn, endColumn, domReadingContext);\n\n\t\t\tif (!visibleRangesForLine || visibleRangesForLine.length === 0) {\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.model.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber + 1, 1)).lineNumber;\n\n\t\t\t\tif (currentLineModelLineNumber !== nextLineModelLineNumber) {\n\t\t\t\t\tvisibleRangesForLine[visibleRangesForLine.length - 1].width += this._typicalHalfwidthCharacterWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvisibleRanges[visibleRangesLen++] = new LineVisibleRanges(lineNumber, visibleRangesForLine);\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 visibleRangesForRange2(_range: Range): HorizontalRange[] | null {\n\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 range = Range.intersectRanges(_range, this._lastRenderedData.getCurrentVisibleRange());\n\t\tif (!range) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet result: HorizontalRange[] = [];\n\t\tconst domReadingContext = new DomReadingContext(this.domNode.domNode, this._textRangeRestingSpot);\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.model.getLineMaxColumn(lineNumber);\n\t\t\tconst visibleRangesForLine = this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(startColumn, endColumn, domReadingContext);\n\n\t\t\tif (!visibleRangesForLine || visibleRangesForLine.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tresult = result.concat(visibleRangesForLine);\n\t\t}\n\n\t\tif (result.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic visibleRangeForPosition(position: Position): HorizontalRange | null {\n\t\tconst visibleRanges = this.visibleRangesForRange2(new Range(position.lineNumber, position.column, position.lineNumber, position.column));\n\t\tif (!visibleRanges) {\n\t\t\treturn null;\n\t\t}\n\t\treturn visibleRanges[0];\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.model.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\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 revealLineNumber = this._horizontalRevealRequest.lineNumber;\n\t\t\tconst revealStartColumn = this._horizontalRevealRequest.startColumn;\n\t\t\tconst revealEndColumn = this._horizontalRevealRequest.endColumn;\n\t\t\tconst scrollType = this._horizontalRevealRequest.scrollType;\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 <= revealLineNumber && revealLineNumber <= 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._computeScrollLeftToRevealRange(revealLineNumber, revealStartColumn, revealEndColumn);\n\n\t\t\t\tconst isViewportWrapping = this._isViewportWrapping;\n\t\t\t\tif (!isViewportWrapping) {\n\t\t\t\t\t// ensure `scrollWidth` is large enough\n\t\t\t\t\tthis._ensureMaxLineWidth(newScrollLeft.maxHorizontalOffset);\n\t\t\t\t}\n\n\t\t\t\t// set `scrollLeft`\n\t\t\t\tif (scrollType === ScrollType.Smooth) {\n\t\t\t\t\tthis._context.viewLayout.setScrollPositionSmooth({\n\t\t\t\t\t\tscrollLeft: newScrollLeft.scrollLeft\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis._context.viewLayout.setScrollPositionNow({\n\t\t\t\t\t\tscrollLeft: newScrollLeft.scrollLeft\n\t\t\t\t\t});\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\t// (3) handle scrolling\n\t\tthis._linesContent.setLayerHinting(this._canUseLayerHinting);\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.viewLayout.onMaxLineWidthChanged(this._maxLineWidth);\n\t\t}\n\t}\n\n\tprivate _computeScrollTopToRevealRange(viewport: Viewport, range: Range, 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 boxStartY: number;\n\t\tlet boxEndY: number;\n\n\t\t// Have a box that includes one extra line height (for the horizontal scrollbar)\n\t\tboxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.startLineNumber);\n\t\tboxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.endLineNumber) + this._lineHeight;\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 += this._lineHeight;\n\t\t}\n\n\t\tlet newScrollTop: number;\n\n\t\tif (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 _computeScrollLeftToRevealRange(lineNumber: number, startColumn: number, endColumn: number): { scrollLeft: number; maxHorizontalOffset: number; } {\n\n\t\tlet maxHorizontalOffset = 0;\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\tconst visibleRanges = this.visibleRangesForRange2(new Range(lineNumber, startColumn, lineNumber, endColumn));\n\t\tlet boxStartX = Number.MAX_VALUE;\n\t\tlet boxEndX = 0;\n\n\t\tif (!visibleRanges) {\n\t\t\t// Unknown\n\t\t\treturn {\n\t\t\t\tscrollLeft: viewportStartX,\n\t\t\t\tmaxHorizontalOffset: maxHorizontalOffset\n\t\t\t};\n\t\t}\n\n\t\tfor (const visibleRange of visibleRanges) {\n\t\t\tif (visibleRange.left < boxStartX) {\n\t\t\t\tboxStartX = visibleRange.left;\n\t\t\t}\n\t\t\tif (visibleRange.left + visibleRange.width > boxEndX) {\n\t\t\t\tboxEndX = visibleRange.left + visibleRange.width;\n\t\t\t}\n\t\t}\n\n\t\tmaxHorizontalOffset = boxEndX;\n\n\t\tboxStartX = Math.max(0, boxStartX - ViewLines.HORIZONTAL_EXTRA_PX);\n\t\tboxEndX += this._revealHorizontalRightPadding;\n\n\t\tconst newScrollLeft = this._computeMinimumScrolling(viewportStartX, viewportEndX, boxStartX, boxEndX);\n\t\treturn {\n\t\t\tscrollLeft: newScrollLeft,\n\t\t\tmaxHorizontalOffset: maxHorizontalOffset\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 '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 } 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 } from 'vs/editor/common/config/editorOptions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { RGBA8 } from 'vs/editor/common/core/rgba';\nimport { IConfiguration, ScrollType } from 'vs/editor/common/editorCommon';\nimport { ColorId } from 'vs/editor/common/modes';\nimport { Constants, MinimapCharRenderer, MinimapTokensColorTracker } from 'vs/editor/common/view/minimapCharRenderer';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { getOrCreateMinimapCharRenderer } from 'vs/editor/common/view/runtimeMinimapCharRenderer';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewLineData } from 'vs/editor/common/viewModel/viewModel';\nimport { scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nfunction getMinimapLineHeight(renderMinimap: RenderMinimap): number {\n\tif (renderMinimap === RenderMinimap.Large) {\n\t\treturn Constants.x2_CHAR_HEIGHT;\n\t}\n\tif (renderMinimap === RenderMinimap.LargeBlocks) {\n\t\treturn Constants.x2_CHAR_HEIGHT + 2;\n\t}\n\tif (renderMinimap === RenderMinimap.Small) {\n\t\treturn Constants.x1_CHAR_HEIGHT;\n\t}\n\t// RenderMinimap.SmallBlocks\n\treturn Constants.x1_CHAR_HEIGHT + 1;\n}\n\nfunction getMinimapCharWidth(renderMinimap: RenderMinimap): number {\n\tif (renderMinimap === RenderMinimap.Large) {\n\t\treturn Constants.x2_CHAR_WIDTH;\n\t}\n\tif (renderMinimap === RenderMinimap.LargeBlocks) {\n\t\treturn Constants.x2_CHAR_WIDTH;\n\t}\n\tif (renderMinimap === RenderMinimap.Small) {\n\t\treturn Constants.x1_CHAR_WIDTH;\n\t}\n\t// RenderMinimap.SmallBlocks\n\treturn Constants.x1_CHAR_WIDTH;\n}\n\n/**\n * The orthogonal distance to the slider at which dragging \"resets\". This implements \"snapping\"\n */\nconst MOUSE_DRAG_RESET_DISTANCE = 140;\n\nclass MinimapOptions {\n\n\tpublic readonly renderMinimap: RenderMinimap;\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\tconstructor(configuration: IConfiguration) {\n\t\tconst pixelRatio = configuration.editor.pixelRatio;\n\t\tconst layoutInfo = configuration.editor.layoutInfo;\n\t\tconst viewInfo = configuration.editor.viewInfo;\n\t\tconst fontInfo = configuration.editor.fontInfo;\n\n\t\tthis.renderMinimap = layoutInfo.renderMinimap | 0;\n\t\tthis.scrollBeyondLastLine = viewInfo.scrollBeyondLastLine;\n\t\tthis.showSlider = viewInfo.minimap.showSlider;\n\t\tthis.pixelRatio = pixelRatio;\n\t\tthis.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.lineHeight = configuration.editor.lineHeight;\n\t\tthis.minimapLeft = layoutInfo.minimapLeft;\n\t\tthis.minimapWidth = layoutInfo.minimapWidth;\n\t\tthis.minimapHeight = layoutInfo.height;\n\n\t\tthis.canvasInnerWidth = Math.max(1, Math.floor(pixelRatio * this.minimapWidth));\n\t\tthis.canvasInnerHeight = Math.max(1, Math.floor(pixelRatio * this.minimapHeight));\n\n\t\tthis.canvasOuterWidth = this.canvasInnerWidth / pixelRatio;\n\t\tthis.canvasOuterHeight = this.canvasInnerHeight / pixelRatio;\n\t}\n\n\tpublic equals(other: MinimapOptions): boolean {\n\t\treturn (this.renderMinimap === other.renderMinimap\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);\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\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\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._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\tconst desiredSliderPosition = this.sliderTop + delta;\n\t\treturn Math.round(desiredSliderPosition / this._computedSliderRatio);\n\t}\n\n\tpublic static create(\n\t\toptions: MinimapOptions,\n\t\tviewportStartLineNumber: number,\n\t\tviewportEndLineNumber: number,\n\t\tviewportHeight: number,\n\t\tviewportContainsWhitespaceGaps: boolean,\n\t\tlineCount: 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 = getMinimapLineHeight(options.renderMinimap);\n\t\tconst minimapLinesFitting = Math.floor(options.canvasInnerHeight / minimapLineHeight);\n\t\tconst lineHeight = options.lineHeight;\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\tif (minimapLinesFitting >= lineCount) {\n\t\t\t// All lines fit in the minimap\n\t\t\tconst startLineNumber = 1;\n\t\t\tconst endLineNumber = lineCount;\n\n\t\t\treturn new MinimapLayout(scrollTop, scrollHeight, 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\n\t\t\treturn new MinimapLayout(scrollTop, scrollHeight, computedSliderRatio, sliderTop, 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.renderedLayout.startLineNumber !== layout.startLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.renderedLayout.endLineNumber !== layout.endLineNumber) {\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_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(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn this._renderedLines.onLinesChanged(e.fromLineNumber, e.toLineNumber);\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): void {\n\t\tthis._renderedLines.onLinesDeleted(e.fromLineNumber, e.toLineNumber);\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): void {\n\t\tthis._renderedLines.onLinesInserted(e.fromLineNumber, e.toLineNumber);\n\t}\n\tpublic onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\treturn this._renderedLines.onTokensChanged(e.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\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] = 255;\n\t\t\t\toffset += 4;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\nexport class Minimap extends ViewPart {\n\n\tprivate readonly _domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _shadow: FastDomNode<HTMLElement>;\n\tprivate readonly _canvas: FastDomNode<HTMLCanvasElement>;\n\tprivate readonly _slider: FastDomNode<HTMLElement>;\n\tprivate readonly _sliderHorizontal: FastDomNode<HTMLElement>;\n\tprivate readonly _tokensColorTracker: MinimapTokensColorTracker;\n\tprivate readonly _mouseDownListener: IDisposable;\n\tprivate readonly _sliderMouseMoveMonitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData>;\n\tprivate readonly _sliderMouseDownListener: IDisposable;\n\n\tprivate _options: MinimapOptions;\n\tprivate _lastRenderData: RenderData | null;\n\tprivate _buffers: MinimapBuffers | null;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper(context);\n\n\t\tthis._options = new MinimapOptions(this._context.configuration);\n\t\tthis._lastRenderData = null;\n\t\tthis._buffers = null;\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._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._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._tokensColorTracker = MinimapTokensColorTracker.getInstance();\n\n\t\tthis._applyLayout();\n\n\t\tthis._mouseDownListener = dom.addStandardDisposableListener(this._canvas.domNode, 'mousedown', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst renderMinimap = this._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\tconst minimapLineHeight = getMinimapLineHeight(renderMinimap);\n\t\t\tconst internalOffsetY = this._options.pixelRatio * 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._context.model.getLineCount());\n\n\t\t\tthis._context.privateViewEventBus.emit(new viewEvents.ViewRevealRangeRequestEvent(\n\t\t\t\tnew Range(lineNumber, 1, lineNumber, 1),\n\t\t\t\tviewEvents.VerticalRevealType.Center,\n\t\t\t\tfalse,\n\t\t\t\tScrollType.Smooth\n\t\t\t));\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\tif (e.leftButton && this._lastRenderData) {\n\n\t\t\t\tconst initialMousePosition = e.posy;\n\t\t\t\tconst initialMouseOrthogonalPosition = e.posx;\n\t\t\t\tconst initialSliderState = this._lastRenderData.renderedLayout;\n\t\t\t\tthis._slider.toggleClassName('active', true);\n\n\t\t\t\tthis._sliderMouseMoveMonitor.startMonitoring(\n\t\t\t\t\tstandardMouseMoveMerger,\n\t\t\t\t\t(mouseMoveData: IStandardMouseMoveEventData) => {\n\t\t\t\t\t\tconst mouseOrthogonalDelta = Math.abs(mouseMoveData.posx - initialMouseOrthogonalPosition);\n\n\t\t\t\t\t\tif (platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) {\n\t\t\t\t\t\t\t// The mouse has wondered away from the scrollbar => reset dragging\n\t\t\t\t\t\t\tthis._context.viewLayout.setScrollPositionNow({\n\t\t\t\t\t\t\t\tscrollTop: initialSliderState.scrollTop\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst mouseDelta = mouseMoveData.posy - initialMousePosition;\n\t\t\t\t\t\tthis._context.viewLayout.setScrollPositionNow({\n\t\t\t\t\t\t\tscrollTop: initialSliderState.getDesiredScrollTopFromDelta(mouseDelta)\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis._slider.toggleClassName('active', false);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._mouseDownListener.dispose();\n\t\tthis._sliderMouseMoveMonitor.dispose();\n\t\tthis._sliderMouseDownListener.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tprivate _getMinimapDomNodeClassName(): string {\n\t\tif (this._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._options.minimapLeft);\n\t\tthis._domNode.setWidth(this._options.minimapWidth);\n\t\tthis._domNode.setHeight(this._options.minimapHeight);\n\t\tthis._shadow.setHeight(this._options.minimapHeight);\n\t\tthis._canvas.setWidth(this._options.canvasOuterWidth);\n\t\tthis._canvas.setHeight(this._options.canvasOuterHeight);\n\t\tthis._canvas.domNode.width = this._options.canvasInnerWidth;\n\t\tthis._canvas.domNode.height = this._options.canvasInnerHeight;\n\t\tthis._slider.setWidth(this._options.minimapWidth);\n\t}\n\n\tprivate _getBuffer(): ImageData {\n\t\tif (!this._buffers) {\n\t\t\tthis._buffers = new MinimapBuffers(\n\t\t\t\tthis._canvas.domNode.getContext('2d')!,\n\t\t\t\tthis._options.canvasInnerWidth,\n\t\t\t\tthis._options.canvasInnerHeight,\n\t\t\t\tthis._tokensColorTracker.getColor(ColorId.DefaultBackground)\n\t\t\t);\n\t\t}\n\t\treturn this._buffers!.getBuffer();\n\t}\n\n\tprivate _onOptionsMaybeChanged(): boolean {\n\t\tconst opts = new MinimapOptions(this._context.configuration);\n\t\tif (this._options.equals(opts)) {\n\t\t\treturn false;\n\t\t}\n\t\tthis._options = opts;\n\t\tthis._lastRenderData = null;\n\t\tthis._buffers = null;\n\t\tthis._applyLayout();\n\t\tthis._domNode.setClassName(this._getMinimapDomNodeClassName());\n\t\treturn true;\n\t}\n\n\t// ---- begin view event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn this._onOptionsMaybeChanged();\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\tthis._lastRenderData = null;\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\treturn this._lastRenderData.onLinesChanged(e);\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\tthis._lastRenderData.onLinesDeleted(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\tthis._lastRenderData.onLinesInserted(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {\n\t\tif (this._lastRenderData) {\n\t\t\treturn this._lastRenderData.onTokensChanged(e);\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onTokensColorsChanged(e: viewEvents.ViewTokensColorsChangedEvent): boolean {\n\t\tthis._lastRenderData = null;\n\t\tthis._buffers = null;\n\t\treturn true;\n\t}\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\tthis._lastRenderData = null;\n\t\treturn true;\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(renderingCtx: RestrictedRenderingContext): void {\n\t\tconst renderMinimap = this._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._options,\n\t\t\trenderingCtx.visibleRange.startLineNumber,\n\t\t\trenderingCtx.visibleRange.endLineNumber,\n\t\t\trenderingCtx.viewportHeight,\n\t\t\t(renderingCtx.viewportData.whitespaceViewportData.length > 0),\n\t\t\tthis._context.model.getLineCount(),\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.setTop(layout.sliderTop);\n\t\tthis._slider.setHeight(layout.sliderHeight);\n\n\t\t// Compute horizontal slider coordinates\n\t\tconst scrollLeftChars = renderingCtx.scrollLeft / this._options.typicalHalfwidthCharacterWidth;\n\t\tconst horizontalSliderLeft = Math.min(this._options.minimapWidth, Math.round(scrollLeftChars * getMinimapCharWidth(this._options.renderMinimap) / this._options.pixelRatio));\n\t\tthis._sliderHorizontal.setLeft(horizontalSliderLeft);\n\t\tthis._sliderHorizontal.setWidth(this._options.minimapWidth - horizontalSliderLeft);\n\t\tthis._sliderHorizontal.setTop(0);\n\t\tthis._sliderHorizontal.setHeight(layout.sliderHeight);\n\n\t\tthis._lastRenderData = this.renderLines(layout);\n\t}\n\n\tprivate renderLines(layout: MinimapLayout): RenderData {\n\t\tconst renderMinimap = this._options.renderMinimap;\n\t\tconst startLineNumber = layout.startLineNumber;\n\t\tconst endLineNumber = layout.endLineNumber;\n\t\tconst minimapLineHeight = getMinimapLineHeight(renderMinimap);\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\n\t\t// Render untouched lines by using last rendered data.\n\t\tlet [_dirtyY1, _dirtyY2, needed] = Minimap._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._context.model.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed);\n\t\tconst tabSize = lineInfo.tabSize;\n\t\tconst background = this._tokensColorTracker.getColor(ColorId.DefaultBackground);\n\t\tconst useLighterFont = this._tokensColorTracker.backgroundIsLight();\n\n\t\t// Render the rest of lines\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\tMinimap._renderLine(\n\t\t\t\t\timageData,\n\t\t\t\t\tbackground,\n\t\t\t\t\tuseLighterFont,\n\t\t\t\t\trenderMinimap,\n\t\t\t\t\tthis._tokensColorTracker,\n\t\t\t\t\tgetOrCreateMinimapCharRenderer(),\n\t\t\t\t\tdy,\n\t\t\t\t\ttabSize,\n\t\t\t\t\tlineInfo.data[lineIndex]!\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\tuseLighterFont: boolean,\n\t\trenderMinimap: RenderMinimap,\n\t\tcolorTracker: MinimapTokensColorTracker,\n\t\tminimapCharRenderer: MinimapCharRenderer,\n\t\tdy: number,\n\t\ttabSize: number,\n\t\tlineData: ViewLineData\n\t): void {\n\t\tconst content = lineData.content;\n\t\tconst tokens = lineData.tokens;\n\t\tconst charWidth = getMinimapCharWidth(renderMinimap);\n\t\tconst maxDx = target.width - charWidth;\n\n\t\tlet dx = 0;\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.Large) {\n\t\t\t\t\t\t\tminimapCharRenderer.x2RenderChar(target, dx, dy, charCode, tokenColor, backgroundColor, useLighterFont);\n\t\t\t\t\t\t} else if (renderMinimap === RenderMinimap.Small) {\n\t\t\t\t\t\t\tminimapCharRenderer.x1RenderChar(target, dx, dy, charCode, tokenColor, backgroundColor, useLighterFont);\n\t\t\t\t\t\t} else if (renderMinimap === RenderMinimap.LargeBlocks) {\n\t\t\t\t\t\t\tminimapCharRenderer.x2BlockRenderChar(target, dx, dy, tokenColor, backgroundColor, useLighterFont);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// RenderMinimap.SmallBlocks\n\t\t\t\t\t\t\tminimapCharRenderer.x1BlockRenderChar(target, dx, dy, tokenColor, backgroundColor, useLighterFont);\n\t\t\t\t\t\t}\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\nregisterThemingParticipant((theme, collector) => {\n\tconst sliderBackground = theme.getColor(scrollbarSliderBackground);\n\tif (sliderBackground) {\n\t\tconst halfSliderBackground = sliderBackground.transparent(0.5);\n\t\tcollector.addRule(`.monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${halfSliderBackground}; }`);\n\t}\n\tconst sliderHoverBackground = theme.getColor(scrollbarSliderHoverBackground);\n\tif (sliderHoverBackground) {\n\t\tconst halfSliderHoverBackground = sliderHoverBackground.transparent(0.5);\n\t\tcollector.addRule(`.monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${halfSliderHoverBackground}; }`);\n\t}\n\tconst sliderActiveBackground = theme.getColor(scrollbarSliderActiveBackground);\n\tif (sliderActiveBackground) {\n\t\tconst halfSliderActiveBackground = sliderActiveBackground.transparent(0.5);\n\t\tcollector.addRule(`.monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${halfSliderActiveBackground}; }`);\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/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\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\tthis._useShadows = this._context.configuration.editor.viewInfo.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 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(): boolean {\n\t\tconst layoutInfo = this._context.configuration.editor.layoutInfo;\n\t\tlet newWidth = 0;\n\t\tif (layoutInfo.renderMinimap === 0 || (layoutInfo.minimapWidth > 0 && layoutInfo.minimapLeft === 0)) {\n\t\t\tnewWidth = layoutInfo.width;\n\t\t} else {\n\t\t\tnewWidth = layoutInfo.width - layoutInfo.minimapWidth - layoutInfo.verticalScrollbarWidth;\n\t\t}\n\t\tif (this._width !== newWidth) {\n\t\t\tthis._width = newWidth;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tlet shouldRender = false;\n\t\tif (e.viewInfo) {\n\t\t\tthis._useShadows = this._context.configuration.editor.viewInfo.scrollbar.useShadows;\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tshouldRender = this._updateWidth();\n\t\t}\n\t\treturn this._updateShouldShow() || shouldRender;\n\t}\n\tpublic 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 * Copyright (c) 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 * as browser from 'vs/base/browser/browser';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { Range } from 'vs/editor/common/core/range';\nimport { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { editorInactiveSelection, editorSelectionBackground, editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\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\n// TODO@Alex: Remove this once IE11 fixes Bug #524217\n// The problem in IE11 is that it does some sort of auto-zooming to accomodate for displays with different pixel density.\n// Unfortunately, this auto-zooming is buggy around dealing with rounded borders\nconst isIEWithZoomingIssuesNearRoundedBorders = browser.isEdgeOrIE;\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\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._roundedSelection = this._context.configuration.editor.viewInfo.roundedSelection;\n\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis._selections = [];\n\t\tthis._renderResult = null;\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._roundedSelection = this._context.configuration.editor.viewInfo.roundedSelection;\n\t\t}\n\t\tif (e.fontInfo) {\n\t\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections.slice(0);\n\t\treturn true;\n\t}\n\tpublic 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 onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic 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 hick-ups 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 hick-ups 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 (!isIEWithZoomingIssuesNearRoundedBorders && !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[], visibleStartLineNumber: number, hasMultipleSelections: boolean, visibleRanges: LineVisibleRangesWithStyle[]): void {\n\t\tconst visibleRangesHaveStyle = (visibleRanges.length > 0 && 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.length > 0 ? visibleRanges[0].lineNumber : 0);\n\t\tconst lastLineNumber = (visibleRanges.length > 0 ? visibleRanges[visibleRanges.length - 1].lineNumber : 0);\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 lineOutput = '';\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\tlineOutput += 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\tlineOutput += 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\tlineOutput += 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\tlineOutput += 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\tlineOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left, visibleRange.width);\n\t\t\t}\n\n\t\t\toutput2[lineIndex] += lineOutput;\n\t\t}\n\t}\n\n\tprivate _previousFrameVisibleRangesWithStyle: (LineVisibleRangesWithStyle[] | null)[] = [];\n\tpublic prepareRender(ctx: RenderingContext): void {\n\n\t\tconst output: 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;\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) {\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 * Copyright (c) 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 } 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);\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: '#999999', hc: '#999999' }, nls.localize('editorCodeLensForeground', 'Foreground color of editor code lenses'));\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: '#fff' }, 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.'));\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 editorErrorForeground = registerColor('editorError.foreground', { dark: '#ea4646', light: '#d60a0a', hc: null }, nls.localize('errorForeground', '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 squigglies in the editor.'));\n\nexport const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#4d9e4d', light: '#117711', hc: null }, nls.localize('warningForeground', 'Foreground color of warning squigglies in the editor.'));\nexport const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning squigglies in the editor.'));\n\nexport const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('infoForeground', 'Foreground color of info squigglies in the editor.'));\nexport const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info squigglies in the editor.'));\n\nexport const editorHintForeground = registerColor('editorHint.foreground', { dark: Color.fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hc: null }, nls.localize('hintForeground', '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 squigglies in the editor.'));\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.'));\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: new Color(new RGBA(18, 136, 18, 0.7)), light: new Color(new RGBA(18, 136, 18, 0.7)), hc: new Color(new RGBA(50, 255, 50, 1)) }, nls.localize('overviewRuleWarning', 'Overview ruler marker color for warnings.'));\nexport const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: new Color(new RGBA(18, 18, 136, 0.7)), light: new Color(new RGBA(18, 18, 136, 0.7)), hc: new Color(new RGBA(50, 50, 255, 1)) }, nls.localize('overviewRuleInfo', 'Overview ruler marker color for infos.'));\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 invisibles = theme.getColor(editorWhitespaces);\n\tif (invisibles) {\n\t\tcollector.addRule(`.vs-whitespace { 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/view/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class CurrentLineHighlightOverlay extends DynamicViewOverlay {\n\tprivate readonly _context: ViewContext;\n\tprivate _lineHeight: number;\n\tprivate _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';\n\tprivate _selectionIsEmpty: boolean;\n\tprivate _primaryCursorLineNumber: number;\n\tprivate _scrollWidth: number;\n\tprivate _contentWidth: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;\n\n\t\tthis._selectionIsEmpty = true;\n\t\tthis._primaryCursorLineNumber = 1;\n\t\tthis._scrollWidth = 0;\n\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tlet hasChanged = false;\n\n\t\tconst primaryCursorLineNumber = e.selections[0].positionLineNumber;\n\t\tif (this._primaryCursorLineNumber !== primaryCursorLineNumber) {\n\t\t\tthis._primaryCursorLineNumber = primaryCursorLineNumber;\n\t\t\thasChanged = true;\n\t\t}\n\n\t\tconst selectionIsEmpty = e.selections[0].isEmpty();\n\t\tif (this._selectionIsEmpty !== selectionIsEmpty) {\n\t\t\tthis._selectionIsEmpty = selectionIsEmpty;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn hasChanged;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollWidthChanged;\n\t}\n\tpublic 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\tthis._scrollWidth = ctx.scrollWidth;\n\t}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (lineNumber === this._primaryCursorLineNumber) {\n\t\t\tif (this._shouldShowCurrentLine()) {\n\t\t\t\tconst paintedInMargin = this._willRenderMarginCurrentLine();\n\t\t\t\tconst className = 'current-line' + (paintedInMargin ? ' current-line-both' : '');\n\t\t\t\treturn (\n\t\t\t\t\t'<div class=\"'\n\t\t\t\t\t+ className\n\t\t\t\t\t+ '\" style=\"width:'\n\t\t\t\t\t+ String(Math.max(this._scrollWidth, this._contentWidth))\n\t\t\t\t\t+ 'px; height:'\n\t\t\t\t\t+ String(this._lineHeight)\n\t\t\t\t\t+ 'px;\"></div>'\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t}\n\n\tprivate _shouldShowCurrentLine(): boolean {\n\t\treturn (\n\t\t\t(this._renderLineHighlight === 'line' || this._renderLineHighlight === 'all')\n\t\t\t&& this._selectionIsEmpty\n\t\t);\n\t}\n\n\tprivate _willRenderMarginCurrentLine(): boolean {\n\t\treturn (\n\t\t\t(this._renderLineHighlight === 'gutter' || this._renderLineHighlight === 'all')\n\t\t);\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}\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\tif (theme.type === 'hc') {\n\t\t\t\tcollector.addRule(`.monaco-editor .view-overlays .current-line { 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!./currentLineMarginHighlight';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common/view/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay {\n\tprivate readonly _context: ViewContext;\n\tprivate _lineHeight: number;\n\tprivate _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';\n\tprivate _selectionIsEmpty: boolean;\n\tprivate _primaryCursorLineNumber: number;\n\tprivate _contentLeft: number;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;\n\n\t\tthis._selectionIsEmpty = true;\n\t\tthis._primaryCursorLineNumber = 1;\n\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tlet hasChanged = false;\n\n\t\tconst primaryCursorLineNumber = e.selections[0].positionLineNumber;\n\t\tif (this._primaryCursorLineNumber !== primaryCursorLineNumber) {\n\t\t\tthis._primaryCursorLineNumber = primaryCursorLineNumber;\n\t\t\thasChanged = true;\n\t\t}\n\n\t\tconst selectionIsEmpty = e.selections[0].isEmpty();\n\t\tif (this._selectionIsEmpty !== selectionIsEmpty) {\n\t\t\tthis._selectionIsEmpty = selectionIsEmpty;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn hasChanged;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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}\n\n\tpublic render(startLineNumber: number, lineNumber: number): string {\n\t\tif (lineNumber === this._primaryCursorLineNumber) {\n\t\t\tlet className = 'current-line';\n\t\t\tif (this._shouldShowCurrentLine()) {\n\t\t\t\tconst paintedInContent = this._willRenderContentCurrentLine();\n\t\t\t\tclassName = 'current-line current-line-margin' + (paintedInContent ? ' current-line-margin-both' : '');\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t'<div class=\"'\n\t\t\t\t+ className\n\t\t\t\t+ '\" style=\"width:'\n\t\t\t\t+ String(this._contentLeft)\n\t\t\t\t+ 'px; height:'\n\t\t\t\t+ String(this._lineHeight)\n\t\t\t\t+ 'px;\"></div>'\n\t\t\t);\n\t\t}\n\t\treturn '';\n\t}\n\n\tprivate _shouldShowCurrentLine(): boolean {\n\t\treturn (\n\t\t\t(this._renderLineHighlight === 'gutter' || this._renderLineHighlight === 'all')\n\t\t);\n\t}\n\n\tprivate _willRenderContentCurrentLine(): boolean {\n\t\treturn (\n\t\t\t(this._renderLineHighlight === 'line' || this._renderLineHighlight === 'all')\n\t\t\t&& this._selectionIsEmpty\n\t\t);\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst lineHighlight = theme.getColor(editorLineHighlight);\n\tif (lineHighlight) {\n\t\tcollector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${lineHighlight}; border: none; }`);\n\t} else {\n\t\tconst lineHighlightBorder = theme.getColor(editorLineHighlightBorder);\n\t\tif (lineHighlightBorder) {\n\t\t\tcollector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${lineHighlightBorder}; }`);\n\t\t}\n\t\tif (theme.type === 'hc') {\n\t\t\tcollector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }`);\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 { Position } from 'vs/editor/common/core/position';\nimport { editorActiveIndentGuides, editorIndentGuides } from 'vs/editor/common/view/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class IndentGuidesOverlay extends DynamicViewOverlay {\n\n\tprivate readonly _context: ViewContext;\n\tprivate _primaryLineNumber: number;\n\tprivate _lineHeight: number;\n\tprivate _spaceWidth: number;\n\tprivate _renderResult: string[] | null;\n\tprivate _enabled: boolean;\n\tprivate _activeIndentEnabled: boolean;\n\n\tconstructor(context: ViewContext) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._primaryLineNumber = 0;\n\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\tthis._spaceWidth = this._context.configuration.editor.fontInfo.spaceWidth;\n\t\tthis._enabled = this._context.configuration.editor.viewInfo.renderIndentGuides;\n\t\tthis._activeIndentEnabled = this._context.configuration.editor.viewInfo.highlightActiveIndentGuide;\n\t\tthis._renderResult = null;\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tpublic 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = this._context.configuration.editor.lineHeight;\n\t\t}\n\t\tif (e.fontInfo) {\n\t\t\tthis._spaceWidth = this._context.configuration.editor.fontInfo.spaceWidth;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._enabled = this._context.configuration.editor.viewInfo.renderIndentGuides;\n\t\t\tthis._activeIndentEnabled = this._context.configuration.editor.viewInfo.highlightActiveIndentGuide;\n\t\t}\n\t\treturn true;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tconst selection = e.selections[0];\n\t\tconst newPrimaryLineNumber = selection.isEmpty() ? selection.positionLineNumber : 0;\n\n\t\tif (this._primaryLineNumber !== newPrimaryLineNumber) {\n\t\t\tthis._primaryLineNumber = newPrimaryLineNumber;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\tpublic onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations\n\t\treturn true;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;// || e.scrollWidthChanged;\n\t}\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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._enabled) {\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 { indentSize } = this._context.model.getOptions();\n\t\tconst indentWidth = indentSize * this._spaceWidth;\n\t\tconst scrollWidth = ctx.scrollWidth;\n\t\tconst lineHeight = this._lineHeight;\n\n\t\tconst indents = this._context.model.getLinesIndentGuides(visibleStartLineNumber, visibleEndLineNumber);\n\n\t\tlet activeIndentStartLineNumber = 0;\n\t\tlet activeIndentEndLineNumber = 0;\n\t\tlet activeIndentLevel = 0;\n\t\tif (this._activeIndentEnabled && this._primaryLineNumber) {\n\t\t\tconst activeIndentInfo = this._context.model.getActiveIndentGuide(this._primaryLineNumber, 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 output: string[] = [];\n\t\tfor (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {\n\t\t\tconst containsActiveIndentGuide = (activeIndentStartLineNumber <= lineNumber && lineNumber <= activeIndentEndLineNumber);\n\t\t\tconst lineIndex = lineNumber - visibleStartLineNumber;\n\t\t\tconst indent = indents[lineIndex];\n\n\t\t\tlet result = '';\n\t\t\tconst leftMostVisiblePosition = ctx.visibleRangeForPosition(new Position(lineNumber, 1));\n\t\t\tlet left = leftMostVisiblePosition ? leftMostVisiblePosition.left : 0;\n\t\t\tfor (let i = 1; i <= indent; i++) {\n\t\t\t\tconst className = (containsActiveIndentGuide && i === activeIndentLevel ? 'cigra' : 'cigr');\n\t\t\t\tresult += `<div class=\"${className}\" style=\"left:${left}px;height:${lineHeight}px;width:${indentWidth}px\"></div>`;\n\t\t\t\tleft += indentWidth;\n\t\t\t\tif (left > scrollWidth) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toutput[lineIndex] = result;\n\t\t}\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\nregisterThemingParticipant((theme, collector) => {\n\tconst editorIndentGuidesColor = theme.getColor(editorIndentGuides);\n\tif (editorIndentGuidesColor) {\n\t\tcollector.addRule(`.monaco-editor .lines-content .cigr { 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 .cigra { box-shadow: 1px 0 0 0 ${editorActiveIndentGuidesColor} 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!./lineNumbers';\nimport * as platform from 'vs/base/common/platform';\nimport { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';\nimport { RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { editorActiveLineNumber, editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';\nimport { RenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/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\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._context.addEventHandler(this);\n\t}\n\n\tprivate _readConfig(): void {\n\t\tconst config = this._context.configuration.editor;\n\t\tthis._lineHeight = config.lineHeight;\n\t\tthis._renderLineNumbers = config.viewInfo.renderLineNumbers;\n\t\tthis._renderCustomLineNumbers = config.viewInfo.renderCustomLineNumbers;\n\t\tthis._renderFinalNewline = config.viewInfo.renderFinalNewline;\n\t\tthis._lineNumbersLeft = config.layoutInfo.lineNumbersLeft;\n\t\tthis._lineNumbersWidth = config.layoutInfo.lineNumbersWidth;\n\t}\n\n\tpublic 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tthis._readConfig();\n\t\treturn true;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tconst primaryViewPosition = e.selections[0].getPosition();\n\t\tthis._lastCursorModelPosition = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(primaryViewPosition);\n\n\t\tif (this._renderLineNumbers === RenderLineNumbersType.Relative || this._renderLineNumbers === RenderLineNumbersType.Interval) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollTopChanged;\n\t}\n\tpublic 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.model.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._renderFinalNewline) {\n\t\t\tconst lineCount = this._context.model.getLineCount();\n\t\t\tconst lineContent = this._context.model.getLineContent(modelLineNumber);\n\n\t\t\tif (modelLineNumber === lineCount && lineContent === '') {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}\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.toString() + 'px;width:' + this._lineNumbersWidth.toString() + 'px;\">';\n\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\tconst renderLineNumber = this._getLineRenderLineNumber(lineNumber);\n\n\t\t\tif (renderLineNumber) {\n\t\t\t\toutput[lineIndex] = (\n\t\t\t\t\tcommon\n\t\t\t\t\t+ renderLineNumber\n\t\t\t\t\t+ '</div>'\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 .current-line ~ .line-numbers { 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 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 { Configuration } from 'vs/editor/browser/config/configuration';\nimport { CopyOptions, ICompositionData, IPasteData, ITextAreaInputHost, TextAreaInput } from 'vs/editor/browser/controller/textAreaInput';\nimport { ISimpleModel, ITypeData, PagedScreenReaderStrategy, TextAreaState } 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 } from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo } from 'vs/editor/common/config/fontInfo';\nimport { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/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 { HorizontalRange, RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\n\nexport interface ITextAreaHandlerHelper {\n\tvisibleRangeForPositionRelativeToEditor(lineNumber: number, column: number): HorizontalRange | null;\n}\n\nclass VisibleTextAreaData {\n\t_visibleTextAreaBrand: void;\n\n\tpublic readonly top: number;\n\tpublic readonly left: number;\n\tpublic readonly width: number;\n\n\tconstructor(top: number, left: number, width: number) {\n\t\tthis.top = top;\n\t\tthis.left = left;\n\t\tthis.width = width;\n\t}\n\n\tpublic setWidth(width: number): VisibleTextAreaData {\n\t\treturn new VisibleTextAreaData(this.top, this.left, width);\n\t}\n}\n\nconst canUseZeroSizeTextarea = (browser.isEdgeOrIE || browser.isFirefox);\n\ninterface LocalClipboardMetadata {\n\tlastCopiedValue: string;\n\tisFromEmptySelection: boolean;\n\tmulticursorText: string[] | null;\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 */\nclass LocalClipboardMetadataManager {\n\tpublic static INSTANCE = new LocalClipboardMetadataManager();\n\n\tprivate _lastState: LocalClipboardMetadata | null;\n\n\tconstructor() {\n\t\tthis._lastState = null;\n\t}\n\n\tpublic set(state: LocalClipboardMetadata | null): void {\n\t\tthis._lastState = state;\n\t}\n\n\tpublic get(pastedText: string): LocalClipboardMetadata | null {\n\t\tif (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n\t\t\t// match!\n\t\t\treturn this._lastState;\n\t\t}\n\t\tthis._lastState = null;\n\t\treturn null;\n\t}\n}\n\nexport class TextAreaHandler extends ViewPart {\n\n\tprivate readonly _viewController: ViewController;\n\tprivate readonly _viewHelper: ITextAreaHandlerHelper;\n\tprivate _accessibilitySupport: AccessibilitySupport;\n\tprivate _contentLeft: number;\n\tprivate _contentWidth: number;\n\tprivate _contentHeight: number;\n\tprivate _scrollLeft: number;\n\tprivate _scrollTop: 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\n\tpublic readonly textArea: FastDomNode<HTMLTextAreaElement>;\n\tpublic readonly textAreaCover: FastDomNode<HTMLElement>;\n\tprivate readonly _textAreaInput: TextAreaInput;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: ITextAreaHandlerHelper) {\n\t\tsuper(context);\n\n\t\tthis._viewController = viewController;\n\t\tthis._viewHelper = viewHelper;\n\n\t\tconst conf = this._context.configuration.editor;\n\n\t\tthis._accessibilitySupport = conf.accessibilitySupport;\n\t\tthis._contentLeft = conf.layoutInfo.contentLeft;\n\t\tthis._contentWidth = conf.layoutInfo.contentWidth;\n\t\tthis._contentHeight = conf.layoutInfo.contentHeight;\n\t\tthis._scrollLeft = 0;\n\t\tthis._scrollTop = 0;\n\t\tthis._fontInfo = conf.fontInfo;\n\t\tthis._lineHeight = conf.lineHeight;\n\t\tthis._emptySelectionClipboard = conf.emptySelectionClipboard;\n\t\tthis._copyWithSyntaxHighlighting = conf.copyWithSyntaxHighlighting;\n\n\t\tthis._visibleTextArea = null;\n\t\tthis._selections = [new Selection(1, 1, 1, 1)];\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');\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', conf.viewInfo.ariaLabel);\n\t\tthis.textArea.setAttribute('role', 'textbox');\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\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.model.getLineCount();\n\t\t\t},\n\t\t\tgetLineMaxColumn: (lineNumber: number): number => {\n\t\t\t\treturn this._context.model.getLineMaxColumn(lineNumber);\n\t\t\t},\n\t\t\tgetValueInRange: (range: Range, eol: EndOfLinePreference): string => {\n\t\t\t\treturn this._context.model.getValueInRange(range, eol);\n\t\t\t}\n\t\t};\n\n\t\tconst textAreaInputHost: ITextAreaInputHost = {\n\t\t\tgetPlainTextToCopy: (): string => {\n\t\t\t\tconst rawWhatToCopy = this._context.model.getPlainTextToCopy(this._selections, this._emptySelectionClipboard, platform.isWindows);\n\t\t\t\tconst newLineCharacter = this._context.model.getEOL();\n\n\t\t\t\tconst isFromEmptySelection = (this._emptySelectionClipboard && this._selections.length === 1 && this._selections[0].isEmpty());\n\t\t\t\tconst multicursorText = (Array.isArray(rawWhatToCopy) ? rawWhatToCopy : null);\n\t\t\t\tconst whatToCopy = (Array.isArray(rawWhatToCopy) ? rawWhatToCopy.join(newLineCharacter) : rawWhatToCopy);\n\n\t\t\t\tlet metadata: LocalClipboardMetadata | null = null;\n\t\t\t\tif (isFromEmptySelection || multicursorText) {\n\t\t\t\t\t// Only store the non-default metadata\n\n\t\t\t\t\t// When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n\t\t\t\t\t// Firefox pastes \"LINE\\n\", so let's work around this quirk\n\t\t\t\t\tconst lastCopiedValue = (browser.isFirefox ? whatToCopy.replace(/\\r\\n/g, '\\n') : whatToCopy);\n\t\t\t\t\tmetadata = {\n\t\t\t\t\t\tlastCopiedValue: lastCopiedValue,\n\t\t\t\t\t\tisFromEmptySelection: (this._emptySelectionClipboard && this._selections.length === 1 && this._selections[0].isEmpty()),\n\t\t\t\t\t\tmulticursorText: multicursorText\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tLocalClipboardMetadataManager.INSTANCE.set(metadata);\n\n\t\t\t\treturn whatToCopy;\n\t\t\t},\n\n\t\t\tgetHTMLToCopy: (): string | null => {\n\t\t\t\tif (!this._copyWithSyntaxHighlighting && !CopyOptions.forceCopyWithSyntaxHighlighting) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn this._context.model.getHTMLToCopy(this._selections, this._emptySelectionClipboard);\n\t\t\t},\n\n\t\t\tgetScreenReaderContent: (currentState: TextAreaState): TextAreaState => {\n\n\t\t\t\tif (browser.isIPad) {\n\t\t\t\t\t// Do not place anything in the textarea for the iPad\n\t\t\t\t\treturn TextAreaState.EMPTY;\n\t\t\t\t}\n\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\treturn PagedScreenReaderStrategy.fromEditorSelection(currentState, simpleModel, this._selections[0], 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.model.deduceModelPositionRelativeToViewPosition(viewAnchorPosition, deltaOffset, lineFeedCnt);\n\t\t\t}\n\t\t};\n\n\t\tthis._textAreaInput = this._register(new TextAreaInput(textAreaInputHost, this.textArea));\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\tconst metadata = LocalClipboardMetadataManager.INSTANCE.get(e.text);\n\n\t\t\tlet pasteOnNewLine = false;\n\t\t\tlet multicursorText: string[] | null = null;\n\t\t\tif (metadata) {\n\t\t\t\tpasteOnNewLine = (this._emptySelectionClipboard && metadata.isFromEmptySelection);\n\t\t\t\tmulticursorText = metadata.multicursorText;\n\t\t\t}\n\t\t\tthis._viewController.paste('keyboard', e.text, pasteOnNewLine, multicursorText);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCut(() => {\n\t\t\tthis._viewController.cut('keyboard');\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onType((e: ITypeData) => {\n\t\t\tif (e.replaceCharCnt) {\n\t\t\t\tthis._viewController.replacePreviousChar('keyboard', e.text, e.replaceCharCnt);\n\t\t\t} else {\n\t\t\t\tthis._viewController.type('keyboard', 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('keyboard', modelSelection);\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCompositionStart(() => {\n\t\t\tconst lineNumber = this._selections[0].startLineNumber;\n\t\t\tconst column = this._selections[0].startColumn;\n\n\t\t\tthis._context.privateViewEventBus.emit(new viewEvents.ViewRevealRangeRequestEvent(\n\t\t\t\tnew Range(lineNumber, column, lineNumber, column),\n\t\t\t\tviewEvents.VerticalRevealType.Simple,\n\t\t\t\ttrue,\n\t\t\t\tScrollType.Immediate\n\t\t\t));\n\n\t\t\t// Find range pixel position\n\t\t\tconst visibleRange = this._viewHelper.visibleRangeForPositionRelativeToEditor(lineNumber, column);\n\n\t\t\tif (visibleRange) {\n\t\t\t\tthis._visibleTextArea = new VisibleTextAreaData(\n\t\t\t\t\tthis._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber),\n\t\t\t\t\tvisibleRange.left,\n\t\t\t\t\tcanUseZeroSizeTextarea ? 0 : 1\n\t\t\t\t);\n\t\t\t\tthis._render();\n\t\t\t}\n\n\t\t\t// Show the textarea\n\t\t\tthis.textArea.setClassName('inputarea ime-input');\n\n\t\t\tthis._viewController.compositionStart('keyboard');\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onCompositionUpdate((e: ICompositionData) => {\n\t\t\tif (browser.isEdgeOrIE) {\n\t\t\t\t// Due to isEdgeOrIE (where the textarea was not cleared initially)\n\t\t\t\t// we cannot assume the text consists only of the composited text\n\t\t\t\tthis._visibleTextArea = this._visibleTextArea!.setWidth(0);\n\t\t\t} else {\n\t\t\t\t// adjust width by its size\n\t\t\t\tthis._visibleTextArea = this._visibleTextArea!.setWidth(measureText(e.data, this._fontInfo));\n\t\t\t}\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');\n\t\t\tthis._viewController.compositionEnd('keyboard');\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onFocus(() => {\n\t\t\tthis._context.privateViewEventBus.emit(new viewEvents.ViewFocusChangedEvent(true));\n\t\t}));\n\n\t\tthis._register(this._textAreaInput.onBlur(() => {\n\t\t\tthis._context.privateViewEventBus.emit(new viewEvents.ViewFocusChangedEvent(false));\n\t\t}));\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tprivate _getWordBeforePosition(position: Position): string {\n\t\tconst lineContent = this._context.model.getLineContent(position.lineNumber);\n\t\tconst wordSeparators = getMapForWordSeparators(this._context.configuration.editor.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.model.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\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst conf = this._context.configuration.editor;\n\n\t\tif (e.fontInfo) {\n\t\t\tthis._fontInfo = conf.fontInfo;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis.textArea.setAttribute('aria-label', conf.viewInfo.ariaLabel);\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._contentLeft = conf.layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = conf.layoutInfo.contentWidth;\n\t\t\tthis._contentHeight = conf.layoutInfo.contentHeight;\n\t\t}\n\t\tif (e.lineHeight) {\n\t\t\tthis._lineHeight = conf.lineHeight;\n\t\t}\n\t\tif (e.accessibilitySupport) {\n\t\t\tthis._accessibilitySupport = conf.accessibilitySupport;\n\t\t\tthis._textAreaInput.writeScreenReaderContent('strategy changed');\n\t\t}\n\t\tif (e.emptySelectionClipboard) {\n\t\t\tthis._emptySelectionClipboard = conf.emptySelectionClipboard;\n\t\t}\n\t\tif (e.copyWithSyntaxHighlighting) {\n\t\t\tthis._copyWithSyntaxHighlighting = conf.copyWithSyntaxHighlighting;\n\t\t}\n\n\t\treturn true;\n\t}\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._selections = e.selections.slice(0);\n\t\tthis._textAreaInput.writeScreenReaderContent('selection changed');\n\t\treturn true;\n\t}\n\tpublic 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 onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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 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\t// --- end view API\n\n\tprivate _primaryCursorVisibleRange: HorizontalRange | null = null;\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tif (this._accessibilitySupport === AccessibilitySupport.Enabled) {\n\t\t\t// Do not move the textarea with the cursor, as this generates accessibility events that might confuse screen readers\n\t\t\t// See https://github.com/Microsoft/vscode/issues/26730\n\t\t\tthis._primaryCursorVisibleRange = null;\n\t\t} else {\n\t\t\tconst primaryCursorPosition = new Position(this._selections[0].positionLineNumber, this._selections[0].positionColumn);\n\t\t\tthis._primaryCursorVisibleRange = ctx.visibleRangeForPosition(primaryCursorPosition);\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\t\t\tthis._renderInsideEditor(\n\t\t\t\tthis._visibleTextArea.top - this._scrollTop,\n\t\t\t\tthis._contentLeft + this._visibleTextArea.left - this._scrollLeft,\n\t\t\t\tthis._visibleTextArea.width,\n\t\t\t\tthis._lineHeight,\n\t\t\t\ttrue\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\t\tthis._renderInsideEditor(\n\t\t\ttop, left,\n\t\t\tcanUseZeroSizeTextarea ? 0 : 1, canUseZeroSizeTextarea ? 0 : 1,\n\t\t\tfalse\n\t\t);\n\t}\n\n\tprivate _renderInsideEditor(top: number, left: number, width: number, height: number, useEditorFont: boolean): void {\n\t\tconst ta = this.textArea;\n\t\tconst tac = this.textAreaCover;\n\n\t\tif (useEditorFont) {\n\t\t\tConfiguration.applyFontInfo(ta, this._fontInfo);\n\t\t} else {\n\t\t\tta.setFontSize(1);\n\t\t\tta.setLineHeight(this._fontInfo.lineHeight);\n\t\t}\n\n\t\tta.setTop(top);\n\t\tta.setLeft(left);\n\t\tta.setWidth(width);\n\t\tta.setHeight(height);\n\n\t\ttac.setTop(0);\n\t\ttac.setLeft(0);\n\t\ttac.setWidth(0);\n\t\ttac.setHeight(0);\n\t}\n\n\tprivate _renderAtTopLeft(): void {\n\t\tconst ta = this.textArea;\n\t\tconst tac = this.textAreaCover;\n\n\t\tConfiguration.applyFontInfo(ta, this._fontInfo);\n\t\tta.setTop(0);\n\t\tta.setLeft(0);\n\t\ttac.setTop(0);\n\t\ttac.setLeft(0);\n\n\t\tif (canUseZeroSizeTextarea) {\n\t\t\tta.setWidth(0);\n\t\t\tta.setHeight(0);\n\t\t\ttac.setWidth(0);\n\t\t\ttac.setHeight(0);\n\t\t\treturn;\n\t\t}\n\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\n\t\tta.setWidth(1);\n\t\tta.setHeight(1);\n\t\ttac.setWidth(1);\n\t\ttac.setHeight(1);\n\n\t\tif (this._context.configuration.editor.viewInfo.glyphMargin) {\n\t\t\ttac.setClassName('monaco-editor-background textAreaCover ' + Margin.OUTER_CLASS_NAME);\n\t\t} else {\n\t\t\tif (this._context.configuration.editor.viewInfo.renderLineNumbers !== 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\nfunction measureText(text: string, fontInfo: BareFontInfo): number {\n\t// adjust width by its size\n\tconst canvasElem = <HTMLCanvasElement>document.createElement('canvas');\n\tconst context = canvasElem.getContext('2d')!;\n\tcontext.font = createFontString(fontInfo);\n\tconst metrics = context.measureText(text);\n\n\tif (browser.isFirefox) {\n\t\treturn metrics.width + 2; // +2 for Japanese...\n\t} else {\n\t\treturn metrics.width;\n\t}\n}\n\nfunction createFontString(bareFontInfo: BareFontInfo): string {\n\treturn doCreateFontString('normal', bareFontInfo.fontWeight, bareFontInfo.fontSize, bareFontInfo.lineHeight, bareFontInfo.fontFamily);\n}\n\nfunction doCreateFontString(fontStyle: string, fontWeight: string, fontSize: number, lineHeight: number, fontFamily: string): string {\n\t// The full font syntax is:\n\t// style | variant | weight | stretch | size/line-height | fontFamily\n\t// (https://developer.mozilla.org/en-US/docs/Web/CSS/font)\n\t// But it appears Edge and IE11 cannot properly parse `stretch`.\n\treturn `${fontStyle} normal ${fontWeight} ${fontSize}px / ${lineHeight}px ${fontFamily}`;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IConfiguration } from 'vs/editor/common/editorCommon';\nimport { TokenizationRegistry } from 'vs/editor/common/modes';\nimport { editorCursorForeground, editorOverviewRulerBorder } from 'vs/editor/common/view/editorColorRegistry';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ITheme } from 'vs/platform/theme/common/themeService';\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: IConfiguration, theme: ITheme) {\n\t\tthis.lineHeight = config.editor.lineHeight;\n\t\tthis.pixelRatio = config.editor.pixelRatio;\n\t\tthis.overviewRulerLanes = config.editor.viewInfo.overviewRulerLanes;\n\n\t\tthis.renderBorder = config.editor.viewInfo.overviewRulerBorder;\n\t\tconst borderColor = theme.getColor(editorOverviewRulerBorder);\n\t\tthis.borderColor = borderColor ? borderColor.toString() : null;\n\n\t\tthis.hideCursor = config.editor.viewInfo.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 minimapEnabled = config.editor.viewInfo.minimap.enabled;\n\t\tconst minimapSide = config.editor.viewInfo.minimap.side;\n\t\tconst backgroundColor = (minimapEnabled ? TokenizationRegistry.getDefaultBackground() : null);\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 position = config.editor.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\tthis.canvasWidth = (this.domWidth * this.pixelRatio) | 0;\n\t\tthis.canvasHeight = (this.domHeight * this.pixelRatio) | 0;\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.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 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 onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\treturn this._updateSettings(false);\n\t}\n\tpublic 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 onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn e.scrollHeightChanged;\n\t}\n\tpublic onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\t// invalidate color cache\n\t\tthis._context.model.invalidateOverviewRulerColorCache();\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\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.model.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\t\t// Avoid flickering by always rendering the colors in the same order\n\t\t// colors that don't use transparency will be sorted last (they start with #)\n\t\tconst colors = Object.keys(decorations);\n\t\tcolors.sort();\n\t\tfor (let cIndex = 0, cLen = colors.length; cIndex < cLen; cIndex++) {\n\t\t\tconst color = colors[cIndex];\n\n\t\t\tconst colorDecorations = decorations[color];\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 = colorDecorations.length; i < len; i++) {\n\t\t\t\tconst lane = colorDecorations[3 * i];\n\t\t\t\tconst startLineNumber = colorDecorations[3 * i + 1];\n\t\t\t\tconst endLineNumber = colorDecorations[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/view/editorColorRegistry';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class Rulers extends ViewPart {\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tprivate readonly _renderedRulers: FastDomNode<HTMLElement>[];\n\tprivate _rulers: number[];\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\tthis._rulers = this._context.configuration.editor.viewInfo.rulers;\n\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.viewInfo || e.layoutInfo || e.fontInfo) {\n\t\t\tthis._rulers = this._context.configuration.editor.viewInfo.rulers;\n\t\t\tthis._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic 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.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\n\t\t\tnode.setHeight(Math.min(ctx.scrollHeight, 1000000));\n\t\t\tnode.setLeft(this._rulers[i] * 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 } from 'vs/editor/common/config/editorOptions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { editorCursorBackground, editorCursorForeground } from 'vs/editor/common/view/editorColorRegistry';\nimport { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nexport class ViewCursors extends ViewPart {\n\n\tstatic 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\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\tthis._readOnly = this._context.configuration.editor.readOnly;\n\t\tthis._cursorBlinking = this._context.configuration.editor.viewInfo.cursorBlinking;\n\t\tthis._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;\n\t\tthis._cursorSmoothCaretAnimation = this._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation;\n\t\tthis._selectionIsEmpty = true;\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 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\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\n\t\tif (e.readOnly) {\n\t\t\tthis._readOnly = this._context.configuration.editor.readOnly;\n\t\t}\n\t\tif (e.viewInfo) {\n\t\t\tthis._cursorBlinking = this._context.configuration.editor.viewInfo.cursorBlinking;\n\t\t\tthis._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;\n\t\t\tthis._cursorSmoothCaretAnimation = this._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation;\n\t\t}\n\n\t\tthis._primaryCursor.onConfigurationChanged(e);\n\t\tthis._updateBlinking();\n\t\tif (e.viewInfo) {\n\t\t\tthis._updateDomClassName();\n\t\t}\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 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 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 onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis._editorHasFocus = e.isFocused;\n\t\tthis._updateBlinking();\n\t\treturn false;\n\t}\n\tpublic onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic 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 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._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\tlet renderData: IViewCursorRenderData[] = [], 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 .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 * as dom from 'vs/base/browser/dom';\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 { ITextAreaHandlerHelper, TextAreaHandler } from 'vs/editor/browser/controller/textAreaHandler';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { ICommandDelegate, ViewController } from 'vs/editor/browser/view/viewController';\nimport { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents';\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 } from 'vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight';\nimport { CurrentLineMarginHighlightOverlay } from 'vs/editor/browser/viewParts/currentLineMarginHighlight/currentLineMarginHighlight';\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 { Cursor } from 'vs/editor/common/controller/cursor';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IConfiguration } from 'vs/editor/common/editorCommon';\nimport { RenderingContext } from 'vs/editor/common/view/renderingContext';\nimport { ViewContext } from 'vs/editor/common/view/viewContext';\nimport { ViewEventDispatcher } from 'vs/editor/common/view/viewEventDispatcher';\nimport * as viewEvents from 'vs/editor/common/view/viewEvents';\nimport { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';\nimport { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler';\nimport { IViewModel } from 'vs/editor/common/viewModel/viewModel';\nimport { IThemeService, getThemeTypeSelector } from 'vs/platform/theme/common/themeService';\n\nexport interface IContentWidgetData {\n\twidget: editorBrowser.IContentWidget;\n\tposition: editorBrowser.IContentWidgetPosition | null;\n}\n\nexport interface IOverlayWidgetData {\n\twidget: editorBrowser.IOverlayWidget;\n\tposition: editorBrowser.IOverlayWidgetPosition | null;\n}\n\nconst invalidFunc = () => { throw new Error(`Invalid change accessor`); };\n\nexport class View extends ViewEventHandler {\n\n\tprivate readonly eventDispatcher: ViewEventDispatcher;\n\n\tprivate _scrollbar: EditorScrollbar;\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _cursor: Cursor;\n\n\t// The view lines\n\tprivate 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 viewZones: ViewZones;\n\tprivate contentWidgets: ViewContentWidgets;\n\tprivate overlayWidgets: ViewOverlayWidgets;\n\tprivate viewCursors: ViewCursors;\n\tprivate viewParts: ViewPart[];\n\n\tprivate readonly _textAreaHandler: TextAreaHandler;\n\tprivate readonly pointerHandler: PointerHandler;\n\n\tprivate readonly outgoingEvents: ViewOutgoingEvents;\n\n\t// Dom nodes\n\tprivate linesContent: FastDomNode<HTMLElement>;\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tprivate overflowGuardContainer: FastDomNode<HTMLElement>;\n\n\t// Actual mutable state\n\tprivate _renderAnimationFrame: IDisposable | null;\n\n\tconstructor(\n\t\tcommandDelegate: ICommandDelegate,\n\t\tconfiguration: IConfiguration,\n\t\tthemeService: IThemeService,\n\t\tmodel: IViewModel,\n\t\tcursor: Cursor,\n\t\toutgoingEvents: ViewOutgoingEvents\n\t) {\n\t\tsuper();\n\t\tthis._cursor = cursor;\n\t\tthis._renderAnimationFrame = null;\n\t\tthis.outgoingEvents = outgoingEvents;\n\n\t\tconst viewController = new ViewController(configuration, model, this.outgoingEvents, commandDelegate);\n\n\t\t// The event dispatcher will always go through _renderOnce before dispatching any events\n\t\tthis.eventDispatcher = new ViewEventDispatcher((callback: () => void) => this._renderOnce(callback));\n\n\t\t// Ensure the view is the first event handler in order to update the layout\n\t\tthis.eventDispatcher.addEventHandler(this);\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, themeService.getTheme(), model, this.eventDispatcher);\n\n\t\tthis._register(themeService.onThemeChange(theme => {\n\t\t\tthis._context.theme = theme;\n\t\t\tthis.eventDispatcher.emit(new viewEvents.ViewThemeChangedEvent());\n\t\t\tthis.render(true, false);\n\t\t}));\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\tthis.createViewParts();\n\t\tthis._setLayout();\n\n\t\t// Pointer handler\n\t\tthis.pointerHandler = new PointerHandler(this._context, viewController, this.createPointerHandlerHelper());\n\n\t\tthis._register(model.addEventListener((events: viewEvents.ViewEvent[]) => {\n\t\t\tthis.eventDispatcher.emitMany(events);\n\t\t}));\n\n\t\tthis._register(this._cursor.addEventListener((events: viewEvents.ViewEvent[]) => {\n\t\t\tthis.eventDispatcher.emitMany(events);\n\t\t}));\n\t}\n\n\tprivate createViewParts(): void {\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\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\t\tthis.domNode.appendChild(this.contentWidgets.overflowingContentWidgetsDomNode);\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\tgetLastViewCursorsRenderData: () => {\n\t\t\t\treturn this.viewCursors.getLastRenderData() || [];\n\t\t\t},\n\t\t\tshouldSuppressMouseDownOnViewZone: (viewZoneId: number) => {\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\tvisibleRangeForPosition2: (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(): ITextAreaHandlerHelper {\n\t\treturn {\n\t\t\tvisibleRangeForPositionRelativeToEditor: (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\t\t};\n\t}\n\n\tprivate _setLayout(): void {\n\t\tconst layoutInfo = this._context.configuration.editor.layoutInfo;\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\n\t}\n\n\tprivate getEditorClassName() {\n\t\tconst focused = this._textAreaHandler.isFocused() ? ' focused' : '';\n\t\treturn this._context.configuration.editor.editorClassName + ' ' + getThemeTypeSelector(this._context.theme.type) + focused;\n\t}\n\n\t// --- begin event handlers\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.editorClassName) {\n\t\t\tthis.domNode.setClassName(this.getEditorClassName());\n\t\t}\n\t\tif (e.layoutInfo) {\n\t\t\tthis._setLayout();\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\tthis.domNode.setClassName(this.getEditorClassName());\n\t\tthis._context.model.setHasFocus(e.isFocused);\n\t\tif (e.isFocused) {\n\t\t\tthis.outgoingEvents.emitViewFocusGained();\n\t\t} else {\n\t\t\tthis.outgoingEvents.emitViewFocusLost();\n\t\t}\n\t\treturn false;\n\t}\n\tpublic onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\tthis.outgoingEvents.emitScrollChanged(e);\n\t\treturn false;\n\t}\n\tpublic onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {\n\t\tthis.domNode.setClassName(this.getEditorClassName());\n\t\treturn false;\n\t}\n\n\t// --- end event handlers\n\n\tpublic 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.eventDispatcher.removeEventHandler(this);\n\t\tthis.outgoingEvents.dispose();\n\n\t\tthis.pointerHandler.dispose();\n\n\t\tthis.viewLines.dispose();\n\n\t\t// Destroy view parts\n\t\tfor (let i = 0, len = this.viewParts.length; i < len; i++) {\n\t\t\tthis.viewParts[i].dispose();\n\t\t}\n\t\tthis.viewParts = [];\n\n\t\tsuper.dispose();\n\t}\n\n\tprivate _renderOnce(callback: () => any): any {\n\t\tconst r = safeInvokeNoArg(callback);\n\t\tthis._scheduleRender();\n\t\treturn r;\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\tlet result: ViewPart[] = [], resultLen = 0;\n\t\tfor (let i = 0, len = this.viewParts.length; i < len; i++) {\n\t\t\tconst viewPart = this.viewParts[i];\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.model.setViewport(partialViewportData.startLineNumber, partialViewportData.endLineNumber, partialViewportData.centeredLineNumber);\n\n\t\tconst viewportData = new ViewportData(\n\t\t\tthis._cursor.getViewSelections(),\n\t\t\tpartialViewportData,\n\t\t\tthis._context.viewLayout.getWhitespaceViewportData(),\n\t\t\tthis._context.model\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 (let i = 0, len = viewPartsToRender.length; i < len; i++) {\n\t\t\tconst viewPart = viewPartsToRender[i];\n\t\t\tviewPart.prepareRender(renderingContext);\n\t\t}\n\n\t\tfor (let i = 0, len = viewPartsToRender.length; i < len; i++) {\n\t\t\tconst viewPart = viewPartsToRender[i];\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.viewLayout.setScrollPositionNow({ scrollTop: scrollPosition.scrollTop });\n\t\tthis._context.model.tokenizeViewport();\n\t\tthis._renderNow();\n\t\tthis.viewLines.updateLineWidths();\n\t\tthis._context.viewLayout.setScrollPositionNow({ scrollLeft: scrollPosition.scrollLeft });\n\t}\n\n\tpublic getOffsetForColumn(modelLineNumber: number, modelColumn: number): number {\n\t\tconst modelPosition = this._context.model.validateModelPosition({\n\t\t\tlineNumber: modelLineNumber,\n\t\t\tcolumn: modelColumn\n\t\t});\n\t\tconst viewPosition = this._context.model.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): editorBrowser.IMouseTarget | null {\n\t\treturn this.pointerHandler.getTargetAtClientPoint(clientX, clientY);\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: editorBrowser.IViewZoneChangeAccessor) => any): boolean {\n\t\tlet zonesHaveChanged = false;\n\n\t\tthis._renderOnce(() => {\n\t\t\tconst changeAccessor: editorBrowser.IViewZoneChangeAccessor = {\n\t\t\t\taddZone: (zone: editorBrowser.IViewZone): number => {\n\t\t\t\t\tzonesHaveChanged = true;\n\t\t\t\t\treturn this.viewZones.addZone(zone);\n\t\t\t\t},\n\t\t\t\tremoveZone: (id: number): 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.viewZones.removeZone(id) || zonesHaveChanged;\n\t\t\t\t},\n\t\t\t\tlayoutZone: (id: number): 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.viewZones.layoutZone(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\n\t\t\tif (zonesHaveChanged) {\n\t\t\t\tthis._context.viewLayout.onHeightMaybeChanged();\n\t\t\t\tthis._context.privateViewEventBus.emit(new viewEvents.ViewZonesChangedEvent());\n\t\t\t}\n\t\t});\n\t\treturn zonesHaveChanged;\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 (let i = 0, len = this.viewParts.length; i < len; i++) {\n\t\t\t\tconst viewPart = this.viewParts[i];\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 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\tconst newPosition = widgetData.position ? widgetData.position.position : null;\n\t\tconst newRange = widgetData.position ? widgetData.position.range : null;\n\t\tconst newPreference = widgetData.position ? widgetData.position.preference : null;\n\t\tthis.contentWidgets.setWidgetPosition(widgetData.widget, newPosition, 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\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 'vs/css!./media/editor';\nimport 'vs/css!./media/tokens';\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 { Configuration } from 'vs/editor/browser/config/configuration';\nimport { CoreEditorCommand } from 'vs/editor/browser/controller/coreCommands';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { EditorExtensionsRegistry, IEditorContributionCtor } 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/viewImpl';\nimport { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents';\nimport * as editorOptions from 'vs/editor/common/config/editorOptions';\nimport { Cursor, CursorStateChangedEvent } from 'vs/editor/common/controller/cursor';\nimport { CursorColumns, ICursors } from 'vs/editor/common/controller/cursorCommon';\nimport { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/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 } from 'vs/editor/common/model';\nimport { ClassName } from 'vs/editor/common/model/intervalTree';\nimport { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/model/textModelEvents';\nimport * as modes from 'vs/editor/common/modes';\nimport { editorErrorBorder, editorErrorForeground, editorHintBorder, editorHintForeground, editorInfoBorder, editorInfoForeground, editorUnnecessaryCodeBorder, editorUnnecessaryCodeOpacity, editorWarningBorder, editorWarningForeground } from 'vs/editor/common/view/editorColorRegistry';\nimport { VerticalRevealType } from 'vs/editor/common/view/viewEvents';\nimport { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer';\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';\n\nlet EDITOR_ID = 0;\n\nconst SHOW_UNUSED_ENABLED_CLASS = 'showUnused';\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?: IEditorContributionCtor[];\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 cursor: Cursor;\n\tpublic readonly view: View;\n\tpublic readonly hasRealView: boolean;\n\tpublic readonly listenersToRemove: IDisposable[];\n\n\tconstructor(model: ITextModel, viewModel: ViewModel, cursor: Cursor, view: View, hasRealView: boolean, listenersToRemove: IDisposable[]) {\n\t\tthis.model = model;\n\t\tthis.viewModel = viewModel;\n\t\tthis.cursor = cursor;\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.cursor.dispose();\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<editorOptions.IConfigurationChangedEvent> = this._register(new Emitter<editorOptions.IConfigurationChangedEvent>());\n\tpublic readonly onDidChangeConfiguration: Event<editorOptions.IConfigurationChangedEvent> = 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<editorOptions.EditorLayoutInfo> = this._register(new Emitter<editorOptions.EditorLayoutInfo>());\n\tpublic readonly onDidLayoutChange: Event<editorOptions.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 _onCompositionStart: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onCompositionStart = this._onCompositionStart.event;\n\n\tprivate readonly _onCompositionEnd: Emitter<void> = this._register(new Emitter<void>());\n\tpublic readonly onCompositionEnd = this._onCompositionEnd.event;\n\n\tprivate readonly _onDidPaste: Emitter<Range> = this._register(new Emitter<Range>());\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 _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 _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\t//#endregion\n\n\tpublic readonly isSimpleWidget: boolean;\n\tprivate readonly _telemetryData?: object;\n\n\tprivate readonly _domElement: HTMLElement;\n\tprivate readonly _id: number;\n\tprivate readonly _configuration: editorCommon.IConfiguration;\n\n\tprotected readonly _contributions: { [key: string]: editorCommon.IEditorContribution; };\n\tprotected readonly _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\tprivate readonly _codeEditorService: ICodeEditorService;\n\tprivate readonly _commandService: ICommandService;\n\tprivate readonly _themeService: IThemeService;\n\n\tprivate readonly _focusTracker: CodeEditorWidgetFocusTracker;\n\n\tprivate readonly _contentWidgets: { [key: string]: IContentWidgetData; };\n\tprivate readonly _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\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\toptions: editorOptions.IEditorOptions,\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) {\n\t\tsuper();\n\t\tthis._domElement = domElement;\n\t\tthis._id = (++EDITOR_ID);\n\t\tthis._decorationTypeKeysToIds = {};\n\t\tthis._decorationTypeSubtypes = {};\n\t\tthis.isSimpleWidget = codeEditorWidgetOptions.isSimpleWidget || false;\n\t\tthis._telemetryData = codeEditorWidgetOptions.telemetryData;\n\n\t\toptions = options || {};\n\t\tthis._configuration = this._register(this._createConfiguration(options, accessibilityService));\n\t\tthis._register(this._configuration.onDidChange((e) => {\n\t\t\tthis._onDidChangeConfiguration.fire(e);\n\n\t\t\tif (e.layoutInfo) {\n\t\t\t\tthis._onDidLayoutChange.fire(this._configuration.editor.layoutInfo);\n\t\t\t}\n\t\t\tif (this._configuration.editor.showUnused) {\n\t\t\t\tthis._domElement.classList.add(SHOW_UNUSED_ENABLED_CLASS);\n\t\t\t} else {\n\t\t\t\tthis._domElement.classList.remove(SHOW_UNUSED_ENABLED_CLASS);\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));\n\n\t\tthis._instantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this._contextKeyService]));\n\n\t\tthis._attachModel(null);\n\n\t\tthis._contributions = {};\n\t\tthis._actions = {};\n\n\t\tthis._focusTracker = new CodeEditorWidgetFocusTracker(domElement);\n\t\tthis._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: IEditorContributionCtor[];\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 (let i = 0, len = contributions.length; i < len; i++) {\n\t\t\tconst ctor = contributions[i];\n\t\t\ttry {\n\t\t\t\tconst contribution = this._instantiationService.createInstance(ctor, this);\n\t\t\t\tthis._contributions[contribution.getId()] = 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\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(options: editorOptions.IEditorOptions, accessibilityService: IAccessibilityService): editorCommon.IConfiguration {\n\t\treturn new Configuration(this.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 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\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: editorOptions.IEditorOptions): void {\n\t\tthis._configuration.updateOptions(newOptions);\n\t}\n\n\tpublic getConfiguration(): editorOptions.InternalEditorOptions {\n\t\treturn this._configuration.editor;\n\t}\n\n\tpublic getRawConfiguration(): editorOptions.IEditorOptions {\n\t\treturn this._configuration.getRawOptions();\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\n\t\tconst detachedModel = this._detachModel();\n\t\tthis._attachModel(model);\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 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.cursor.getPosition();\n\t}\n\n\tpublic setPosition(position: IPosition): 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.cursor.setSelections('api', [{\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.cursor.emitCursorRevealRange(viewRange, verticalType, revealHorizontal, 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\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\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.cursor.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.cursor.getSelections();\n\t}\n\n\tpublic setSelection(range: IRange): void;\n\tpublic setSelection(editorRange: Range): void;\n\tpublic setSelection(selection: ISelection): void;\n\tpublic setSelection(editorSelection: Selection): void;\n\tpublic setSelection(something: any): 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);\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);\n\t\t}\n\t}\n\n\tprivate _setSelectionImpl(sel: ISelection): 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.cursor.setSelections('api', [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\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 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: ISelection[], source: string = 'api'): 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.cursor.setSelections(source, ranges);\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 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): 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.setScrollPositionNow({\n\t\t\tscrollLeft: newScrollLeft\n\t\t});\n\t}\n\tpublic setScrollTop(newScrollTop: number): 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.setScrollPositionNow({\n\t\t\tscrollTop: newScrollTop\n\t\t});\n\t}\n\tpublic setScrollPosition(position: editorCommon.INewScrollPosition): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.viewModel.viewLayout.setScrollPositionNow(position);\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.cursor.saveState();\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\tthis._modelData.cursor.restoreState(<editorCommon.ICursorState[]>cursorState);\n\t\t\t} else {\n\t\t\t\t// Backwards compatibility\n\t\t\t\tthis._modelData.cursor.restoreState([<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 {\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, handlerId: string, payload: any): void {\n\t\tpayload = payload || {};\n\n\t\t// Special case for typing\n\t\tif (handlerId === editorCommon.Handler.Type) {\n\t\t\tif (!this._modelData || typeof payload.text !== 'string' || payload.text.length === 0) {\n\t\t\t\t// nothing to do\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (source === 'keyboard') {\n\t\t\t\tthis._onWillType.fire(payload.text);\n\t\t\t}\n\t\t\tthis._modelData.cursor.trigger(source, handlerId, payload);\n\t\t\tif (source === 'keyboard') {\n\t\t\t\tthis._onDidType.fire(payload.text);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Special case for pasting\n\t\tif (handlerId === editorCommon.Handler.Paste) {\n\t\t\tif (!this._modelData || typeof payload.text !== 'string' || payload.text.length === 0) {\n\t\t\t\t// nothing to do\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst startPosition = this._modelData.cursor.getSelection().getStartPosition();\n\t\t\tthis._modelData.cursor.trigger(source, handlerId, payload);\n\t\t\tconst endPosition = this._modelData.cursor.getSelection().getStartPosition();\n\t\t\tif (source === 'keyboard') {\n\t\t\t\tthis._onDidPaste.fire(\n\t\t\t\t\tnew Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (handlerId === editorCommon.Handler.CompositionStart) {\n\t\t\tthis._onCompositionStart.fire();\n\t\t}\n\t\tif (handlerId === editorCommon.Handler.CompositionEnd) {\n\t\t\tthis._onCompositionEnd.fire();\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._modelData.cursor.trigger(source, handlerId, payload);\n\t}\n\n\tprivate _triggerEditorCommand(source: string, 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 _getCursors(): ICursors | null {\n\t\tif (!this._modelData) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._modelData.cursor;\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.editor.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 executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: Selection[]): boolean {\n\t\tif (!this._modelData) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._configuration.editor.readOnly) {\n\t\t\t// read only editor => sorry!\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._modelData.model.pushEditOperations(this._modelData.cursor.getSelections(), edits, () => {\n\t\t\treturn endCursorState ? endCursorState : null;\n\t\t});\n\n\t\tif (endCursorState) {\n\t\t\tthis._modelData.cursor.setSelections(source, endCursorState);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic executeCommand(source: string, command: editorCommon.ICommand): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.cursor.trigger(source, editorCommon.Handler.ExecuteCommand, command);\n\t}\n\n\tpublic executeCommands(source: string, commands: editorCommon.ICommand[]): void {\n\t\tif (!this._modelData) {\n\t\t\treturn;\n\t\t}\n\t\tthis._modelData.cursor.trigger(source, editorCommon.Handler.ExecuteCommands, commands);\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, this._configuration.editor.readOnly);\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(): editorOptions.EditorLayoutInfo {\n\t\treturn this._configuration.editor.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 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?: editorCommon.IDimension): void {\n\t\tthis._configuration.observeReferenceElement(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\tconst hasChanges = this._modelData.view.change(callback);\n\t\tif (hasChanges) {\n\t\t\tthis._onDidChangeViewZones.fire();\n\t\t}\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 layoutInfo = this._configuration.editor.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: this._configuration.editor.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 applyFontInfo(target: HTMLElement): void {\n\t\tConfiguration.applyFontInfoSlow(target, this._configuration.editor.fontInfo);\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.getLanguageIdentifier().language);\n\t\tthis._configuration.setIsDominatedByLongLines(model.isDominatedByLongLines());\n\t\tthis._configuration.setMaxLineNumber(model.getLineCount());\n\n\t\tmodel.onBeforeAttached();\n\n\t\tconst viewModel = new ViewModel(this._id, this._configuration, model, (callback) => dom.scheduleAtNextAnimationFrame(callback));\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.getLanguageIdentifier().language);\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\tconst cursor = new Cursor(this._configuration, model, viewModel);\n\n\t\tlistenersToRemove.push(cursor.onDidReachMaxCursorCount(() => {\n\t\t\tthis._notificationService.warn(nls.localize('cursors.maximum', \"The number of cursors has been limited to {0}.\", Cursor.MAX_CURSOR_COUNT));\n\t\t}));\n\n\t\tlistenersToRemove.push(cursor.onDidAttemptReadOnlyEdit(() => {\n\t\t\tthis._onDidAttemptReadOnlyEdit.fire(undefined);\n\t\t}));\n\n\t\tlistenersToRemove.push(cursor.onDidChange((e: CursorStateChangedEvent) => {\n\t\t\tconst positions: Position[] = [];\n\t\t\tfor (let i = 0, len = e.selections.length; i < len; i++) {\n\t\t\t\tpositions[i] = e.selections[i].getPosition();\n\t\t\t}\n\n\t\t\tconst e1: ICursorPositionChangedEvent = {\n\t\t\t\tposition: positions[0],\n\t\t\t\tsecondaryPositions: positions.slice(1),\n\t\t\t\treason: e.reason,\n\t\t\t\tsource: e.source\n\t\t\t};\n\t\t\tthis._onDidChangeCursorPosition.fire(e1);\n\n\t\t\tconst e2: ICursorSelectionChangedEvent = {\n\t\t\t\tselection: e.selections[0],\n\t\t\t\tsecondarySelections: e.selections.slice(1),\n\t\t\t\tsource: e.source,\n\t\t\t\treason: e.reason\n\t\t\t};\n\t\t\tthis._onDidChangeCursorSelection.fire(e2);\n\t\t}));\n\n\t\tconst [view, hasRealView] = this._createView(viewModel, cursor);\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, cursor, view, hasRealView, listenersToRemove);\n\t}\n\n\tprotected _createView(viewModel: ViewModel, cursor: Cursor): [View, boolean] {\n\t\tlet commandDelegate: ICommandDelegate;\n\t\tif (this.isSimpleWidget) {\n\t\t\tcommandDelegate = {\n\t\t\t\texecuteEditorCommand: (editorCommand: CoreEditorCommand, args: any): void => {\n\t\t\t\t\teditorCommand.runCoreEditorCommand(cursor, args);\n\t\t\t\t},\n\t\t\t\tpaste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null) => {\n\t\t\t\t\tthis.trigger(source, editorCommon.Handler.Paste, { text, pasteOnNewLine, multicursorText });\n\t\t\t\t},\n\t\t\t\ttype: (source: string, text: string) => {\n\t\t\t\t\tthis.trigger(source, editorCommon.Handler.Type, { text });\n\t\t\t\t},\n\t\t\t\treplacePreviousChar: (source: string, text: string, replaceCharCnt: number) => {\n\t\t\t\t\tthis.trigger(source, editorCommon.Handler.ReplacePreviousChar, { text, replaceCharCnt });\n\t\t\t\t},\n\t\t\t\tcompositionStart: (source: string) => {\n\t\t\t\t\tthis.trigger(source, editorCommon.Handler.CompositionStart, undefined);\n\t\t\t\t},\n\t\t\t\tcompositionEnd: (source: string) => {\n\t\t\t\t\tthis.trigger(source, editorCommon.Handler.CompositionEnd, undefined);\n\t\t\t\t},\n\t\t\t\tcut: (source: string) => {\n\t\t\t\t\tthis.trigger(source, editorCommon.Handler.Cut, undefined);\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\tcommandDelegate = {\n\t\t\t\texecuteEditorCommand: (editorCommand: CoreEditorCommand, args: any): void => {\n\t\t\t\t\teditorCommand.runCoreEditorCommand(cursor, args);\n\t\t\t\t},\n\t\t\t\tpaste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null) => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.Paste, {\n\t\t\t\t\t\ttext: text,\n\t\t\t\t\t\tpasteOnNewLine: pasteOnNewLine,\n\t\t\t\t\t\tmulticursorText: multicursorText\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttype: (source: string, text: string) => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.Type, {\n\t\t\t\t\t\ttext: text\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\treplacePreviousChar: (source: string, text: string, replaceCharCnt: number) => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.ReplacePreviousChar, {\n\t\t\t\t\t\ttext: text,\n\t\t\t\t\t\treplaceCharCnt: replaceCharCnt\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tcompositionStart: (source: string) => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.CompositionStart, {});\n\t\t\t\t},\n\t\t\t\tcompositionEnd: (source: string) => {\n\t\t\t\t\tthis._commandService.executeCommand(editorCommon.Handler.CompositionEnd, {});\n\t\t\t\t},\n\t\t\t\tcut: (source: string) => {\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 viewOutgoingEvents = new ViewOutgoingEvents(viewModel);\n\t\tviewOutgoingEvents.onDidGainFocus = () => {\n\t\t\tthis._editorTextFocus.setValue(true);\n\t\t\t// In IE, the focus is not synchronous, so we give it a little help\n\t\t\tthis._editorWidgetFocus.setValue(true);\n\t\t};\n\n\t\tviewOutgoingEvents.onDidScroll = (e) => this._onDidScrollChange.fire(e);\n\t\tviewOutgoingEvents.onDidLoseFocus = () => this._editorTextFocus.setValue(false);\n\t\tviewOutgoingEvents.onContextMenu = (e) => this._onContextMenu.fire(e);\n\t\tviewOutgoingEvents.onMouseDown = (e) => this._onMouseDown.fire(e);\n\t\tviewOutgoingEvents.onMouseUp = (e) => this._onMouseUp.fire(e);\n\t\tviewOutgoingEvents.onMouseDrag = (e) => this._onMouseDrag.fire(e);\n\t\tviewOutgoingEvents.onMouseDrop = (e) => this._onMouseDrop.fire(e);\n\t\tviewOutgoingEvents.onKeyUp = (e) => this._onKeyUp.fire(e);\n\t\tviewOutgoingEvents.onMouseMove = (e) => this._onMouseMove.fire(e);\n\t\tviewOutgoingEvents.onMouseLeave = (e) => this._onMouseLeave.fire(e);\n\t\tviewOutgoingEvents.onMouseWheel = (e) => this._onMouseWheel.fire(e);\n\t\tviewOutgoingEvents.onKeyDown = (e) => this._onKeyDown.fire(e);\n\n\t\tconst view = new View(\n\t\t\tcommandDelegate,\n\t\t\tthis._configuration,\n\t\t\tthis._themeService,\n\t\t\tviewModel,\n\t\t\tcursor,\n\t\t\tviewOutgoingEvents\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) {\n\t\t\tthis._domElement.removeChild(removeDomNode);\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\t/* __GDPR__FRAGMENT__\n\t\t\"EditorTelemetryData\" : {}\n\t*/\n\tpublic getTelemetryData(): { [key: string]: any; } | undefined {\n\t\treturn this._telemetryData;\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 _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 _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\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._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\t}\n\n\tprivate _updateFromConfig(): void {\n\t\tconst config = this._editor.getConfiguration();\n\n\t\tthis._editorTabMovesFocus.set(config.tabFocusMode);\n\t\tthis._editorReadonly.set(config.readOnly);\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 _isInWalkThrough: IContextKey<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: CodeEditorWidget,\n\t\tprivate readonly _contextKeyService: IContextKeyService\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._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.isInEmbeddedEditor.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(modes.CompletionProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.CodeActionProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.CodeLensProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.DefinitionProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.DeclarationProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.ImplementationProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.TypeDefinitionProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.HoverProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.DocumentHighlightProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.DocumentSymbolProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.ReferenceProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.RenameProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.DocumentFormattingEditProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.DocumentRangeFormattingEditProviderRegistry.onDidChange(update));\n\t\tthis._register(modes.SignatureHelpProviderRegistry.onDidChange(update));\n\n\t\tupdate();\n\t}\n\n\tdispose() {\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.getLanguageIdentifier().language);\n\t\t\tthis._hasCompletionItemProvider.set(modes.CompletionProviderRegistry.has(model));\n\t\t\tthis._hasCodeActionsProvider.set(modes.CodeActionProviderRegistry.has(model));\n\t\t\tthis._hasCodeLensProvider.set(modes.CodeLensProviderRegistry.has(model));\n\t\t\tthis._hasDefinitionProvider.set(modes.DefinitionProviderRegistry.has(model));\n\t\t\tthis._hasDeclarationProvider.set(modes.DeclarationProviderRegistry.has(model));\n\t\t\tthis._hasImplementationProvider.set(modes.ImplementationProviderRegistry.has(model));\n\t\t\tthis._hasTypeDefinitionProvider.set(modes.TypeDefinitionProviderRegistry.has(model));\n\t\t\tthis._hasHoverProvider.set(modes.HoverProviderRegistry.has(model));\n\t\t\tthis._hasDocumentHighlightProvider.set(modes.DocumentHighlightProviderRegistry.has(model));\n\t\t\tthis._hasDocumentSymbolProvider.set(modes.DocumentSymbolProviderRegistry.has(model));\n\t\t\tthis._hasReferenceProvider.set(modes.ReferenceProviderRegistry.has(model));\n\t\t\tthis._hasRenameProvider.set(modes.RenameProviderRegistry.has(model));\n\t\t\tthis._hasSignatureHelpProvider.set(modes.SignatureHelpProviderRegistry.has(model));\n\t\t\tthis._hasDocumentFormattingProvider.set(modes.DocumentFormattingEditProviderRegistry.has(model) || modes.DocumentRangeFormattingEditProviderRegistry.has(model));\n\t\t\tthis._hasDocumentSelectionFormattingProvider.set(modes.DocumentRangeFormattingEditProviderRegistry.has(model));\n\t\t\tthis._hasMultipleDocumentFormattingProvider.set(modes.DocumentFormattingEditProviderRegistry.all(model).length + modes.DocumentRangeFormattingEditProviderRegistry.all(model).length > 1);\n\t\t\tthis._hasMultipleDocumentSelectionFormattingProvider.set(modes.DocumentRangeFormattingEditProviderRegistry.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\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\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\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(`.${SHOW_UNUSED_ENABLED_CLASS} .monaco-editor .${ClassName.EditorUnnecessaryInlineDecoration} { opacity: ${unnecessaryForeground.rgba.a}; }`);\n\t}\n\n\tconst unnecessaryBorder = theme.getColor(editorUnnecessaryCodeBorder);\n\tif (unnecessaryBorder) {\n\t\tcollector.addRule(`.${SHOW_UNUSED_ENABLED_CLASS} .monaco-editor .${ClassName.EditorUnnecessaryDecoration} { border-bottom: 2px dashed ${unnecessaryBorder}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Configuration } from 'vs/editor/browser/config/configuration';\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 * as editorOptions from 'vs/editor/common/config/editorOptions';\nimport { LineTokens } from 'vs/editor/common/core/lineTokens';\nimport { Position } from 'vs/editor/common/core/position';\nimport { ILineChange, ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport { ColorId, FontStyle, MetadataConsts } from 'vs/editor/common/modes';\nimport { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';\nimport { RenderLineInput, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { ViewLineRenderingData } from 'vs/editor/common/viewModel/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 } from 'vs/platform/theme/common/themeService';\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\nexport class DiffReview extends Disposable {\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(diffEditor: DiffEditorWidget) {\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', true, () => {\n\t\t\tthis.hide();\n\t\t\treturn Promise.resolve(null);\n\t\t}), { 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.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(diffEditor.getOriginalEditor().onDidFocusEditorWidget(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(diffEditor.getModifiedEditor().onDidFocusEditorWidget(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this.domNode.domNode, 'click', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tlet 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\tthis._diffEditor.setPosition(new Position(this._diffs[index].entries[0].modifiedLineStart, 1));\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\tthis._diffEditor.setPosition(new Position(this._diffs[index].entries[0].modifiedLineStart, 1));\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\tlet current = this._getCurrentFocusedRow();\n\t\tif (current) {\n\t\t\tlet 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.focus();\n\t\tthis._diffEditor.doLayout();\n\t\tthis._render();\n\t}\n\n\tprivate _getPrevRow(): HTMLElement {\n\t\tlet 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\tlet 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\tlet 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\tlet 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\tlet diffs: Diff[] = [], 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\tlet r: DiffEntry[] = [], 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\tlet r: Diff[] = [], 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 originalOpts = this._diffEditor.getOriginalEditor().getConfiguration();\n\t\tconst modifiedOpts = this._diffEditor.getModifiedEditor().getConfiguration();\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\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\tlet container = document.createElement('div');\n\t\tcontainer.className = 'diff-review-table';\n\t\tcontainer.setAttribute('role', 'list');\n\t\tConfiguration.applyFontInfoSlow(container, modifiedOpts.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\tlet header = document.createElement('div');\n\t\theader.className = 'diff-review-row';\n\n\t\tlet 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', \"no lines\");\n\t\t\t} else if (lines === 1) {\n\t\t\t\treturn nls.localize('one_line', \"1 line\");\n\t\t\t} else {\n\t\t\t\treturn nls.localize('more_lines', \"{0} lines\", 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\", \"1 line\" or \"X lines\", localized separately.'\n\t\t\t]\n\t\t}, \"Difference {0} of {1}: original {2}, {3}, modified {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\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, this._width, originalOpts, originalModel, originalModelOpts, modifiedOpts, modifiedModel, modifiedModelOpts);\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, width: number,\n\t\toriginalOpts: editorOptions.InternalEditorOptions, originalModel: ITextModel, originalModelOpts: TextModelResolvedOptions,\n\t\tmodifiedOpts: editorOptions.InternalEditorOptions, modifiedModel: ITextModel, modifiedModelOpts: TextModelResolvedOptions\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\tlet spacerClassName: string = 'diff-review-spacer';\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\tspacerClassName = 'diff-review-spacer insert-sign';\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\tspacerClassName = 'diff-review-spacer delete-sign';\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 originalLineNumbersWidth = originalOpts.layoutInfo.glyphMarginWidth + originalOpts.layoutInfo.lineNumbersWidth;\n\t\tconst modifiedLineNumbersWidth = 10 + modifiedOpts.layoutInfo.glyphMarginWidth + modifiedOpts.layoutInfo.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\tlet cell = document.createElement('div');\n\t\t\tcell.className = 'diff-review-cell';\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.innerHTML = ' ';\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.innerHTML = ' ';\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\t\t\tspacer.innerHTML = ' ';\n\t\t\tcell.appendChild(spacer);\n\n\t\t\tlet lineContent: string;\n\t\t\tif (modifiedLine !== 0) {\n\t\t\t\tcell.insertAdjacentHTML('beforeend',\n\t\t\t\t\tthis._renderLine(modifiedModel, modifiedOpts, modifiedModelOpts.tabSize, modifiedLine)\n\t\t\t\t);\n\t\t\t\tlineContent = modifiedModel.getLineContent(modifiedLine);\n\t\t\t} else {\n\t\t\t\tcell.insertAdjacentHTML('beforeend',\n\t\t\t\t\tthis._renderLine(originalModel, originalOpts, originalModelOpts.tabSize, originalLine)\n\t\t\t\t);\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\tariaLabel = nls.localize('equalLine', \"original {0}, modified {1}: {2}\", originalLine, modifiedLine, lineContent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DiffEntryType.Insert:\n\t\t\t\t\tariaLabel = nls.localize('insertLine', \"+ modified {0}: {1}\", modifiedLine, lineContent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DiffEntryType.Delete:\n\t\t\t\t\tariaLabel = nls.localize('deleteLine', \"- original {0}: {1}\", originalLine, lineContent);\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, config: editorOptions.InternalEditorOptions, tabSize: number, lineNumber: number): string {\n\t\tconst lineContent = model.getLineContent(lineNumber);\n\n\t\tconst defaultMetadata = (\n\t\t\t(FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\n\t\tconst tokens = new Uint32Array(2);\n\t\ttokens[0] = lineContent.length;\n\t\ttokens[1] = defaultMetadata;\n\n\t\tconst lineTokens = new LineTokens(tokens, lineContent);\n\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(config.fontInfo.isMonospace && !config.viewInfo.disableMonospaceOptimizations),\n\t\t\tconfig.fontInfo.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\tconfig.fontInfo.spaceWidth,\n\t\t\tconfig.viewInfo.stopRenderingLineAfter,\n\t\t\tconfig.viewInfo.renderWhitespace,\n\t\t\tconfig.viewInfo.renderControlCharacters,\n\t\t\tconfig.viewInfo.fontLigatures\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\tfor (let i = 0, len = diffEditors.length; i < len; i++) {\n\t\tconst diffEditor = <DiffEditorWidget>diffEditors[i];\n\t\tif (diffEditor.hasWidgetFocus()) {\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 '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 } 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 * as objects from 'vs/base/common/objects';\nimport { URI } from 'vs/base/common/uri';\nimport { Configuration } from 'vs/editor/browser/config/configuration';\nimport { StableEditorScrollState } from 'vs/editor/browser/core/editorState';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';\nimport { DiffReview } from 'vs/editor/browser/widget/diffReview';\nimport * as editorOptions 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 { IDiffComputationResult, IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager';\nimport { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';\nimport { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';\nimport { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer';\nimport { InlineDecoration, InlineDecorationType, ViewLineRenderingData } from 'vs/editor/common/viewModel/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 } from 'vs/platform/theme/common/colorRegistry';\nimport { ITheme, IThemeService, getThemeTypeSelector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\ninterface IEditorDiffDecorations {\n\tdecorations: IModelDeltaDecoration[];\n\toverviewZones: OverviewRulerZone[];\n}\n\ninterface IEditorDiffDecorationsWithZones extends IEditorDiffDecorations {\n\tzones: editorBrowser.IViewZone[];\n}\n\ninterface IEditorsDiffDecorationsWithZones {\n\toriginal: IEditorDiffDecorationsWithZones;\n\tmodified: IEditorDiffDecorationsWithZones;\n}\n\ninterface IEditorsZones {\n\toriginal: editorBrowser.IViewZone[];\n\tmodified: editorBrowser.IViewZone[];\n}\n\ninterface IDiffEditorWidgetStyle {\n\tgetEditorsDiffDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalWhitespaces: IEditorWhitespace[], modifiedWhitespaces: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorsDiffDecorationsWithZones;\n\tsetEnableSplitViewResizing(enableSplitViewResizing: boolean): void;\n\tapplyColors(theme: ITheme): boolean;\n\tlayout(): number;\n\tdispose(): void;\n}\n\nclass VisualEditorState {\n\tprivate _zones: number[];\n\tprivate _zonesMap: { [zoneId: string]: boolean; };\n\tprivate _decorations: string[];\n\n\tconstructor() {\n\t\tthis._zones = [];\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 (let i = 0, length = this._zones.length; i < length; i++) {\n\t\t\t\t\tviewChangeAccessor.removeZone(this._zones[i]);\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, 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 (let i = 0, length = this._zones.length; i < length; i++) {\n\t\t\t\tviewChangeAccessor.removeZone(this._zones[i]);\n\t\t\t}\n\t\t\tthis._zones = [];\n\t\t\tthis._zonesMap = {};\n\t\t\tfor (let i = 0, length = newDecorations.zones.length; i < length; i++) {\n\t\t\t\tnewDecorations.zones[i].suppressMouseDown = true;\n\t\t\t\tlet zoneId = viewChangeAccessor.addZone(newDecorations.zones[i]);\n\t\t\t\tthis._zones.push(zoneId);\n\t\t\t\tthis._zonesMap[String(zoneId)] = true;\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\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 id: number;\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 _width: number;\n\tprivate _height: number;\n\tprivate _reviewHeight: number;\n\tprivate readonly _measureDomElementToken: number;\n\n\tprivate originalEditor: CodeEditorWidget;\n\tprivate _originalDomNode: HTMLElement;\n\tprivate readonly _originalEditorState: VisualEditorState;\n\tprivate _originalOverviewRuler: editorBrowser.IOverviewRuler;\n\n\tprivate modifiedEditor: CodeEditorWidget;\n\tprivate _modifiedDomNode: HTMLElement;\n\tprivate readonly _modifiedEditorState: VisualEditorState;\n\tprivate _modifiedOverviewRuler: editorBrowser.IOverviewRuler;\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 _ignoreTrimWhitespace: boolean;\n\tprivate _originalIsEditable: boolean;\n\n\tprivate _renderSideBySide: boolean;\n\tprivate _renderIndicators: boolean;\n\tprivate _enableSplitViewResizing: boolean;\n\tprivate _strategy: IDiffEditorWidgetStyle;\n\n\tprivate readonly _updateDecorationsRunner: RunOnceScheduler;\n\n\tprivate readonly _editorWorkerService: IEditorWorkerService;\n\tprotected _contextKeyService: IContextKeyService;\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: editorOptions.IDiffEditorOptions,\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) {\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._contextKeyService.createKey('isInDiffEditor', true);\n\t\tthis._themeService = themeService;\n\t\tthis._notificationService = notificationService;\n\n\t\tthis.id = (++DIFF_EDITOR_ID);\n\n\t\tthis._domElement = domElement;\n\t\toptions = options || {};\n\n\t\t// renderSideBySide\n\t\tthis._renderSideBySide = true;\n\t\tif (typeof options.renderSideBySide !== 'undefined') {\n\t\t\tthis._renderSideBySide = options.renderSideBySide;\n\t\t}\n\n\t\t// ignoreTrimWhitespace\n\t\tthis._ignoreTrimWhitespace = true;\n\t\tif (typeof options.ignoreTrimWhitespace !== 'undefined') {\n\t\t\tthis._ignoreTrimWhitespace = options.ignoreTrimWhitespace;\n\t\t}\n\n\t\t// renderIndicators\n\t\tthis._renderIndicators = true;\n\t\tif (typeof options.renderIndicators !== 'undefined') {\n\t\t\tthis._renderIndicators = options.renderIndicators;\n\t\t}\n\n\t\tthis._originalIsEditable = false;\n\t\tif (typeof options.originalEditable !== 'undefined') {\n\t\t\tthis._originalIsEditable = Boolean(options.originalEditable);\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.getTheme(), this._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\tthis._containerDomElement.appendChild(this._overviewDomElement);\n\n\t\tthis._createLeftHandSide();\n\t\tthis._createRightHandSide();\n\n\t\tthis._beginUpdateDecorationsTimeout = -1;\n\t\tthis._currentlyChangingViewZones = false;\n\t\tthis._diffComputationToken = 0;\n\n\t\tthis._originalEditorState = new VisualEditorState();\n\t\tthis._modifiedEditorState = new VisualEditorState();\n\n\t\tthis._isVisible = true;\n\t\tthis._isHandlingScrollEvent = false;\n\n\t\tthis._width = 0;\n\t\tthis._height = 0;\n\t\tthis._reviewHeight = 0;\n\n\t\tthis._diffComputationResult = null;\n\n\t\tconst leftContextKeyService = this._contextKeyService.createScoped();\n\t\tleftContextKeyService.createKey('isInDiffLeftEditor', true);\n\n\t\tconst leftServices = new ServiceCollection();\n\t\tleftServices.set(IContextKeyService, leftContextKeyService);\n\t\tconst leftScopedInstantiationService = instantiationService.createChild(leftServices);\n\n\t\tconst rightContextKeyService = this._contextKeyService.createScoped();\n\t\trightContextKeyService.createKey('isInDiffRightEditor', true);\n\n\t\tconst rightServices = new ServiceCollection();\n\t\trightServices.set(IContextKeyService, rightContextKeyService);\n\t\tconst rightScopedInstantiationService = instantiationService.createChild(rightServices);\n\n\t\tthis._createLeftHandSideEditor(options, leftScopedInstantiationService);\n\t\tthis._createRightHandSideEditor(options, rightScopedInstantiationService);\n\n\t\tthis._reviewPane = new 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 (options.automaticLayout) {\n\t\t\tthis._measureDomElementToken = window.setInterval(() => this._measureDomElement(false), 100);\n\t\t}\n\n\t\t// enableSplitViewResizing\n\t\tthis._enableSplitViewResizing = true;\n\t\tif (typeof options.enableSplitViewResizing !== 'undefined') {\n\t\t\tthis._enableSplitViewResizing = options.enableSplitViewResizing;\n\t\t}\n\n\t\tif (this._renderSideBySide) {\n\t\t\tthis._setStrategy(new DiffEdtorWidgetSideBySide(this._createDataSource(), this._enableSplitViewResizing));\n\t\t} else {\n\t\t\tthis._setStrategy(new DiffEdtorWidgetInline(this._createDataSource(), this._enableSplitViewResizing));\n\t\t}\n\n\t\tthis._register(themeService.onThemeChange(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.getTheme(), this._renderSideBySide);\n\t\t}));\n\n\t\tthis._codeEditorService.addDiffEditor(this);\n\t}\n\n\tpublic hasWidgetFocus(): boolean {\n\t\treturn dom.isAncestor(document.activeElement, this._domElement);\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: ITheme, 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._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 _createLeftHandSide(): void {\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\t}\n\n\tprivate _createRightHandSide(): void {\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\t}\n\n\tprivate _createLeftHandSideEditor(options: editorOptions.IDiffEditorOptions, instantiationService: IInstantiationService): void {\n\t\tthis.originalEditor = this._createInnerEditor(instantiationService, this._originalDomNode, this._adjustOptionsForLeftHandSide(options, this._originalIsEditable));\n\n\t\tthis._register(this.originalEditor.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(this.originalEditor.onDidChangeViewZones(() => {\n\t\t\tthis._onViewZonesChanged();\n\t\t}));\n\n\t\tthis._register(this.originalEditor.onDidChangeModelContent(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis._beginUpdateDecorationsSoon();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _createRightHandSideEditor(options: editorOptions.IDiffEditorOptions, instantiationService: IInstantiationService): void {\n\t\tthis.modifiedEditor = this._createInnerEditor(instantiationService, this._modifiedDomNode, this._adjustOptionsForRightHandSide(options));\n\n\t\tthis._register(this.modifiedEditor.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(this.modifiedEditor.onDidChangeViewZones(() => {\n\t\t\tthis._onViewZonesChanged();\n\t\t}));\n\n\t\tthis._register(this.modifiedEditor.onDidChangeConfiguration((e) => {\n\t\t\tif (e.fontInfo && this.modifiedEditor.getModel()) {\n\t\t\t\tthis._onViewZonesChanged();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.modifiedEditor.onDidChangeModelContent(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis._beginUpdateDecorationsSoon();\n\t\t\t}\n\t\t}));\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: editorOptions.IEditorOptions): CodeEditorWidget {\n\t\treturn instantiationService.createInstance(CodeEditorWidget, container, options, {});\n\t}\n\n\tpublic 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\twindow.clearInterval(this._measureDomElementToken);\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\tthis._containerDomElement.removeChild(this._overviewDomElement);\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(): editorCommon.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: editorOptions.IDiffEditorOptions): void {\n\n\t\t// Handle side by side\n\t\tlet renderSideBySideChanged = false;\n\t\tif (typeof newOptions.renderSideBySide !== 'undefined') {\n\t\t\tif (this._renderSideBySide !== newOptions.renderSideBySide) {\n\t\t\t\tthis._renderSideBySide = newOptions.renderSideBySide;\n\t\t\t\trenderSideBySideChanged = true;\n\t\t\t}\n\t\t}\n\n\t\tlet beginUpdateDecorations = false;\n\n\t\tif (typeof newOptions.ignoreTrimWhitespace !== 'undefined') {\n\t\t\tif (this._ignoreTrimWhitespace !== newOptions.ignoreTrimWhitespace) {\n\t\t\t\tthis._ignoreTrimWhitespace = newOptions.ignoreTrimWhitespace;\n\t\t\t\t// Begin comparing\n\t\t\t\tbeginUpdateDecorations = true;\n\t\t\t}\n\t\t}\n\n\t\tif (typeof newOptions.renderIndicators !== 'undefined') {\n\t\t\tif (this._renderIndicators !== newOptions.renderIndicators) {\n\t\t\t\tthis._renderIndicators = newOptions.renderIndicators;\n\t\t\t\tbeginUpdateDecorations = true;\n\t\t\t}\n\t\t}\n\n\t\tif (beginUpdateDecorations) {\n\t\t\tthis._beginUpdateDecorations();\n\t\t}\n\n\t\tif (typeof newOptions.originalEditable !== 'undefined') {\n\t\t\tthis._originalIsEditable = Boolean(newOptions.originalEditable);\n\t\t}\n\n\t\tthis.modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(newOptions));\n\t\tthis.originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(newOptions, this._originalIsEditable));\n\n\t\t// enableSplitViewResizing\n\t\tif (typeof newOptions.enableSplitViewResizing !== 'undefined') {\n\t\t\tthis._enableSplitViewResizing = newOptions.enableSplitViewResizing;\n\t\t}\n\t\tthis._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing);\n\n\t\t// renderSideBySide\n\t\tif (renderSideBySideChanged) {\n\t\t\tif (this._renderSideBySide) {\n\t\t\t\tthis._setStrategy(new DiffEdtorWidgetSideBySide(this._createDataSource(), this._enableSplitViewResizing));\n\t\t\t} else {\n\t\t\t\tthis._setStrategy(new DiffEdtorWidgetInline(this._createDataSource(), this._enableSplitViewResizing));\n\t\t\t}\n\t\t\t// Update class name\n\t\t\tthis._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide);\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): 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\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\n\t\tif (model) {\n\t\t\tthis._recreateOverviewRulers();\n\n\t\t\t// Begin comparing\n\t\t\tthis._beginUpdateDecorations();\n\t\t} else {\n\t\t\tthis._diffComputationResult = null;\n\t\t}\n\n\t\tthis._layoutOverviewViewport();\n\t}\n\n\tpublic getDomNode(): 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): void {\n\t\tthis.modifiedEditor.setPosition(position);\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 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 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): void;\n\tpublic setSelection(editorRange: Range): void;\n\tpublic setSelection(selection: ISelection): void;\n\tpublic setSelection(editorSelection: Selection): void;\n\tpublic setSelection(something: any): void {\n\t\tthis.modifiedEditor.setSelection(something);\n\t}\n\n\tpublic setSelections(ranges: ISelection[]): void {\n\t\tthis.modifiedEditor.setSelections(ranges);\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 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 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\tlet originalViewState = this.originalEditor.saveViewState();\n\t\tlet 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.original && s.modified) {\n\t\t\tlet 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?: editorCommon.IDimension): void {\n\t\tthis._measureDomElement(false, 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, 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 _measureDomElement(forceDoLayoutCall: boolean, dimensions?: editorCommon.IDimension): void {\n\t\tdimensions = dimensions || {\n\t\t\twidth: this._containerDomElement.clientWidth,\n\t\t\theight: this._containerDomElement.clientHeight\n\t\t};\n\n\t\tif (dimensions.width <= 0) {\n\t\t\tthis._width = 0;\n\t\t\tthis._height = 0;\n\t\t\tthis._reviewHeight = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!forceDoLayoutCall && dimensions.width === this._width && dimensions.height === this._height) {\n\t\t\t// Nothing has changed\n\t\t\treturn;\n\t\t}\n\n\t\tthis._width = dimensions.width;\n\t\tthis._height = dimensions.height;\n\t\tthis._reviewHeight = this._reviewPane.isVisible() ? this._height : 0;\n\n\t\tthis._doLayout();\n\t}\n\n\tprivate _layoutOverviewRulers(): void {\n\t\tlet freeSpace = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * DiffEditorWidget.ONE_OVERVIEW_WIDTH;\n\t\tlet 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: (this._height - this._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: (this._height - this._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\tlet currentToken = this._diffComputationToken;\n\n\t\tif (!this._editorWorkerService.canComputeDiff(currentOriginalModel.uri, currentModifiedModel.uri)) {\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._editorWorkerService.computeDiff(currentOriginalModel.uri, currentModifiedModel.uri, this._ignoreTrimWhitespace).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._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._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\t\tconst lineChanges = (this._diffComputationResult ? this._diffComputationResult.changes : []);\n\n\t\tlet foreignOriginal = this._originalEditorState.getForeignViewZones(this.originalEditor.getWhitespaces());\n\t\tlet foreignModified = this._modifiedEditorState.getForeignViewZones(this.modifiedEditor.getWhitespaces());\n\n\t\tlet diffDecorations = this._strategy.getEditorsDiffDecorations(lineChanges, this._ignoreTrimWhitespace, this._renderIndicators, foreignOriginal, foreignModified, this.originalEditor, this.modifiedEditor);\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: editorOptions.IDiffEditorOptions): editorOptions.IDiffEditorOptions {\n\t\tlet clonedOptions: editorOptions.IDiffEditorOptions = objects.deepClone(options || {});\n\t\tclonedOptions.inDiffEditor = true;\n\t\tclonedOptions.wordWrap = 'off';\n\t\tclonedOptions.wordWrapMinified = false;\n\t\tclonedOptions.automaticLayout = false;\n\t\tclonedOptions.scrollbar = clonedOptions.scrollbar || {};\n\t\tclonedOptions.scrollbar.vertical = 'visible';\n\t\tclonedOptions.folding = false;\n\t\tclonedOptions.codeLens = false;\n\t\tclonedOptions.fixedOverflowWidgets = true;\n\t\t// clonedOptions.lineDecorationsWidth = '2ch';\n\t\tif (!clonedOptions.minimap) {\n\t\t\tclonedOptions.minimap = {};\n\t\t}\n\t\tclonedOptions.minimap.enabled = false;\n\t\treturn clonedOptions;\n\t}\n\n\tprivate _adjustOptionsForLeftHandSide(options: editorOptions.IDiffEditorOptions, isEditable: boolean): editorOptions.IEditorOptions {\n\t\tlet result = this._adjustOptionsForSubEditor(options);\n\t\tresult.readOnly = !isEditable;\n\t\tresult.overviewRulerLanes = 1;\n\t\tresult.extraEditorClassName = 'original-in-monaco-diff-editor';\n\t\treturn result;\n\t}\n\n\tprivate _adjustOptionsForRightHandSide(options: editorOptions.IDiffEditorOptions): editorOptions.IEditorOptions {\n\t\tlet result = this._adjustOptionsForSubEditor(options);\n\t\tresult.revealHorizontalRightPadding = editorOptions.EDITOR_DEFAULTS.viewInfo.revealHorizontalRightPadding + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH;\n\t\tresult.scrollbar!.verticalHasArrows = false;\n\t\tresult.extraEditorClassName = 'modified-in-monaco-diff-editor';\n\t\treturn result;\n\t}\n\n\tpublic doLayout(): void {\n\t\tthis._measureDomElement(true);\n\t}\n\n\tprivate _doLayout(): void {\n\t\tlet 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 = (this._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 = (this._height - this._reviewHeight) + 'px';\n\t\tthis._overviewDomElement.style.width = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH + 'px';\n\t\tthis._overviewDomElement.style.left = (this._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: (this._height - this._reviewHeight) });\n\t\tthis.modifiedEditor.layout({ width: this._width - splitPoint - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH, height: (this._height - this._reviewHeight) });\n\n\t\tif (this._originalOverviewRuler || this._modifiedOverviewRuler) {\n\t\t\tthis._layoutOverviewRulers();\n\t\t}\n\n\t\tthis._reviewPane.layout(this._height - this._reviewHeight, this._width, this._reviewHeight);\n\n\t\tthis._layoutOverviewViewport();\n\t}\n\n\tprivate _layoutOverviewViewport(): void {\n\t\tlet 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\tlet layoutInfo = this.modifiedEditor.getLayoutInfo();\n\t\tif (!layoutInfo) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet scrollTop = this.modifiedEditor.getScrollTop();\n\t\tlet scrollHeight = this.modifiedEditor.getScrollHeight();\n\n\t\tlet computedAvailableSize = Math.max(0, layoutInfo.contentHeight);\n\t\tlet computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0);\n\t\tlet computedRatio = scrollHeight > 0 ? (computedRepresentableSize / scrollHeight) : 0;\n\n\t\tlet computedSliderSize = Math.max(0, Math.floor(layoutInfo.contentHeight * computedRatio));\n\t\tlet 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._width;\n\t\t\t},\n\n\t\t\tgetHeight: () => {\n\t\t\t\treturn (this._height - this._reviewHeight);\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: IDiffEditorWidgetStyle): 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.getTheme());\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._measureDomElement(true);\n\t}\n\n\tprivate _getLineChangeAtOrBeforeLineNumber(lineNumber: number, startLineNumberExtractor: (lineChange: editorCommon.ILineChange) => number): editorCommon.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, max = lineChanges.length - 1;\n\t\twhile (min < max) {\n\t\t\tlet mid = Math.floor((min + max) / 2);\n\t\t\tlet midStart = startLineNumberExtractor(lineChanges[mid]);\n\t\t\tlet midEnd = (mid + 1 <= max ? startLineNumberExtractor(lineChanges[mid + 1]) : Number.MAX_VALUE);\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\tlet lineChange = this._getLineChangeAtOrBeforeLineNumber(lineNumber, (lineChange) => lineChange.originalStartLineNumber);\n\n\t\tif (!lineChange) {\n\t\t\treturn lineNumber;\n\t\t}\n\n\t\tlet originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0);\n\t\tlet modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0);\n\t\tlet lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0);\n\t\tlet lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0);\n\n\n\t\tlet 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\tlet lineChange = this._getLineChangeAtOrBeforeLineNumber(lineNumber, (lineChange) => lineChange.modifiedStartLineNumber);\n\n\t\tif (!lineChange) {\n\t\t\treturn lineNumber;\n\t\t}\n\n\t\tlet originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0);\n\t\tlet modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0);\n\t\tlet lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0);\n\t\tlet lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0);\n\n\n\t\tlet 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\tgetContainerDomNode(): HTMLElement;\n\trelayoutEditors(): void;\n\n\tgetOriginalEditor(): editorBrowser.ICodeEditor;\n\tgetModifiedEditor(): editorBrowser.ICodeEditor;\n}\n\nabstract class DiffEditorWidgetStyle extends Disposable implements IDiffEditorWidgetStyle {\n\n\t_dataSource: IDataSource;\n\t_insertColor: Color;\n\t_removeColor: Color;\n\n\tconstructor(dataSource: IDataSource) {\n\t\tsuper();\n\t\tthis._dataSource = dataSource;\n\t}\n\n\tpublic applyColors(theme: ITheme): boolean {\n\t\tlet newInsertColor = (theme.getColor(diffInserted) || defaultInsertColor).transparent(2);\n\t\tlet newRemoveColor = (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2);\n\t\tlet 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: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalWhitespaces: IEditorWhitespace[], modifiedWhitespaces: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): 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\tlet zones = this._getViewZones(lineChanges, originalWhitespaces, modifiedWhitespaces, originalEditor, modifiedEditor, renderIndicators);\n\n\t\t// Get decorations & overview ruler zones\n\t\tlet originalDecorations = this._getOriginalEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor);\n\t\tlet modifiedDecorations = this._getModifiedEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor);\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: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor, renderIndicators: boolean): IEditorsZones;\n\tprotected abstract _getOriginalEditorDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorDiffDecorations;\n\tprotected abstract _getModifiedEditorDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): 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\theightInLines: number;\n\tminWidthInPx?: number;\n\tdomNode: HTMLElement | null;\n\tmarginDomNode?: HTMLElement | null;\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.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\tprivate readonly lineChanges: editorCommon.ILineChange[];\n\tprivate readonly originalForeignVZ: IEditorWhitespace[];\n\tprivate readonly modifiedForeignVZ: IEditorWhitespace[];\n\n\tconstructor(lineChanges: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[]) {\n\t\tthis.lineChanges = lineChanges;\n\t\tthis.originalForeignVZ = originalForeignVZ;\n\t\tthis.modifiedForeignVZ = modifiedForeignVZ;\n\t}\n\n\tpublic getViewZones(): IEditorsZones {\n\t\tlet 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\tlet sortMyViewZones = (a: IMyViewZone, b: IMyViewZone) => {\n\t\t\treturn a.afterLineNumber - b.afterLineNumber;\n\t\t};\n\n\t\tlet addAndCombineIfPossible = (destination: IMyViewZone[], item: IMyViewZone) => {\n\t\t\tif (item.domNode === null && destination.length > 0) {\n\t\t\t\tlet 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\tlet modifiedForeignVZ = new ForeignViewZonesIterator(this.modifiedForeignVZ);\n\t\tlet originalForeignVZ = new ForeignViewZonesIterator(this.originalForeignVZ);\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\tlet 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 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0);\n\t\t\t\tlineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 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 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.heightInLines,\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.heightInLines,\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\tlet 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\tlet 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\tlet original = stepOriginal[stepOriginalIndex];\n\t\t\t\tlet modified = stepModified[stepModifiedIndex];\n\n\t\t\t\tlet originalDelta = original.afterLineNumber - originalEquivalentLineNumber;\n\t\t\t\tlet 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[]): editorBrowser.IViewZone[] {\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 <editorBrowser.IViewZone>z;\n\t\t});\n\t}\n\n\tprotected abstract _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(): HTMLDivElement | null;\n\n\tprotected abstract _produceOriginalFromDiff(lineChange: editorCommon.ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null;\n\n\tprotected abstract _produceModifiedFromDiff(lineChange: editorCommon.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\tclassName: 'char-delete'\n\t}),\n\tcharDeleteWholeLine: ModelDecorationOptions.register({\n\t\tclassName: 'char-delete',\n\t\tisWholeLine: true\n\t}),\n\n\tcharInsert: ModelDecorationOptions.register({\n\t\tclassName: 'char-insert'\n\t}),\n\tcharInsertWholeLine: ModelDecorationOptions.register({\n\t\tclassName: 'char-insert',\n\t\tisWholeLine: true\n\t}),\n\n\tlineInsert: ModelDecorationOptions.register({\n\t\tclassName: 'line-insert',\n\t\tmarginClassName: 'line-insert',\n\t\tisWholeLine: true\n\t}),\n\tlineInsertWithSign: ModelDecorationOptions.register({\n\t\tclassName: 'line-insert',\n\t\tlinesDecorationsClassName: 'insert-sign',\n\t\tmarginClassName: 'line-insert',\n\t\tisWholeLine: true\n\t}),\n\n\tlineDelete: ModelDecorationOptions.register({\n\t\tclassName: 'line-delete',\n\t\tmarginClassName: 'line-delete',\n\t\tisWholeLine: true\n\t}),\n\tlineDeleteWithSign: ModelDecorationOptions.register({\n\t\tclassName: 'line-delete',\n\t\tlinesDecorationsClassName: 'delete-sign',\n\t\tmarginClassName: 'line-delete',\n\t\tisWholeLine: true\n\n\t}),\n\tlineDeleteMargin: ModelDecorationOptions.register({\n\t\tmarginClassName: 'line-delete',\n\t})\n\n};\n\nclass DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEditorWidgetStyle, IVerticalSashLayoutProvider {\n\n\tstatic 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;\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._sash = this._register(new Sash(this._dataSource.getContainerDomNode(), this));\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\tlet 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\tlet w = this._dataSource.getWidth();\n\t\tlet contentWidth = w - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH;\n\n\t\tlet sashPosition = Math.floor((sashRatio || 0.5) * contentWidth);\n\t\tlet midPoint = Math.floor(0.5 * contentWidth);\n\n\t\tsashPosition = this._disableSash ? midPoint : sashPosition || midPoint;\n\n\t\tif (contentWidth > DiffEdtorWidgetSideBySide.MINIMUM_EDITOR_WIDTH * 2) {\n\t\t\tif (sashPosition < DiffEdtorWidgetSideBySide.MINIMUM_EDITOR_WIDTH) {\n\t\t\t\tsashPosition = DiffEdtorWidgetSideBySide.MINIMUM_EDITOR_WIDTH;\n\t\t\t}\n\n\t\t\tif (sashPosition > contentWidth - DiffEdtorWidgetSideBySide.MINIMUM_EDITOR_WIDTH) {\n\t\t\t\tsashPosition = contentWidth - DiffEdtorWidgetSideBySide.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\tthis._sash.layout();\n\t\t}\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\tlet w = this._dataSource.getWidth();\n\t\tlet contentWidth = w - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH;\n\t\tlet 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: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorsZones {\n\t\tlet c = new SideBySideViewZonesComputer(lineChanges, originalForeignVZ, modifiedForeignVZ);\n\t\treturn c.getViewZones();\n\t}\n\n\tprotected _getOriginalEditorDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorDiffDecorations {\n\t\tconst overviewZoneColor = this._removeColor.toString();\n\n\t\tlet result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tlet originalModel = originalEditor.getModel()!;\n\n\t\tfor (let i = 0, length = lineChanges.length; i < length; i++) {\n\t\t\tlet lineChange = lineChanges[i];\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, Number.MAX_VALUE),\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, Number.MAX_VALUE, DECORATIONS.charDeleteWholeLine));\n\t\t\t\t}\n\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(\n\t\t\t\t\tlineChange.originalStartLineNumber,\n\t\t\t\t\tlineChange.originalEndLineNumber,\n\t\t\t\t\toverviewZoneColor\n\t\t\t\t));\n\n\t\t\t\tif (lineChange.charChanges) {\n\t\t\t\t\tfor (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) {\n\t\t\t\t\t\tlet charChange = lineChange.charChanges[j];\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(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorDiffDecorations {\n\t\tconst overviewZoneColor = this._insertColor.toString();\n\n\t\tlet result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tlet modifiedModel = modifiedEditor.getModel()!;\n\n\t\tfor (let i = 0, length = lineChanges.length; i < length; i++) {\n\t\t\tlet lineChange = lineChanges[i];\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, Number.MAX_VALUE),\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, Number.MAX_VALUE, DECORATIONS.charInsertWholeLine));\n\t\t\t\t}\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(\n\t\t\t\t\tlineChange.modifiedStartLineNumber,\n\t\t\t\t\tlineChange.modifiedEndLineNumber,\n\t\t\t\t\toverviewZoneColor\n\t\t\t\t));\n\n\t\t\t\tif (lineChange.charChanges) {\n\t\t\t\t\tfor (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) {\n\t\t\t\t\t\tlet charChange = lineChange.charChanges[j];\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(lineChanges: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[]) {\n\t\tsuper(lineChanges, originalForeignVZ, modifiedForeignVZ);\n\t}\n\n\tprotected _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(): HTMLDivElement | null {\n\t\treturn null;\n\t}\n\n\tprotected _produceOriginalFromDiff(lineChange: editorCommon.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: editorCommon.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 DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditorWidgetStyle {\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: editorOptions.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: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor, renderIndicators: boolean): IEditorsZones {\n\t\tlet computer = new InlineViewZonesComputer(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor, renderIndicators);\n\t\treturn computer.getViewZones();\n\t}\n\n\tprotected _getOriginalEditorDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorDiffDecorations {\n\t\tconst overviewZoneColor = this._removeColor.toString();\n\n\t\tlet result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tfor (let i = 0, length = lineChanges.length; i < length; i++) {\n\t\t\tlet lineChange = lineChanges[i];\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, Number.MAX_VALUE),\n\t\t\t\t\toptions: DECORATIONS.lineDeleteMargin\n\t\t\t\t});\n\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(\n\t\t\t\t\tlineChange.originalStartLineNumber,\n\t\t\t\t\tlineChange.originalEndLineNumber,\n\t\t\t\t\toverviewZoneColor\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected _getModifiedEditorDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor): IEditorDiffDecorations {\n\t\tconst overviewZoneColor = this._insertColor.toString();\n\n\t\tlet result: IEditorDiffDecorations = {\n\t\t\tdecorations: [],\n\t\t\toverviewZones: []\n\t\t};\n\n\t\tlet modifiedModel = modifiedEditor.getModel()!;\n\n\t\tfor (let i = 0, length = lineChanges.length; i < length; i++) {\n\t\t\tlet lineChange = lineChanges[i];\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, Number.MAX_VALUE),\n\t\t\t\t\toptions: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert)\n\t\t\t\t});\n\n\t\t\t\tresult.overviewZones.push(new OverviewRulerZone(\n\t\t\t\t\tlineChange.modifiedStartLineNumber,\n\t\t\t\t\tlineChange.modifiedEndLineNumber,\n\t\t\t\t\toverviewZoneColor\n\t\t\t\t));\n\n\t\t\t\tif (lineChange.charChanges) {\n\t\t\t\t\tfor (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) {\n\t\t\t\t\t\tlet charChange = lineChange.charChanges[j];\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, Number.MAX_VALUE, 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\nclass InlineViewZonesComputer extends ViewZonesComputer {\n\n\tprivate readonly originalModel: ITextModel;\n\tprivate readonly modifiedEditorConfiguration: editorOptions.InternalEditorOptions;\n\tprivate readonly modifiedEditorTabSize: number;\n\tprivate readonly renderIndicators: boolean;\n\n\tconstructor(lineChanges: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor, renderIndicators: boolean) {\n\t\tsuper(lineChanges, originalForeignVZ, modifiedForeignVZ);\n\t\tthis.originalModel = originalEditor.getModel()!;\n\t\tthis.modifiedEditorConfiguration = modifiedEditor.getConfiguration();\n\t\tthis.modifiedEditorTabSize = modifiedEditor.getModel()!.getOptions().tabSize;\n\t\tthis.renderIndicators = renderIndicators;\n\t}\n\n\tprotected _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(): HTMLDivElement | null {\n\t\tlet result = document.createElement('div');\n\t\tresult.className = 'inline-added-margin-view-zone';\n\t\treturn result;\n\t}\n\n\tprotected _produceOriginalFromDiff(lineChange: editorCommon.ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null {\n\t\tlet 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: editorCommon.ILineChange, lineChangeOriginalLength: number, lineChangeModifiedLength: number): IMyViewZone | null {\n\t\tlet decorations: InlineDecoration[] = [];\n\t\tif (lineChange.charChanges) {\n\t\t\tfor (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) {\n\t\t\t\tlet charChange = lineChange.charChanges[j];\n\t\t\t\tif (isChangeOrDelete(charChange)) {\n\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\tnew Range(charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn),\n\t\t\t\t\t\t'char-delete',\n\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet sb = createStringBuilder(10000);\n\t\tlet marginHTML: string[] = [];\n\t\tlet lineDecorationsWidth = this.modifiedEditorConfiguration.layoutInfo.decorationsWidth;\n\t\tlet lineHeight = this.modifiedEditorConfiguration.lineHeight;\n\t\tconst typicalHalfwidthCharacterWidth = this.modifiedEditorConfiguration.fontInfo.typicalHalfwidthCharacterWidth;\n\t\tlet maxCharsPerLine = 0;\n\t\tfor (let lineNumber = lineChange.originalStartLineNumber; lineNumber <= lineChange.originalEndLineNumber; lineNumber++) {\n\t\t\tmaxCharsPerLine = Math.max(maxCharsPerLine, this._renderOriginalLine(lineNumber - lineChange.originalStartLineNumber, this.originalModel, this.modifiedEditorConfiguration, this.modifiedEditorTabSize, lineNumber, decorations, sb));\n\n\t\t\tif (this.renderIndicators) {\n\t\t\t\tlet index = lineNumber - lineChange.originalStartLineNumber;\n\t\t\t\tmarginHTML = marginHTML.concat([\n\t\t\t\t\t`<div class=\"delete-sign\" style=\"position:absolute;top:${index * lineHeight}px;width:${lineDecorationsWidth}px;height:${lineHeight}px;right:0;\"></div>`\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t\tmaxCharsPerLine += this.modifiedEditorConfiguration.viewInfo.scrollBeyondLastColumn;\n\n\t\tlet domNode = document.createElement('div');\n\t\tdomNode.className = 'view-lines line-delete';\n\t\tdomNode.innerHTML = sb.build();\n\t\tConfiguration.applyFontInfoSlow(domNode, this.modifiedEditorConfiguration.fontInfo);\n\n\t\tlet marginDomNode = document.createElement('div');\n\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\tmarginDomNode.innerHTML = marginHTML.join('');\n\t\tConfiguration.applyFontInfoSlow(marginDomNode, this.modifiedEditorConfiguration.fontInfo);\n\n\t\treturn {\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: (maxCharsPerLine * typicalHalfwidthCharacterWidth),\n\t\t\tdomNode: domNode,\n\t\t\tmarginDomNode: marginDomNode\n\t\t};\n\t}\n\n\tprivate _renderOriginalLine(count: number, originalModel: ITextModel, config: editorOptions.InternalEditorOptions, tabSize: number, lineNumber: number, decorations: InlineDecoration[], sb: IStringBuilder): number {\n\t\tconst lineTokens = originalModel.getLineTokens(lineNumber);\n\t\tconst lineContent = lineTokens.getLineContent();\n\n\t\tconst actualDecorations = LineDecoration.filter(decorations, lineNumber, 1, lineContent.length + 1);\n\n\t\tsb.appendASCIIString('<div class=\"view-line');\n\t\tif (decorations.length === 0) {\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(count * config.lineHeight));\n\t\tsb.appendASCIIString('px;width:1000000px;\">');\n\n\t\tconst isBasicASCII = ViewLineRenderingData.isBasicASCII(lineContent, originalModel.mightContainNonBasicASCII());\n\t\tconst containsRTL = ViewLineRenderingData.containsRTL(lineContent, isBasicASCII, originalModel.mightContainRTL());\n\t\tconst output = renderViewLine(new RenderLineInput(\n\t\t\t(config.fontInfo.isMonospace && !config.viewInfo.disableMonospaceOptimizations),\n\t\t\tconfig.fontInfo.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\tactualDecorations,\n\t\t\ttabSize,\n\t\t\tconfig.fontInfo.spaceWidth,\n\t\t\tconfig.viewInfo.stopRenderingLineAfter,\n\t\t\tconfig.viewInfo.renderWhitespace,\n\t\t\tconfig.viewInfo.renderControlCharacters,\n\t\t\tconfig.viewInfo.fontLigatures\n\t\t), sb);\n\n\t\tsb.appendASCIIString('</div>');\n\n\t\tconst absoluteOffsets = output.characterMapping.getAbsoluteOffsets();\n\t\treturn absoluteOffsets.length > 0 ? absoluteOffsets[absoluteOffsets.length - 1] : 0;\n\t}\n}\n\nfunction isChangeOrInsert(lineChange: editorCommon.IChange): boolean {\n\treturn lineChange.modifiedEndLineNumber > 0;\n}\n\nfunction isChangeOrDelete(lineChange: editorCommon.IChange): boolean {\n\treturn lineChange.originalEndLineNumber > 0;\n}\n\nfunction createFakeLinesDiv(): HTMLElement {\n\tlet r = document.createElement('div');\n\tr.className = 'diagonal-fill';\n\treturn r;\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst added = theme.getColor(diffInserted);\n\tif (added) {\n\t\tcollector.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${added}; }`);\n\t\tcollector.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${added}; }`);\n\t\tcollector.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${added}; }`);\n\t}\n\n\tconst removed = theme.getColor(diffRemoved);\n\tif (removed) {\n\t\tcollector.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${removed}; }`);\n\t\tcollector.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${removed}; }`);\n\t\tcollector.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${removed}; }`);\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { IConfigurationChangedEvent, 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';\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) {\n\t\tsuper(domElement, parentEditor.getRawConfiguration(), {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService);\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: IConfigurationChangedEvent) => this._onParentConfigurationChanged(e)));\n\t}\n\n\tgetParentEditor(): ICodeEditor {\n\t\treturn this._parentEditor;\n\t}\n\n\tprivate _onParentConfigurationChanged(e: IConfigurationChangedEvent): void {\n\t\tsuper.updateOptions(this._parentEditor.getRawConfiguration());\n\t\tsuper.updateOptions(this._overwriteOptions);\n\t}\n\n\tupdateOptions(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 { 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 } 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/view/editorColorRegistry';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { Range } from 'vs/editor/common/core/range';\nimport { keys } from 'vs/base/common/map';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService';\nimport { Schemas } from 'vs/base/common/network';\nimport { Emitter } from 'vs/base/common/event';\nimport { withUndefinedAsNull } from 'vs/base/common/types';\n\nfunction MODEL_ID(resource: URI): string {\n\treturn resource.toString();\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(keys(this._markersData), []);\n\t\t\tthis._markersData.clear();\n\t\t}));\n\t}\n\n\tpublic update(markers: IMarker[], newDecorations: IModelDeltaDecoration[]): void {\n\t\tconst ids = this.model.deltaDecorations(keys(this._markersData), 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}\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\t_serviceBrand: any;\n\n\tprivate readonly _onDidChangeMarker = new Emitter<ITextModel>();\n\n\tprivate readonly _markerDecorations: Map<string, MarkerDecorations> = new Map<string, 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\tgetMarker(model: ITextModel, decoration: IModelDecoration): IMarker | null {\n\t\tconst markerDecorations = this._markerDecorations.get(MODEL_ID(model.uri));\n\t\treturn markerDecorations ? withUndefinedAsNull(markerDecorations.getMarker(decoration)) : null;\n\t}\n\n\tprivate _handleMarkerChange(changedResources: URI[]): void {\n\t\tchangedResources.forEach((resource) => {\n\t\t\tconst markerDecorations = this._markerDecorations.get(MODEL_ID(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_ID(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_ID(model.uri));\n\t\tif (markerDecorations) {\n\t\t\tmarkerDecorations.dispose();\n\t\t\tthis._markerDecorations.delete(MODEL_ID(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\tlet 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\tmarkerDecorations.update(markers, newModelDecorations);\n\t\tthis._onDidChangeMarker.fire(markerDecorations.model);\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) {\n\t\t\tif (!rawMarker.tags || rawMarker.tags.indexOf(MarkerTag.Unnecessary) === -1) {\n\t\t\t\t// * never render hints on multiple lines\n\t\t\t\t// * make enough space for three dots\n\t\t\t\tret = ret.setEndPosition(ret.startLineNumber, ret.startColumn + 2);\n\t\t\t}\n\t\t}\n\n\t\tret = model.validateRange(ret);\n\n\t\tif (ret.isEmpty()) {\n\t\t\tlet 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} else {\n\t\t\t\tlet maxColumn = model.getLineLastNonWhitespaceColumn(ret.startLineNumber) ||\n\t\t\t\t\tmodel.getLineMaxColumn(ret.startLineNumber);\n\n\t\t\t\tif (maxColumn === 1) {\n\t\t\t\t\t// empty line\n\t\t\t\t\t// console.warn('marker on empty line:', marker);\n\t\t\t\t} else if (ret.endColumn >= maxColumn) {\n\t\t\t\t\t// behind eol\n\t\t\t\t\tret = new Range(ret.startLineNumber, maxColumn - 1, ret.endLineNumber, maxColumn);\n\t\t\t\t} else {\n\t\t\t\t\t// extend marker to width = 1\n\t\t\t\t\tret = new Range(ret.startLineNumber, ret.startColumn, ret.endLineNumber, ret.endColumn + 1);\n\t\t\t\t}\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;\n\t\tlet color: ThemeColor | undefined = undefined;\n\t\tlet zIndex: number;\n\t\tlet inlineClassName: string | undefined = undefined;\n\n\t\tswitch (marker.severity) {\n\t\t\tcase MarkerSeverity.Hint:\n\t\t\t\tif (marker.tags && marker.tags.indexOf(MarkerTag.Unnecessary) >= 0) {\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\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\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}\n\n\t\treturn {\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\tzIndex,\n\t\t\tinlineClassName,\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!./bracketMatching';\nimport * as nls from 'vs/nls';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } 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 * as editorCommon 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/view/editorColorRegistry';\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';\nimport { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_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\tlet controller = BracketMatchingController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\t\tcontroller.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: null\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet controller = BracketMatchingController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\t\tcontroller.selectToBracket();\n\t}\n}\n\ntype Brackets = [Range, Range];\n\nclass BracketsData {\n\tpublic readonly position: Position;\n\tpublic readonly brackets: Brackets | null;\n\n\tconstructor(position: Position, brackets: Brackets | null) {\n\t\tthis.position = position;\n\t\tthis.brackets = brackets;\n\t}\n}\n\nexport class BracketMatchingController extends Disposable implements editorCommon.IEditorContribution {\n\tprivate static readonly ID = 'editor.contrib.bracketMatchingController';\n\n\tpublic static get(editor: ICodeEditor): BracketMatchingController {\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: boolean;\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.getConfiguration().contribInfo.matchBrackets;\n\n\t\tthis._updateBracketsSoon.schedule();\n\t\tthis._register(editor.onDidChangeCursorPosition((e) => {\n\n\t\t\tif (!this._matchBrackets) {\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\tthis._matchBrackets = this._editor.getConfiguration().contribInfo.matchBrackets;\n\t\t\tif (!this._matchBrackets && this._decorations.length > 0) {\n\t\t\t\t// Remove existing decorations if bracket matching is off\n\t\t\t\tthis._decorations = this._editor.deltaDecorations(this._decorations, []);\n\t\t\t}\n\t\t\tthis._updateBracketsSoon.schedule();\n\t\t}));\n\t}\n\n\tpublic getId(): string {\n\t\treturn BracketMatchingController.ID;\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.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 next bracket if the position isn't on a matching bracket\n\t\t\t\tconst nextBracket = model.findNextBracket(position);\n\t\t\t\tif (nextBracket && nextBracket.range) {\n\t\t\t\t\tnewCursorPosition = nextBracket.range.getStartPosition();\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(): 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.matchBracket(position);\n\n\t\t\tlet openBracket: Position | null = null;\n\t\t\tlet closeBracket: Position | null = null;\n\n\t\t\tif (!brackets) {\n\t\t\t\tconst nextBracket = model.findNextBracket(position);\n\t\t\t\tif (nextBracket && nextBracket.range) {\n\t\t\t\t\tbrackets = model.matchBracket(nextBracket.range.getStartPosition());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (brackets) {\n\t\t\t\tif (brackets[0].startLineNumber === brackets[1].startLineNumber) {\n\t\t\t\t\topenBracket = brackets[1].startColumn < brackets[0].startColumn ?\n\t\t\t\t\t\tbrackets[1].getStartPosition() : brackets[0].getStartPosition();\n\t\t\t\t\tcloseBracket = brackets[1].startColumn < brackets[0].startColumn ?\n\t\t\t\t\t\tbrackets[0].getEndPosition() : brackets[1].getEndPosition();\n\t\t\t\t} else {\n\t\t\t\t\topenBracket = brackets[1].startLineNumber < brackets[0].startLineNumber ?\n\t\t\t\t\t\tbrackets[1].getStartPosition() : brackets[0].getStartPosition();\n\t\t\t\t\tcloseBracket = brackets[1].startLineNumber < brackets[0].startLineNumber ?\n\t\t\t\t\t\tbrackets[0].getEndPosition() : brackets[1].getEndPosition();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (openBracket && closeBracket) {\n\t\t\t\tnewSelections.push(new Selection(openBracket.lineNumber, openBracket.column, closeBracket.lineNumber, closeBracket.column));\n\t\t\t}\n\t\t});\n\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\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\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 _updateBrackets(): void {\n\t\tif (!this._matchBrackets) {\n\t\t\treturn;\n\t\t}\n\t\tthis._recomputeBrackets();\n\n\t\tlet newDecorations: IModelDeltaDecoration[] = [], newDecorationsLen = 0;\n\t\tfor (let i = 0, len = this._lastBracketsData.length; i < len; i++) {\n\t\t\tlet brackets = this._lastBracketsData[i].brackets;\n\t\t\tif (brackets) {\n\t\t\t\tnewDecorations[newDecorationsLen++] = { range: brackets[0], options: BracketMatchingController._DECORATION_OPTIONS };\n\t\t\t\tnewDecorations[newDecorationsLen++] = { range: brackets[1], options: BracketMatchingController._DECORATION_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()) {\n\t\t\t// no model => no brackets!\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\tconst selections = this._editor.getSelections();\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.matchBracket(position);\n\t\t\t\tnewData[newDataLen++] = new BracketsData(position, brackets);\n\t\t\t}\n\t\t}\n\n\t\tthis._lastBracketsData = newData;\n\t\tthis._lastVersionId = versionId;\n\t}\n}\n\nregisterEditorContribution(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 * Copyright (c) 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!./codelensWidget';\nimport * as dom from 'vs/base/browser/dom';\nimport { coalesce, isFalsyOrEmpty } from 'vs/base/common/arrays';\nimport { escape } from 'vs/base/common/strings';\nimport * as editorBrowser 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 { Command, ICodeLensSymbol } from 'vs/editor/common/modes';\nimport { editorCodeLensForeground } from 'vs/editor/common/view/editorColorRegistry';\nimport { ICodeLensData } from 'vs/editor/contrib/codelens/codelens';\nimport { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\n\nclass CodeLensViewZone implements editorBrowser.IViewZone {\n\n\treadonly heightInLines: number;\n\treadonly suppressMouseDown: boolean;\n\treadonly domNode: HTMLElement;\n\n\tafterLineNumber: number;\n\n\tprivate _lastHeight?: number;\n\tprivate readonly _onHeight: Function;\n\n\tconstructor(afterLineNumber: number, onHeight: Function) {\n\t\tthis.afterLineNumber = afterLineNumber;\n\t\tthis._onHeight = onHeight;\n\n\t\tthis.heightInLines = 1;\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\nclass CodeLensContentWidget implements editorBrowser.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: editorBrowser.ICodeEditor;\n\tprivate readonly _commands = new Map<string, Command>();\n\n\tprivate _widgetPosition: editorBrowser.IContentWidgetPosition;\n\n\tconstructor(\n\t\teditor: editorBrowser.ICodeEditor,\n\t\tsymbolRange: Range,\n\t\tdata: ICodeLensData[]\n\t) {\n\t\tthis._id = 'codeLensWidget' + (++CodeLensContentWidget._idPool);\n\t\tthis._editor = editor;\n\n\t\tthis.setSymbolRange(symbolRange);\n\n\t\tthis._domNode = document.createElement('span');\n\t\tthis._domNode.innerHTML = ' ';\n\t\tdom.addClass(this._domNode, 'codelens-decoration');\n\t\tthis.updateHeight();\n\t\tthis.withCommands(data.map(data => data.symbol), false);\n\t}\n\n\tupdateHeight(): void {\n\t\tconst { fontInfo, lineHeight } = this._editor.getConfiguration();\n\t\tthis._domNode.style.height = `${Math.round(lineHeight * 1.1)}px`;\n\t\tthis._domNode.style.lineHeight = `${lineHeight}px`;\n\t\tthis._domNode.style.fontSize = `${Math.round(fontInfo.fontSize * 0.9)}px`;\n\t\tthis._domNode.style.paddingRight = `${Math.round(fontInfo.fontSize * 0.45)}px`;\n\t\tthis._domNode.innerHTML = ' ';\n\t}\n\n\twithCommands(inSymbols: Array<ICodeLensSymbol | undefined | null>, animate: boolean): void {\n\t\tthis._commands.clear();\n\n\t\tconst symbols = coalesce(inSymbols);\n\t\tif (isFalsyOrEmpty(symbols)) {\n\t\t\tthis._domNode.innerHTML = '<span>no commands</span>';\n\t\t\treturn;\n\t\t}\n\n\t\tlet html: string[] = [];\n\t\tfor (let i = 0; i < symbols.length; i++) {\n\t\t\tconst command = symbols[i].command;\n\t\t\tif (command) {\n\t\t\t\tconst title = escape(command.title);\n\t\t\t\tlet part: string;\n\t\t\t\tif (command.id) {\n\t\t\t\t\tpart = `<a id=${i}>${title}</a>`;\n\t\t\t\t\tthis._commands.set(String(i), command);\n\t\t\t\t} else {\n\t\t\t\t\tpart = `<span>${title}</span>`;\n\t\t\t\t}\n\t\t\t\thtml.push(part);\n\t\t\t}\n\t\t}\n\n\t\tconst wasEmpty = this._domNode.innerHTML === '' || this._domNode.innerHTML === ' ';\n\t\tthis._domNode.innerHTML = html.join('<span> | </span>');\n\t\tthis._editor.layoutContentWidget(this);\n\t\tif (wasEmpty && animate) {\n\t\t\tdom.addClass(this._domNode, 'fadein');\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\tsetSymbolRange(range: Range): void {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tconst lineNumber = range.startLineNumber;\n\t\tconst column = this._editor.getModel().getLineFirstNonWhitespaceColumn(lineNumber);\n\t\tthis._widgetPosition = {\n\t\t\tposition: { lineNumber: lineNumber, column: column },\n\t\t\tpreference: [editorBrowser.ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tgetPosition(): editorBrowser.IContentWidgetPosition {\n\t\treturn this._widgetPosition;\n\t}\n\n\tisVisible(): boolean {\n\t\treturn this._domNode.hasAttribute('monaco-visible-content-widget');\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 CodeLens {\n\n\tprivate readonly _editor: editorBrowser.ICodeEditor;\n\tprivate readonly _viewZone: CodeLensViewZone;\n\tprivate readonly _viewZoneId: number;\n\tprivate readonly _contentWidget: CodeLensContentWidget;\n\tprivate _decorationIds: string[];\n\tprivate _data: ICodeLensData[];\n\n\tconstructor(\n\t\tdata: ICodeLensData[],\n\t\teditor: editorBrowser.ICodeEditor,\n\t\thelper: CodeLensHelper,\n\t\tviewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor,\n\t\tupdateCallback: Function\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._data = data;\n\t\tthis._decorationIds = new Array<string>(this._data.length);\n\n\t\tlet range: Range | undefined;\n\t\tthis._data.forEach((codeLensData, i) => {\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\tif (range) {\n\t\t\tthis._contentWidget = new CodeLensContentWidget(editor, range, this._data);\n\t\t\tthis._viewZone = new CodeLensViewZone(range.startLineNumber - 1, updateCallback);\n\n\t\t\tthis._viewZoneId = viewZoneChangeAccessor.addZone(this._viewZone);\n\t\t\tthis._editor.addContentWidget(this._contentWidget);\n\t\t}\n\t}\n\n\tdispose(helper: CodeLensHelper, viewZoneChangeAccessor?: editorBrowser.IViewZoneChangeAccessor): void {\n\t\twhile (this._decorationIds.length) {\n\t\t\thelper.removeDecoration(this._decorationIds.pop()!);\n\t\t}\n\t\tif (viewZoneChangeAccessor) {\n\t\t\tviewZoneChangeAccessor.removeZone(this._viewZoneId);\n\t\t}\n\t\tthis._editor.removeContentWidget(this._contentWidget);\n\t}\n\n\tisValid(): boolean {\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn false;\n\t\t}\n\t\tconst model = this._editor.getModel();\n\t\treturn this._decorationIds.some((id, i) => {\n\t\t\tconst range = model.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: ICodeLensData[], helper: CodeLensHelper): void {\n\t\twhile (this._decorationIds.length) {\n\t\t\thelper.removeDecoration(this._decorationIds.pop()!);\n\t\t}\n\t\tthis._data = data;\n\t\tthis._decorationIds = new Array<string>(this._data.length);\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\tcomputeIfNecessary(model: ITextModel): ICodeLensData[] | null {\n\t\tif (!this._contentWidget.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<ICodeLensSymbol | undefined | null>): void {\n\t\tthis._contentWidget.withCommands(symbols, true);\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\tupdateHeight(): void {\n\t\tthis._contentWidget.updateHeight();\n\t}\n\n\tgetCommand(link: HTMLLinkElement): Command | undefined {\n\t\treturn this._contentWidget.getCommand(link);\n\t}\n\n\tgetLineNumber(): number {\n\t\tif (this._editor.hasModel()) {\n\t\t\tconst range = this._editor.getModel().getDecorationRange(this._decorationIds[0]);\n\t\t\tif (range) {\n\t\t\t\treturn range.startLineNumber;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tupdate(viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void {\n\t\tif (this.isValid() && this._editor.hasModel()) {\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\tthis._contentWidget.setSymbolRange(range);\n\t\t\t\tthis._editor.layoutContentWidget(this._contentWidget);\n\t\t\t}\n\t\t}\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst codeLensForeground = theme.getColor(editorCodeLensForeground);\n\tif (codeLensForeground) {\n\t\tcollector.addRule(`.monaco-editor .codelens-decoration { color: ${codeLensForeground}; }`);\n\t}\n\tconst activeLinkForeground = theme.getColor(editorActiveLinkForeground);\n\tif (activeLinkForeground) {\n\t\tcollector.addRule(`.monaco-editor .codelens-decoration > a:hover { 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 { CancelablePromise, RunOnceScheduler, createCancelablePromise, disposableTimeout } from 'vs/base/common/async';\nimport { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';\nimport { StableEditorScrollState } from 'vs/editor/browser/core/editorState';\nimport * as editorBrowser from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IModelDecorationsChangeAccessor } from 'vs/editor/common/model';\nimport { CodeLensProviderRegistry, ICodeLensSymbol } from 'vs/editor/common/modes';\nimport { ICodeLensData, getCodeLensData } from 'vs/editor/contrib/codelens/codelens';\nimport { CodeLens, CodeLensHelper } from 'vs/editor/contrib/codelens/codelensWidget';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { ICodeLensCache } from 'vs/editor/contrib/codelens/codeLensCache';\n\nexport class CodeLensContribution implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID: string = 'css.editor.codeLens';\n\n\tprivate _isEnabled: boolean;\n\n\tprivate _globalToDispose: IDisposable[];\n\tprivate _localToDispose: IDisposable[];\n\tprivate _lenses: CodeLens[];\n\tprivate _currentFindCodeLensSymbolsPromise: CancelablePromise<ICodeLensData[]> | null;\n\tprivate _modelChangeCounter: number;\n\tprivate _currentResolveCodeLensSymbolsPromise: CancelablePromise<any> | null;\n\tprivate _detectVisibleLenses: RunOnceScheduler;\n\n\tconstructor(\n\t\tprivate readonly _editor: editorBrowser.ICodeEditor,\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._isEnabled = this._editor.getConfiguration().contribInfo.codeLens;\n\n\t\tthis._globalToDispose = [];\n\t\tthis._localToDispose = [];\n\t\tthis._lenses = [];\n\t\tthis._currentFindCodeLensSymbolsPromise = null;\n\t\tthis._modelChangeCounter = 0;\n\n\t\tthis._globalToDispose.push(this._editor.onDidChangeModel(() => this._onModelChange()));\n\t\tthis._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this._onModelChange()));\n\t\tthis._globalToDispose.push(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {\n\t\t\tlet prevIsEnabled = this._isEnabled;\n\t\t\tthis._isEnabled = this._editor.getConfiguration().contribInfo.codeLens;\n\t\t\tif (prevIsEnabled !== this._isEnabled) {\n\t\t\t\tthis._onModelChange();\n\t\t\t}\n\t\t}));\n\t\tthis._globalToDispose.push(CodeLensProviderRegistry.onDidChange(this._onModelChange, this));\n\t\tthis._onModelChange();\n\t}\n\n\tdispose(): void {\n\t\tthis._localDispose();\n\t\tthis._globalToDispose = dispose(this._globalToDispose);\n\t}\n\n\tprivate _localDispose(): void {\n\t\tif (this._currentFindCodeLensSymbolsPromise) {\n\t\t\tthis._currentFindCodeLensSymbolsPromise.cancel();\n\t\t\tthis._currentFindCodeLensSymbolsPromise = null;\n\t\t\tthis._modelChangeCounter++;\n\t\t}\n\t\tif (this._currentResolveCodeLensSymbolsPromise) {\n\t\t\tthis._currentResolveCodeLensSymbolsPromise.cancel();\n\t\t\tthis._currentResolveCodeLensSymbolsPromise = null;\n\t\t}\n\t\tthis._localToDispose = dispose(this._localToDispose);\n\t}\n\n\tgetId(): string {\n\t\treturn CodeLensContribution.ID;\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._isEnabled) {\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 (!CodeLensProviderRegistry.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.push(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 CodeLensProviderRegistry.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.push(registration);\n\t\t\t}\n\t\t}\n\n\t\tthis._detectVisibleLenses = new RunOnceScheduler(() => {\n\t\t\tthis._onViewportChanged();\n\t\t}, 250);\n\n\t\tconst scheduler = new RunOnceScheduler(() => {\n\t\t\tconst counterValue = ++this._modelChangeCounter;\n\t\t\tif (this._currentFindCodeLensSymbolsPromise) {\n\t\t\t\tthis._currentFindCodeLensSymbolsPromise.cancel();\n\t\t\t}\n\n\t\t\tthis._currentFindCodeLensSymbolsPromise = createCancelablePromise(token => getCodeLensData(model, token));\n\n\t\t\tthis._currentFindCodeLensSymbolsPromise.then(result => {\n\t\t\t\tif (counterValue === this._modelChangeCounter) { // only the last one wins\n\t\t\t\t\tthis._codeLensCache.put(model, result);\n\t\t\t\t\tthis._renderCodeLensSymbols(result);\n\t\t\t\t\tthis._detectVisibleLenses.schedule();\n\t\t\t\t}\n\t\t\t}, onUnexpectedError);\n\t\t}, 250);\n\t\tthis._localToDispose.push(scheduler);\n\t\tthis._localToDispose.push(this._detectVisibleLenses);\n\t\tthis._localToDispose.push(this._editor.onDidChangeModelContent((e) => {\n\t\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\t\tthis._editor.changeViewZones((viewAccessor) => {\n\t\t\t\t\tlet toDispose: CodeLens[] = [];\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(viewAccessor);\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, viewAccessor);\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(changeAccessor);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Compute new `visible` code lenses\n\t\t\tthis._detectVisibleLenses.schedule();\n\t\t\t// Ask for all references again\n\t\t\tscheduler.schedule();\n\t\t}));\n\t\tthis._localToDispose.push(this._editor.onDidScrollChange(e => {\n\t\t\tif (e.scrollTopChanged && this._lenses.length > 0) {\n\t\t\t\tthis._detectVisibleLenses.schedule();\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.push(this._editor.onDidLayoutChange(e => {\n\t\t\tthis._detectVisibleLenses.schedule();\n\t\t}));\n\t\tthis._localToDispose.push(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((changeAccessor) => {\n\t\t\t\t\tthis._editor.changeViewZones((accessor) => {\n\t\t\t\t\t\tthis._disposeAllLenses(changeAccessor, accessor);\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.push(this._editor.onDidChangeConfiguration(e => {\n\t\t\tif (e.fontInfo) {\n\t\t\t\tfor (const lens of this._lenses) {\n\t\t\t\t\tlens.updateHeight();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t\tthis._localToDispose.push(this._editor.onMouseUp(e => {\n\t\t\tif (e.target.type === editorBrowser.MouseTargetType.CONTENT_WIDGET && e.target.element && e.target.element.tagName === 'A') {\n\t\t\t\tfor (const lens of this._lenses) {\n\t\t\t\t\tlet command = lens.getCommand(e.target.element 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: editorBrowser.IViewZoneChangeAccessor | undefined): void {\n\t\tlet helper = new CodeLensHelper();\n\t\tthis._lenses.forEach((lens) => lens.dispose(helper, viewZoneChangeAccessor));\n\t\tif (decChangeAccessor) {\n\t\t\thelper.commit(decChangeAccessor);\n\t\t}\n\t\tthis._lenses = [];\n\t}\n\n\tprivate _renderCodeLensSymbols(symbols: ICodeLensData[]): 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: ICodeLensData[][] = [];\n\t\tlet lastGroup: ICodeLensData[] | undefined;\n\n\t\tfor (let symbol of symbols) {\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\n\t\tthis._editor.changeDecorations((changeAccessor) => {\n\t\t\tthis._editor.changeViewZones((accessor) => {\n\n\t\t\t\tlet codeLensIndex = 0, groupsIndex = 0, helper = new CodeLensHelper();\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, accessor);\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 CodeLens(groups[groupsIndex], this._editor, helper, accessor, () => this._detectVisibleLenses.schedule()));\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, accessor);\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 CodeLens(groups[groupsIndex], this._editor, helper, accessor, () => this._detectVisibleLenses.schedule()));\n\t\t\t\t\tgroupsIndex++;\n\t\t\t\t}\n\n\t\t\t\thelper.commit(changeAccessor);\n\t\t\t});\n\t\t});\n\n\t\tscrollState.restore(this._editor);\n\t}\n\n\tprivate _onViewportChanged(): void {\n\t\tif (this._currentResolveCodeLensSymbolsPromise) {\n\t\t\tthis._currentResolveCodeLensSymbolsPromise.cancel();\n\t\t\tthis._currentResolveCodeLensSymbolsPromise = null;\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\tconst toResolve: ICodeLensData[][] = [];\n\t\tconst lenses: CodeLens[] = [];\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\tthis._currentResolveCodeLensSymbolsPromise = createCancelablePromise(token => {\n\n\t\t\tconst promises = toResolve.map((request, i) => {\n\n\t\t\t\tconst resolvedSymbols = new Array<ICodeLensSymbol | 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\tlenses[i].updateCommands(resolvedSymbols);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn Promise.all(promises);\n\t\t});\n\n\t\tthis._currentResolveCodeLensSymbolsPromise.then(() => {\n\t\t\tthis._currentResolveCodeLensSymbolsPromise = null;\n\t\t}).catch(err => {\n\t\t\tthis._currentResolveCodeLensSymbolsPromise = null;\n\t\t\tonUnexpectedError(err);\n\t\t});\n\t}\n}\n\nregisterEditorContribution(CodeLensContribution);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./colorPicker';\nimport { onDidChangeZoomLevel } 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 { ColorPickerModel } from 'vs/editor/contrib/colorPicker/colorPickerModel';\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 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.getTheme().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\tdom.toggleClass(this.pickedColorNode, 'light', model.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : model.color.isLighter());\n\t}\n\n\tprivate onDidChangeColor(color: Color): void {\n\t\tthis.pickedColorNode.style.backgroundColor = Color.Format.CSS.format(color);\n\t\tdom.toggleClass(this.pickedColorNode, '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}\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 _onDidChange = new Emitter<{ s: number, v: number }>();\n\treadonly onDidChange: Event<{ s: number, v: number }> = this._onDidChange.event;\n\n\tprivate _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.addDisposableListener(this.domNode, dom.EventType.MOUSE_DOWN, 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(standardMouseMoveMerger, event => this.onDidChangePosition(event.posx - origin.left, event.posy - origin.top), () => null);\n\n\t\tconst mouseUpListener = dom.addDisposableListener(document, dom.EventType.MOUSE_UP, () => {\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 _onDidChange = new Emitter<number>();\n\treadonly onDidChange: Event<number> = this._onDidChange.event;\n\n\tprivate _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.addDisposableListener(this.domNode, dom.EventType.MOUSE_DOWN, 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\tdom.addClass(this.domNode, 'grabbing');\n\n\t\tif (e.target !== this.slider) {\n\t\t\tthis.onDidChangeTop(e.offsetY);\n\t\t}\n\n\t\tmonitor.startMonitoring(standardMouseMoveMerger, event => this.onDidChangeTop(event.posy - origin.top), () => null);\n\n\t\tconst mouseUpListener = dom.addDisposableListener(document, dom.EventType.MOUSE_UP, () => {\n\t\t\tthis._onColorFlushed.fire();\n\t\t\tmouseUpListener.dispose();\n\t\t\tmonitor.stopMonitoring(true);\n\t\t\tdom.removeClass(this.domNode, '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\tdom.addClass(this.domNode, '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\tdom.addClass(this.domNode, '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 {\n\n\tbody: ColorPickerBody;\n\n\tconstructor(container: Node, private readonly model: ColorPickerModel, private pixelRatio: number, themeService: IThemeService) {\n\t\tsuper();\n\n\t\tthis._register(onDidChangeZoomLevel(() => 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 { 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, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { 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 _findScopeDecorationId: string | null;\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._findScopeDecorationId = null;\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._findScopeDecorationId = null;\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._findScopeDecorationId = null;\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\tpublic getFindScope(): Range | null {\n\t\tif (this._findScopeDecorationId) {\n\t\t\treturn this._editor.getModel().getDecorationRange(this._findScopeDecorationId);\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\treturn 1;\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[], findScope: 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._findScopeDecorationId) {\n\t\t\t\taccessor.removeDecoration(this._findScopeDecorationId);\n\t\t\t\tthis._findScopeDecorationId = null;\n\t\t\t}\n\t\t\tif (findScope) {\n\t\t\t\tthis._findScopeDecorationId = 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._findScopeDecorationId) {\n\t\t\tresult.push(this._findScopeDecorationId);\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\tprivate static readonly _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({\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});\n\n\tprivate static readonly _FIND_MATCH_DECORATION = ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\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});\n\n\tprivate static readonly _FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({\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\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\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\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 { RunOnceScheduler, TimeoutTimer } from 'vs/base/common/async';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/common/commands/replaceCommand';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/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 { Constants } from 'vs/editor/common/core/uint';\nimport * as editorCommon 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/findDecorations';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';\nimport { ReplaceAllCommand } from 'vs/editor/contrib/find/replaceAllCommand';\nimport { ReplacePattern, parseReplaceString } from 'vs/editor/contrib/find/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);\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.KEY_C,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_C }\n};\nexport const ToggleWholeWordKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KEY_W,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_W }\n};\nexport const ToggleRegexKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KEY_R,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_R }\n};\nexport const ToggleSearchScopeKeybinding: IKeybindings = {\n\tprimary: KeyMod.Alt | KeyCode.KEY_L,\n\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_L }\n};\n\nexport const FIND_IDS = {\n\tStartFindAction: 'actions.find',\n\tStartFindWithSelection: 'actions.findWithSelection',\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\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 _toDispose: IDisposable[];\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._toDispose = [];\n\t\tthis._isDisposed = false;\n\t\tthis._startSearchingTimer = new TimeoutTimer();\n\n\t\tthis._decorations = new FindDecorations(editor);\n\t\tthis._toDispose.push(this._decorations);\n\n\t\tthis._updateDecorationsScheduler = new RunOnceScheduler(() => this.research(false), 100);\n\t\tthis._toDispose.push(this._updateDecorationsScheduler);\n\n\t\tthis._toDispose.push(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.push(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.push(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(this._toDispose);\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 | null): void {\n\t\tlet findScope: Range | null = null;\n\t\tif (typeof newFindScope !== 'undefined') {\n\t\t\tfindScope = newFindScope;\n\t\t} else {\n\t\t\tfindScope = this._decorations.getFindScope();\n\t\t}\n\t\tif (findScope !== null) {\n\t\t\tif (findScope.startLineNumber !== findScope.endLineNumber) {\n\t\t\t\tif (findScope.endColumn === 1) {\n\t\t\t\t\tfindScope = new Range(findScope.startLineNumber, 1, findScope.endLineNumber - 1, this._editor.getModel().getLineMaxColumn(findScope.endLineNumber - 1));\n\t\t\t\t} else {\n\t\t\t\t\t// multiline find scope => expand to line starts / ends\n\t\t\t\t\tfindScope = new Range(findScope.startLineNumber, 1, findScope.endLineNumber, this._editor.getModel().getLineMaxColumn(findScope.endLineNumber));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet findMatches = this._findMatches(findScope, false, MATCHES_LIMIT);\n\t\tthis._decorations.set(findMatches, findScope);\n\n\t\tthis._state.changeMatchInfo(\n\t\t\tthis._decorations.getCurrentMatchesPosition(this._editor.getSelection()),\n\t\t\tthis._decorations.getCount(),\n\t\t\tundefined\n\t\t);\n\n\t\tif (moveCursor) {\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, editorCommon.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, editorCommon.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._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.getConfiguration().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.getConfiguration().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._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.getConfiguration().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.getConfiguration().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(), replacePattern.hasReplacementPatterns, 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);\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(findScope: Range | null, captureMatches: boolean, limitResultCount: number): FindMatch[] {\n\t\tlet searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope);\n\t\treturn this._editor.getModel().findMatches(this._state.searchString, searchRange, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getConfiguration().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 findScope = this._decorations.getFindScope();\n\n\t\tif (findScope === 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(findScope);\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.getConfiguration().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 = 'm';\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\tif (replacePattern.hasReplacementPatterns) {\n\t\t\tresultText = modelText.replace(searchRegex, function () {\n\t\t\t\treturn replacePattern.buildReplaceString(<string[]><any>arguments);\n\t\t\t});\n\t\t} else {\n\t\t\tresultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null));\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(findScope: 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(findScope, replacePattern.hasReplacementPatterns, 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);\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 findScope = this._decorations.getFindScope();\n\n\t\t// Get all the ranges (even more than the highlighted ones)\n\t\tlet matches = this._findMatches(findScope, 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: editorCommon.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/findModel';\nimport { FindReplaceState } from 'vs/editor/contrib/find/findState';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { contrastBorder, editorWidgetBackground, inputActiveOptionBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { ITheme, 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.getTheme().getColor(inputActiveOptionBorder);\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}));\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}));\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}));\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.getTheme());\n\t\tthis._register(themeService.onThemeChange(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 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: ITheme) {\n\t\tlet inputStyles = { inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) };\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 widgetShadowColor = theme.getColor(widgetShadow);\n\tif (widgetShadowColor) {\n\t\tcollector.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 2px 8px ${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 * Copyright (c) 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!./findWidget';\nimport * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';\nimport { FindInput, IFindInputStyles } from 'vs/base/browser/ui/findinput/findInput';\nimport { HistoryInputBox, IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox';\nimport { IHorizontalSashLayoutProvider, ISashEvent, 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 { 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 { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { IConfigurationChangedEvent } 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/findModel';\nimport { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { contrastBorder, editorFindMatch, editorFindMatchBorder, editorFindMatchHighlight, editorFindMatchHighlightBorder, editorFindRangeHighlight, editorFindRangeHighlightBorder, editorWidgetBackground, editorWidgetBorder, editorWidgetResizeBorder, errorForeground, inputActiveOptionBorder, inputBackground, inputBorder, inputForeground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationInfoForeground, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationWarningForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';\nimport { ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { ContextScopedFindInput, ContextScopedHistoryInputBox } from 'vs/platform/browser/contextScopedHistoryWidget';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\n\nexport interface IFindController {\n\treplace(): void;\n\treplaceAll(): void;\n\tgetGlobalBufferTerm(): 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 mode\");\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);\nconst NLS_MATCHES_LOCATION = nls.localize('label.matchesLocation', \"{0} of {1}\");\nconst NLS_NO_RESULTS = nls.localize('label.noResults', \"No Results\");\n\nconst FIND_WIDGET_INITIAL_WIDTH = 411;\nconst PART_WIDTH = 275;\nconst FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54;\nconst REPLACE_INPUT_AREA_WIDTH = FIND_INPUT_AREA_WIDTH;\n\nlet MAX_MATCHES_COUNT_WIDTH = 69;\nlet 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 = 34; // The height of Find Widget when Replace Input is not visible.\nconst FIND_REPLACE_AREA_HEIGHT = 64; // The height of Find Widget when Replace Input is visible.\n\n\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\nexport class FindWidget extends Widget implements IOverlayWidget, IHorizontalSashLayoutProvider {\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\n\tprivate _domNode: HTMLElement;\n\tprivate _findInput: FindInput;\n\tprivate _replaceInputBox: HistoryInputBox;\n\n\tprivate _toggleReplaceBtn: SimpleButton;\n\tprivate _matchesCount: HTMLElement;\n\tprivate _prevBtn: SimpleButton;\n\tprivate _nextBtn: SimpleButton;\n\tprivate _toggleSelectionFind: SimpleCheckbox;\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\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?: number;\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) {\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\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\n\t\tthis._register(this._codeEditor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {\n\t\t\tif (e.readOnly) {\n\t\t\t\tif (this._codeEditor.getConfiguration().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.layoutInfo) {\n\t\t\t\tthis._tryUpdateWidgetWidth();\n\t\t\t}\n\n\t\t\tif (e.accessibilitySupport) {\n\t\t\t\tthis.updateAccessibilitySupport();\n\t\t\t}\n\n\t\t\tif (e.contribInfo) {\n\t\t\t\tconst addExtraSpaceOnTop = this._codeEditor.getConfiguration().contribInfo.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(() => {\n\t\t\tif (this._isVisible) {\n\t\t\t\tlet globalBufferTerm = this._controller.getGlobalBufferTerm();\n\t\t\t\tif (globalBufferTerm && globalBufferTerm !== this._state.searchString) {\n\t\t\t\t\tthis._state.change({ searchString: globalBufferTerm }, true);\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._replaceInputBox.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.getConfiguration().contribInfo.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.getTheme());\n\t\tthis._register(themeService.onThemeChange(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\tif (this._viewZoneId === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._codeEditor.changeViewZones((accessor) => {\n\t\t\t\tif (this._viewZoneId) {\n\t\t\t\t\taccessor.removeZone(this._viewZoneId);\n\t\t\t\t}\n\t\t\t\tthis._viewZoneId = undefined;\n\t\t\t});\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._replaceInputBox.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.getConfiguration().readOnly && !this._isReplaceVisible) {\n\t\t\t\t\tthis._isReplaceVisible = true;\n\t\t\t\t\tthis._replaceInputBox.width = this._findInput.inputBox.width;\n\t\t\t\t\tthis._updateButtons();\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.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.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\tdom.toggleClass(this._domNode, '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}\n\n\tprivate _delayedUpdateHistory() {\n\t\tthis._updateHistoryDelayer.trigger(this._updateHistory.bind(this));\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._replaceInputBox.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\t\tthis._matchesCount.appendChild(document.createTextNode(label));\n\n\t\tMAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth);\n\t}\n\n\t// ----- actions\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\tthis._toggleSelectionFind.setEnabled(this._isVisible && (isChecked || isSelection));\n\t}\n\n\tprivate _updateButtons(): void {\n\t\tthis._findInput.setEnabled(this._isVisible);\n\t\tthis._replaceInputBox.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);\n\t\tthis._nextBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount);\n\t\tthis._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);\n\t\tthis._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);\n\n\t\tdom.toggleClass(this._domNode, 'replaceToggled', this._isReplaceVisible);\n\t\tthis._toggleReplaceBtn.toggleClass('collapse', !this._isReplaceVisible);\n\t\tthis._toggleReplaceBtn.toggleClass('expand', this._isReplaceVisible);\n\t\tthis._toggleReplaceBtn.setExpanded(this._isReplaceVisible);\n\n\t\tlet canReplace = !this._codeEditor.getConfiguration().readOnly;\n\t\tthis._toggleReplaceBtn.setEnabled(this._isVisible && canReplace);\n\t}\n\n\tprivate _reveal(): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\n\t\t\tconst selection = this._codeEditor.getSelection();\n\t\t\tconst isSelection = selection ? (selection.startLineNumber !== selection.endLineNumber || selection.startColumn !== selection.endColumn) : false;\n\t\t\tif (isSelection && this._codeEditor.getConfiguration().contribInfo.find.autoFindInSelection) {\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._tryUpdateWidgetWidth();\n\t\t\tthis._updateButtons();\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tdom.addClass(this._domNode, '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\tsetTimeout(() => {\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.getConfiguration().contribInfo.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\tif (this._isVisible) {\n\t\t\tthis._isVisible = false;\n\n\t\t\tthis._updateButtons();\n\n\t\t\tdom.removeClass(this._domNode, '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() {\n\t\tconst addExtraSpaceOnTop = this._codeEditor.getConfiguration().contribInfo.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\tif (this._state.isReplaceRevealed) {\n\t\t\t\tviewZone.heightInPx = FIND_REPLACE_AREA_HEIGHT;\n\t\t\t} else {\n\t\t\t\tviewZone.heightInPx = FIND_INPUT_AREA_HEIGHT;\n\t\t\t}\n\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(this._codeEditor.getScrollTop() + viewZone.heightInPx);\n\t\t});\n\t}\n\n\tprivate _showViewZone(adjustScroll: boolean = true) {\n\t\tconst viewZone = this._viewZone;\n\t\tif (!this._isVisible || !viewZone) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._codeEditor.changeViewZones((accessor) => {\n\t\t\tlet scrollAdjustment = FIND_INPUT_AREA_HEIGHT;\n\n\t\t\tif (this._viewZoneId !== undefined) {\n\t\t\t\tif (this._state.isReplaceRevealed) {\n\t\t\t\t\tviewZone.heightInPx = FIND_REPLACE_AREA_HEIGHT;\n\t\t\t\t\tscrollAdjustment = FIND_REPLACE_AREA_HEIGHT - FIND_INPUT_AREA_HEIGHT;\n\t\t\t\t} else {\n\t\t\t\t\tviewZone.heightInPx = FIND_INPUT_AREA_HEIGHT;\n\t\t\t\t\tscrollAdjustment = FIND_INPUT_AREA_HEIGHT - FIND_REPLACE_AREA_HEIGHT;\n\t\t\t\t}\n\t\t\t\taccessor.removeZone(this._viewZoneId);\n\t\t\t} else {\n\t\t\t\tviewZone.heightInPx = FIND_INPUT_AREA_HEIGHT;\n\t\t\t}\n\t\t\tthis._viewZoneId = accessor.addZone(viewZone);\n\n\t\t\tif (adjustScroll) {\n\t\t\t\tthis._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment);\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: ITheme) {\n\t\tlet inputStyles: IFindInputStyles = {\n\t\t\tinputActiveOptionBorder: theme.getColor(inputActiveOptionBorder),\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._replaceInputBox.style(inputStyles);\n\t}\n\n\tprivate _tryUpdateWidgetWidth() {\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tlet editorWidth = this._codeEditor.getConfiguration().layoutInfo.width;\n\t\tlet minimapWidth = this._codeEditor.getConfiguration().layoutInfo.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._replaceInputBox.inputElement.style.width = `${dom.getTotalWidth(this._findInput.inputBox.inputElement)}px`;\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\tdom.toggleClass(this._domNode, 'collapsed-find-widget', collapsedFindWidget);\n\t\tdom.toggleClass(this._domNode, 'narrow-find-widget', narrowFindWidget);\n\t\tdom.toggleClass(this._domNode, '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\tlet findInputWidth = dom.getTotalWidth(this._findInput.inputBox.inputElement);\n\t\t\tif (findInputWidth > 0) {\n\t\t\t\tthis._replaceInputBox.inputElement.style.width = `${findInputWidth}px`;\n\t\t\t}\n\t\t}\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._replaceInputBox.select();\n\t\t// Edge browser requires focus() in addition to select()\n\t\tthis._replaceInputBox.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 selection = this._codeEditor.getSelection();\n\t\t\tif (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {\n\t\t\t\tselection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1));\n\t\t\t}\n\t\t\tconst currentMatch = this._state.currentMatch;\n\t\t\tif (selection.startLineNumber !== selection.endLineNumber) {\n\t\t\t\tif (!Range.equalsRange(selection, currentMatch)) {\n\t\t\t\t\t// Reseed find scope\n\t\t\t\t\tthis._state.change({ searchScope: selection }, true);\n\t\t\t\t}\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\n\t\tif (e.equals(KeyCode.Enter)) {\n\t\t\tthis._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(undefined, onUnexpectedError);\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyMod.Shift | KeyCode.Enter)) {\n\t\t\tthis._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(undefined, onUnexpectedError);\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyCode.Tab)) {\n\t\t\tif (this._isReplaceVisible) {\n\t\t\t\tthis._replaceInputBox.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\t}\n\n\tprivate _onReplaceInputKeyDown(e: IKeyboardEvent): void {\n\n\t\tif (e.equals(KeyCode.Enter)) {\n\t\t\tthis._controller.replace();\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.equals(KeyMod.CtrlCmd | KeyCode.Enter)) {\n\t\t\tthis._controller.replaceAll();\n\t\t\te.preventDefault();\n\t\t\treturn;\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\t}\n\n\t// ----- sash\n\tpublic getHorizontalSashTop(_sash: Sash): number {\n\t\treturn 0;\n\t}\n\tpublic getHorizontalSashLeft?(_sash: Sash): number {\n\t\treturn 0;\n\t}\n\tpublic getHorizontalSashWidth?(_sash: Sash): number {\n\t\treturn 500;\n\t}\n\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 _buildFindPart(): HTMLElement {\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/* tslint:disable-next-line:no-unused-expression */\n\t\t\t\t\tnew RegExp(value);\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}, 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._replaceInputBox.focus();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\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\tclassName: 'previous',\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\tclassName: 'next',\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\tfindPart.appendChild(this._matchesCount);\n\t\tfindPart.appendChild(this._prevBtn.domNode);\n\t\tfindPart.appendChild(this._nextBtn.domNode);\n\n\t\t// Toggle selection button\n\t\tthis._toggleSelectionFind = this._register(new SimpleCheckbox({\n\t\t\tparent: findPart,\n\t\t\ttitle: NLS_TOGGLE_SELECTION_FIND_TITLE + this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand),\n\t\t\tonChange: () => {\n\t\t\t\tif (this._toggleSelectionFind.checked) {\n\t\t\t\t\tif (this._codeEditor.hasModel()) {\n\t\t\t\t\t\tlet selection = this._codeEditor.getSelection();\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\tthis._state.change({ searchScope: selection }, true);\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._state.change({ searchScope: null }, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\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\tclassName: 'close-fw',\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\tfindPart.appendChild(this._closeBtn.domNode);\n\n\t\treturn findPart;\n\t}\n\n\tprivate _buildReplacePart(): HTMLElement {\n\t\t// Replace input\n\t\tlet replaceInput = document.createElement('div');\n\t\treplaceInput.className = 'replace-input';\n\t\treplaceInput.style.width = REPLACE_INPUT_AREA_WIDTH + 'px';\n\t\tthis._replaceInputBox = this._register(new ContextScopedHistoryInputBox(replaceInput, undefined, {\n\t\t\tariaLabel: NLS_REPLACE_INPUT_LABEL,\n\t\t\tplaceholder: NLS_REPLACE_INPUT_PLACEHOLDER,\n\t\t\thistory: []\n\t\t}, this._contextKeyService));\n\n\n\t\tthis._register(dom.addStandardDisposableListener(this._replaceInputBox.inputElement, 'keydown', (e) => this._onReplaceInputKeyDown(e)));\n\t\tthis._register(this._replaceInputBox.onDidChange(() => {\n\t\t\tthis._state.change({ replaceString: this._replaceInputBox.value }, false);\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\tclassName: 'replace',\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\tclassName: 'replace-all',\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(replaceInput);\n\t\treplacePart.appendChild(this._replaceBtn.domNode);\n\t\treplacePart.appendChild(this._replaceAllBtn.domNode);\n\n\t\treturn replacePart;\n\t}\n\n\tprivate _buildDomNode(): void {\n\t\t// Find part\n\t\tlet findPart = this._buildFindPart();\n\n\t\t// Replace part\n\t\tlet replacePart = this._buildReplacePart();\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: '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._replaceInputBox.width = this._findInput.inputBox.width;\n\t\t\t\t}\n\t\t\t\tthis._showViewZone();\n\t\t\t}\n\t\t}));\n\t\tthis._toggleReplaceBtn.toggleClass('expand', this._isReplaceVisible);\n\t\tthis._toggleReplaceBtn.toggleClass('collapse', !this._isReplaceVisible);\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._buildSash();\n\t}\n\n\tprivate _buildSash() {\n\t\tthis._resizeSash = new Sash(this._domNode, this, { orientation: Orientation.VERTICAL });\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 inputBoxWidth = width - FIND_ALL_CONTROLS_WIDTH;\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._replaceInputBox.width = inputBoxWidth;\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate updateAccessibilitySupport(): void {\n\t\tconst value = this._codeEditor.getConfiguration().accessibilitySupport;\n\t\tthis._findInput.setFocusInputOnOptionClick(value !== AccessibilitySupport.Enabled);\n\t}\n}\n\ninterface ISimpleCheckboxOpts {\n\treadonly parent: HTMLElement;\n\treadonly title: string;\n\treadonly onChange: () => void;\n}\n\nclass SimpleCheckbox extends Widget {\n\n\tprivate static _COUNTER = 0;\n\n\tprivate readonly _opts: ISimpleCheckboxOpts;\n\tprivate readonly _domNode: HTMLElement;\n\tprivate readonly _checkbox: HTMLInputElement;\n\tprivate readonly _label: HTMLLabelElement;\n\n\tconstructor(opts: ISimpleCheckboxOpts) {\n\t\tsuper();\n\t\tthis._opts = opts;\n\n\t\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.className = 'monaco-checkbox';\n\t\tthis._domNode.title = this._opts.title;\n\t\tthis._domNode.tabIndex = 0;\n\n\t\tthis._checkbox = document.createElement('input');\n\t\tthis._checkbox.type = 'checkbox';\n\t\tthis._checkbox.className = 'checkbox';\n\t\tthis._checkbox.id = 'checkbox-' + SimpleCheckbox._COUNTER++;\n\t\tthis._checkbox.tabIndex = -1;\n\n\t\tthis._label = document.createElement('label');\n\t\tthis._label.className = 'label';\n\t\t// Connect the label and the checkbox. Checkbox will get checked when the label receives a click.\n\t\tthis._label.htmlFor = this._checkbox.id;\n\t\tthis._label.tabIndex = -1;\n\n\t\tthis._domNode.appendChild(this._checkbox);\n\t\tthis._domNode.appendChild(this._label);\n\n\t\tthis._opts.parent.appendChild(this._domNode);\n\n\t\tthis.onchange(this._checkbox, () => {\n\t\t\tthis._opts.onChange();\n\t\t});\n\t}\n\n\tpublic get domNode(): HTMLElement {\n\t\treturn this._domNode;\n\t}\n\n\tpublic get checked(): boolean {\n\t\treturn this._checkbox.checked;\n\t}\n\n\tpublic set checked(newValue: boolean) {\n\t\tthis._checkbox.checked = newValue;\n\t}\n\n\tprivate enable(): void {\n\t\tthis._checkbox.removeAttribute('disabled');\n\t}\n\n\tprivate disable(): void {\n\t\tthis._checkbox.disabled = true;\n\t}\n\n\tpublic setEnabled(enabled: boolean): void {\n\t\tif (enabled) {\n\t\t\tthis.enable();\n\t\t\tthis.domNode.tabIndex = 0;\n\t\t} else {\n\t\t\tthis.disable();\n\t\t\tthis.domNode.tabIndex = -1;\n\t\t}\n\t}\n}\n\nexport interface ISimpleButtonOpts {\n\treadonly label: string;\n\treadonly className: string;\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\tthis._domNode = document.createElement('div');\n\t\tthis._domNode.title = this._opts.label;\n\t\tthis._domNode.tabIndex = 0;\n\t\tthis._domNode.className = 'button ' + this._opts.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\tdom.toggleClass(this._domNode, '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}\n\n\tpublic toggleClass(className: string, shouldHaveIt: boolean): void {\n\t\tdom.toggleClass(this._domNode, className, shouldHaveIt);\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 2px 8px ${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: 2px solid ${hcBorder}; }`);\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}; width: 3px !important; margin-left: -4px;}`);\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}; width: 3px !important; margin-left: -4px;}`);\n\t\t}\n\t}\n\n\tconst inputActiveBorder = theme.getColor(inputActiveOptionBorder);\n\tif (inputActiveBorder) {\n\t\tcollector.addRule(`.monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { border: 1px solid ${inputActiveBorder.toString()}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { 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, ServicesAccessor, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_FIND_WIDGET_VISIBLE, FIND_IDS, FindModelBoundToEditorModel, ToggleCaseSensitiveKeybinding, ToggleRegexKeybinding, ToggleSearchScopeKeybinding, ToggleWholeWordKeybinding } from 'vs/editor/contrib/find/findModel';\nimport { FindOptionsWidget } from 'vs/editor/contrib/find/findOptionsWidget';\nimport { FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState } from 'vs/editor/contrib/find/findState';\nimport { FindWidget, IFindController } from 'vs/editor/contrib/find/findWidget';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { optional } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IStorageService, StorageScope } 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): 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\tif (selection.startLineNumber === selection.endLineNumber) {\n\t\tif (selection.isEmpty()) {\n\t\t\tlet wordAtPosition = editor.getModel().getWordAtPosition(selection.getStartPosition());\n\t\t\tif (wordAtPosition) {\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: boolean;\n\tseedSearchStringFromGlobalClipboard: boolean;\n\tshouldFocus: FindStartFocusAction;\n\tshouldAnimate: boolean;\n\tupdateSearchScope: boolean;\n}\n\nexport class CommonFindController extends Disposable implements editorCommon.IEditorContribution {\n\n\tprivate 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\tprivate readonly _storageService: IStorageService;\n\tprivate readonly _clipboardService: IClipboardService;\n\tprotected readonly _contextKeyService: IContextKeyService;\n\n\tpublic static get(editor: ICodeEditor): CommonFindController {\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}, 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: false && this._editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,\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});\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic 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\tpublic getId(): string {\n\t\treturn CommonFindController.ID;\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);\n\t\t}\n\t\tif (e.wholeWord) {\n\t\t\tthis._storageService.store('editor.wholeWord', this._state.actualWholeWord, StorageScope.WORKSPACE);\n\t\t}\n\t\tif (e.matchCase) {\n\t\t\tthis._storageService.store('editor.matchCase', this._state.actualMatchCase, StorageScope.WORKSPACE);\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}, 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 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 selection = this._editor.getSelection();\n\t\t\t\tif (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) {\n\t\t\t\t\tselection = selection.setEndPosition(selection.endLineNumber - 1, this._editor.getModel().getLineMaxColumn(selection.endLineNumber - 1));\n\t\t\t\t}\n\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\tthis._state.change({ searchScope: selection }, 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(): void {\n\t\t// overwritten in subclass\n\t}\n\n\tprotected _start(opts: IFindStartOptions): 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\tisRevealed: true\n\t\t};\n\n\t\tif (opts.seedSearchStringFromSelection) {\n\t\t\tlet selectionSearchString = getSelectionSearchString(this._editor);\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}\n\n\t\tif (!stateChanges.searchString && opts.seedSearchStringFromGlobalClipboard) {\n\t\t\tlet selectionSearchString = this.getGlobalBufferTerm();\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) {\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 currentSelection = this._editor.getSelection();\n\t\t\tif (!currentSelection.isEmpty()) {\n\t\t\t\tstateChanges.searchScope = currentSelection;\n\t\t\t}\n\t\t}\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): void {\n\t\tthis._start(opts);\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 getGlobalBufferTerm(): string {\n\t\tif (this._editor.getConfiguration().contribInfo.find.globalFindClipboard\n\t\t\t&& this._clipboardService\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) {\n\t\tif (this._editor.getConfiguration().contribInfo.find.globalFindClipboard\n\t\t\t&& this._clipboardService\n\t\t\t&& this._editor.hasModel()\n\t\t\t&& !this._editor.getModel().isTooLargeForSyncing()\n\t\t) {\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;\n\tprivate _findOptionsWidget: FindOptionsWidget;\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@IStorageService storageService: IStorageService,\n\t\t@optional(IClipboardService) clipboardService: IClipboardService\n\t) {\n\t\tsuper(editor, _contextKeyService, storageService, clipboardService);\n\t}\n\n\tprotected _start(opts: IFindStartOptions): void {\n\t\tif (!this._widget) {\n\t\t\tthis._createFindWidget();\n\t\t}\n\n\t\tif (!this._widget.getPosition() && this._editor.getConfiguration().contribInfo.find.autoFindInSelection) {\n\t\t\t// not visible yet so we need to set search scope if `editor.find.autoFindInSelection` is `true`\n\t\t\topts.updateSearchScope = true;\n\t\t}\n\n\t\tsuper._start(opts);\n\n\t\tif (opts.shouldFocus === FindStartFocusAction.FocusReplaceInput) {\n\t\t\tthis._widget.focusReplaceInput();\n\t\t} else if (opts.shouldFocus === FindStartFocusAction.FocusFindInput) {\n\t\t\tthis._widget.focusFindInput();\n\t\t}\n\t}\n\n\tpublic highlightFindOptions(): void {\n\t\tif (!this._widget) {\n\t\t\tthis._createFindWidget();\n\t\t}\n\t\tif (this._state.isRevealed) {\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));\n\t\tthis._findOptionsWidget = this._register(new FindOptionsWidget(this._editor, this._state, this._keybindingService, this._themeService));\n\t}\n}\n\nexport class StartFindAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.StartFindAction,\n\t\t\tlabel: nls.localize('startFindAction', \"Find\"),\n\t\t\talias: 'Find',\n\t\t\tprecondition: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_F,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '3_find',\n\t\t\t\ttitle: nls.localize({ key: 'miFind', comment: ['&& denotes a mnemonic'] }, \"&&Find\"),\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor | null, editor: ICodeEditor): void {\n\t\tlet controller = CommonFindController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,\n\t\t\t\tseedSearchStringFromGlobalClipboard: editor.getConfiguration().contribInfo.find.globalFindClipboard,\n\t\t\t\tshouldFocus: FindStartFocusAction.FocusFindInput,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: false\n\t\t\t});\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: null,\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.KEY_E,\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\tlet controller = CommonFindController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: true,\n\t\t\t\tseedSearchStringFromGlobalClipboard: false,\n\t\t\t\tshouldFocus: FindStartFocusAction.FocusFindInput,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: false\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 run(accessor: ServicesAccessor | null, editor: ICodeEditor): void {\n\t\tlet controller = CommonFindController.get(editor);\n\t\tif (controller && !this._run(controller)) {\n\t\t\tcontroller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: (controller.getState().searchString.length === 0) && editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,\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});\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: null,\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.KEY_G, secondary: [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 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: null,\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.KEY_G, secondary: [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 abstract class SelectionMatchFindAction extends EditorAction {\n\tpublic run(accessor: ServicesAccessor | null, editor: ICodeEditor): void {\n\t\tlet controller = CommonFindController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\t\tlet selectionSearchString = getSelectionSearchString(editor);\n\t\tif (selectionSearchString) {\n\t\t\tcontroller.setSearchString(selectionSearchString);\n\t\t}\n\t\tif (!this._run(controller)) {\n\t\t\tcontroller.start({\n\t\t\t\tforceRevealReplace: false,\n\t\t\t\tseedSearchStringFromSelection: editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,\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});\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: null,\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: null,\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 class StartFindReplaceAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FIND_IDS.StartFindReplaceAction,\n\t\t\tlabel: nls.localize('startReplace', \"Replace\"),\n\t\t\talias: 'Replace',\n\t\t\tprecondition: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: null,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_H,\n\t\t\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_F },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\n\t\t\t\tmenuId: MenuId.MenubarEditMenu,\n\t\t\t\tgroup: '3_find',\n\t\t\t\ttitle: nls.localize({ key: 'miReplace', comment: ['&& denotes a mnemonic'] }, \"&&Replace\"),\n\t\t\t\torder: 2\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor | null, editor: ICodeEditor): void {\n\t\tif (!editor.hasModel() || editor.getConfiguration().readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet controller = CommonFindController.get(editor);\n\t\tlet currentSelection = editor.getSelection();\n\t\tlet findInputFocused = controller.isFindInputFocused();\n\t\t// we only seed search string from selection when the current selection is single line and not empty,\n\t\t// + the find input is not focused\n\t\tlet seedSearchStringFromSelection = !currentSelection.isEmpty()\n\t\t\t&& currentSelection.startLineNumber === currentSelection.endLineNumber && editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection\n\t\t\t&& !findInputFocused;\n\t\t/*\n\t\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\t * findInputFocused true -> seedSearchStringFromSelection false, FocusReplaceInput\n\t\t * findInputFocused false, seedSearchStringFromSelection true FocusReplaceInput\n\t\t * findInputFocused false seedSearchStringFromSelection false FocusFindInput\n\t\t */\n\t\tlet shouldFocus = (findInputFocused || seedSearchStringFromSelection) ?\n\t\t\tFindStartFocusAction.FocusReplaceInput : FindStartFocusAction.FocusFindInput;\n\n\n\t\tif (controller) {\n\t\t\tcontroller.start({\n\t\t\t\tforceRevealReplace: true,\n\t\t\t\tseedSearchStringFromSelection: seedSearchStringFromSelection,\n\t\t\t\tseedSearchStringFromGlobalClipboard: editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,\n\t\t\t\tshouldFocus: shouldFocus,\n\t\t\t\tshouldAnimate: true,\n\t\t\t\tupdateSearchScope: false\n\t\t\t});\n\t\t}\n\t}\n}\n\nregisterEditorContribution(FindController);\n\nregisterEditorAction(StartFindAction);\nregisterEditorAction(StartFindWithSelectionAction);\nregisterEditorAction(NextMatchFindAction);\nregisterEditorAction(PreviousMatchFindAction);\nregisterEditorAction(NextSelectionMatchFindAction);\nregisterEditorAction(PreviousSelectionMatchFindAction);\nregisterEditorAction(StartFindReplaceAction);\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: EditorContextKeys.focus,\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: null,\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: null,\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: null,\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: null,\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.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.KEY_1\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.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 * as nls from 'vs/nls';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\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 { registerEditorAction, ServicesAccessor, EditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IInplaceReplaceSupportResult } from 'vs/editor/common/modes';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { InPlaceReplaceCommand } from './inPlaceReplaceCommand';\nimport { EditorState, CodeEditorStateFlag } from 'vs/editor/browser/core/editorState';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nclass InPlaceReplaceController implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.inPlaceReplaceController';\n\n\tstatic get(editor: ICodeEditor): InPlaceReplaceController {\n\t\treturn editor.getContribution<InPlaceReplaceController>(InPlaceReplaceController.ID);\n\t}\n\n\tprivate static readonly DECORATION = ModelDecorationOptions.register({\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 getId(): string {\n\t\treturn InPlaceReplaceController.ID;\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.US_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.US_DOT,\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);\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 'vs/css!./links';\nimport * as nls from 'vs/nls';\nimport * as async 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 { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport * as platform from 'vs/base/common/platform';\nimport { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { LinkProviderRegistry } from 'vs/editor/common/modes';\nimport { ClickLinkGesture, ClickLinkKeyboardEvent, ClickLinkMouseEvent } from 'vs/editor/contrib/goToDefinition/clickLinkGesture';\nimport { Link, getLinks, LinksList } from 'vs/editor/contrib/links/getLinks';\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\nconst HOVER_MESSAGE_GENERAL_META = new MarkdownString().appendText(\n\tplatform.isMacintosh\n\t\t? nls.localize('links.navigate.mac', \"Cmd + click to follow link\")\n\t\t: nls.localize('links.navigate', \"Ctrl + click to follow link\")\n);\n\nconst HOVER_MESSAGE_COMMAND_META = new MarkdownString().appendText(\n\tplatform.isMacintosh\n\t\t? nls.localize('links.command.mac', \"Cmd + click to execute command\")\n\t\t: nls.localize('links.command', \"Ctrl + click to execute command\")\n);\n\nconst HOVER_MESSAGE_GENERAL_ALT = new MarkdownString().appendText(\n\tplatform.isMacintosh\n\t\t? nls.localize('links.navigate.al.mac', \"Option + click to follow link\")\n\t\t: nls.localize('links.navigate.al', \"Alt + click to follow link\")\n);\n\nconst HOVER_MESSAGE_COMMAND_ALT = new MarkdownString().appendText(\n\tplatform.isMacintosh\n\t\t? nls.localize('links.command.al.mac', \"Option + click to execute command\")\n\t\t: nls.localize('links.command.al', \"Alt + click to execute command\")\n);\n\nconst decoration = {\n\tmeta: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link',\n\t\thoverMessage: HOVER_MESSAGE_GENERAL_META\n\t}),\n\tmetaActive: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active',\n\t\thoverMessage: HOVER_MESSAGE_GENERAL_META\n\t}),\n\talt: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link',\n\t\thoverMessage: HOVER_MESSAGE_GENERAL_ALT\n\t}),\n\taltActive: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active',\n\t\thoverMessage: HOVER_MESSAGE_GENERAL_ALT\n\t}),\n\taltCommand: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link',\n\t\thoverMessage: HOVER_MESSAGE_COMMAND_ALT\n\t}),\n\taltCommandActive: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active',\n\t\thoverMessage: HOVER_MESSAGE_COMMAND_ALT\n\t}),\n\tmetaCommand: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link',\n\t\thoverMessage: HOVER_MESSAGE_COMMAND_META\n\t}),\n\tmetaCommandActive: ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tcollapseOnReplaceEdit: true,\n\t\tinlineClassName: 'detected-link-active',\n\t\thoverMessage: HOVER_MESSAGE_COMMAND_META\n\t}),\n};\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\tif (link.url && /^command:/i.test(link.url.toString())) {\n\t\t\tif (useMetaKey) {\n\t\t\t\treturn (isActive ? decoration.metaCommandActive : decoration.metaCommand);\n\t\t\t} else {\n\t\t\t\treturn (isActive ? decoration.altCommandActive : decoration.altCommand);\n\t\t\t}\n\t\t} else {\n\t\t\tif (useMetaKey) {\n\t\t\t\treturn (isActive ? decoration.metaActive : decoration.meta);\n\t\t\t} else {\n\t\t\t\treturn (isActive ? decoration.altActive : decoration.alt);\n\t\t\t}\n\t\t}\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\nclass LinkDetector implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID: string = 'editor.linkDetector';\n\n\tpublic static get(editor: ICodeEditor): LinkDetector {\n\t\treturn editor.getContribution<LinkDetector>(LinkDetector.ID);\n\t}\n\n\tstatic RECOMPUTE_TIME = 1000; // ms\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate enabled: boolean;\n\tprivate listenersToRemove: IDisposable[];\n\tprivate readonly timeout: async.TimeoutTimer;\n\tprivate computePromise: async.CancelablePromise<LinksList> | null;\n\tprivate activeLinksList: LinksList | null;\n\tprivate activeLinkDecorationId: string | null;\n\tprivate readonly openerService: IOpenerService;\n\tprivate readonly notificationService: INotificationService;\n\tprivate currentOccurrences: { [decorationId: string]: LinkOccurrence; };\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IOpenerService openerService: IOpenerService,\n\t\t@INotificationService notificationService: INotificationService\n\t) {\n\t\tthis.editor = editor;\n\t\tthis.openerService = openerService;\n\t\tthis.notificationService = notificationService;\n\t\tthis.listenersToRemove = [];\n\n\t\tlet clickLinkGesture = new ClickLinkGesture(editor);\n\t\tthis.listenersToRemove.push(clickLinkGesture);\n\t\tthis.listenersToRemove.push(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis._onEditorMouseMove(mouseEvent, keyboardEvent);\n\t\t}));\n\t\tthis.listenersToRemove.push(clickLinkGesture.onExecute((e) => {\n\t\t\tthis.onEditorMouseUp(e);\n\t\t}));\n\t\tthis.listenersToRemove.push(clickLinkGesture.onCancel((e) => {\n\t\t\tthis.cleanUpActiveLinkDecoration();\n\t\t}));\n\n\t\tthis.enabled = editor.getConfiguration().contribInfo.links;\n\t\tthis.listenersToRemove.push(editor.onDidChangeConfiguration((e) => {\n\t\t\tlet enabled = editor.getConfiguration().contribInfo.links;\n\t\t\tif (this.enabled === enabled) {\n\t\t\t\t// No change in our configuration option\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.enabled = enabled;\n\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.beginCompute();\n\t\t}));\n\t\tthis.listenersToRemove.push(editor.onDidChangeModelContent((e) => this.onChange()));\n\t\tthis.listenersToRemove.push(editor.onDidChangeModel((e) => this.onModelChanged()));\n\t\tthis.listenersToRemove.push(editor.onDidChangeModelLanguage((e) => this.onModelModeChanged()));\n\t\tthis.listenersToRemove.push(LinkProviderRegistry.onDidChange((e) => this.onModelModeChanged()));\n\n\t\tthis.timeout = new async.TimeoutTimer();\n\t\tthis.computePromise = null;\n\t\tthis.activeLinksList = null;\n\t\tthis.currentOccurrences = {};\n\t\tthis.activeLinkDecorationId = null;\n\t\tthis.beginCompute();\n\t}\n\n\tpublic getId(): string {\n\t\treturn LinkDetector.ID;\n\t}\n\n\tprivate onModelChanged(): void {\n\t\tthis.currentOccurrences = {};\n\t\tthis.activeLinkDecorationId = null;\n\t\tthis.stop();\n\t\tthis.beginCompute();\n\t}\n\n\tprivate onModelModeChanged(): void {\n\t\tthis.stop();\n\t\tthis.beginCompute();\n\t}\n\n\tprivate onChange(): void {\n\t\tthis.timeout.setIfNotSet(() => this.beginCompute(), LinkDetector.RECOMPUTE_TIME);\n\t}\n\n\tprivate async beginCompute(): Promise<void> {\n\t\tif (!this.editor.hasModel() || !this.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this.editor.getModel();\n\n\t\tif (!LinkProviderRegistry.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 = async.createCancelablePromise(token => getLinks(model, token));\n\t\ttry {\n\t\t\tthis.activeLinksList = await this.computePromise;\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.getConfiguration().multiCursorModifier === 'altKey');\n\t\tlet oldDecorations: string[] = [];\n\t\tlet keys = Object.keys(this.currentOccurrences);\n\t\tfor (let i = 0, len = keys.length; i < len; i++) {\n\t\t\tlet decorationId = keys[i];\n\t\t\tlet occurance = this.currentOccurrences[decorationId];\n\t\t\toldDecorations.push(occurance.decorationId);\n\t\t}\n\n\t\tlet 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\tlet 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\tlet occurance = new LinkOccurrence(links[i], decorations[i]);\n\t\t\tthis.currentOccurrences[occurance.decorationId] = occurance;\n\t\t}\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent, withKey: ClickLinkKeyboardEvent | null): void {\n\t\tconst useMetaKey = (this.editor.getConfiguration().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.getConfiguration().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);\n\t}\n\n\tpublic openLinkOccurrence(occurrence: LinkOccurrence, openToSide: boolean): 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\t\t\t// open the uri\n\t\t\treturn this.openerService.open(uri, { openToSide });\n\n\t\t}, err => {\n\t\t\t// different error cases\n\t\t\tif (err === '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 (err === '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.timeout.cancel();\n\t\tif (this.activeLinksList) {\n\t\t\tthis.activeLinksList.dispose();\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 dispose(): void {\n\t\tthis.listenersToRemove = dispose(this.listenersToRemove);\n\t\tthis.stop();\n\t\tthis.timeout.dispose();\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: null\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet 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\tlet selections = editor.getSelections();\n\n\t\tfor (let sel of selections) {\n\t\t\tlet link = linkDetector.getLinkOccurrence(sel.getEndPosition());\n\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);\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 'vs/css!./messageController';\nimport * as nls from 'vs/nls';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { KeyCode } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { registerEditorContribution, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditor, IContentWidget, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';\nimport { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IPosition } from 'vs/editor/common/core/position';\nimport { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';\nimport { inputValidationInfoBorder, inputValidationInfoBackground, inputValidationInfoForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\n\nexport class MessageController extends Disposable implements editorCommon.IEditorContribution {\n\n\tprivate static readonly _id = 'editor.contrib.messageController';\n\n\tstatic MESSAGE_VISIBLE = new RawContextKey<boolean>('messageVisible', false);\n\n\tstatic get(editor: ICodeEditor): MessageController {\n\t\treturn editor.getContribution<MessageController>(MessageController._id);\n\t}\n\n\tgetId(): string {\n\t\treturn MessageController._id;\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _visible: IContextKey<boolean>;\n\tprivate _messageWidget: MessageWidget;\n\tprivate _messageListeners: IDisposable[] = [];\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._visible = MessageController.MESSAGE_VISIBLE.bindTo(contextKeyService);\n\t\tthis._register(this._editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit()));\n\t}\n\n\tdispose(): void {\n\t\tsuper.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\tdispose(this._messageWidget);\n\t\tthis._messageListeners = dispose(this._messageListeners);\n\t\tthis._messageWidget = new MessageWidget(this._editor, position, message);\n\n\t\t// close on blur, cursor, model change, dispose\n\t\tthis._messageListeners.push(this._editor.onDidBlurEditorText(() => this.closeMessage()));\n\t\tthis._messageListeners.push(this._editor.onDidChangeCursorPosition(() => this.closeMessage()));\n\t\tthis._messageListeners.push(this._editor.onDidDispose(() => this.closeMessage()));\n\t\tthis._messageListeners.push(this._editor.onDidChangeModel(() => this.closeMessage()));\n\n\t\t// close after 3s\n\t\tthis._messageListeners.push(new TimeoutTimer(() => this.closeMessage(), 3000));\n\n\t\t// close on mouse move\n\t\tlet bounds: Range;\n\t\tthis._messageListeners.push(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 = dispose(this._messageListeners);\n\t\tthis._messageListeners.push(MessageWidget.fadeOut(this._messageWidget));\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, editorCommon.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 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 anchor = document.createElement('div');\n\t\tanchor.classList.add('anchor');\n\t\tthis._domNode.appendChild(anchor);\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] };\n\t}\n}\n\nregisterEditorContribution(MessageController);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst border = theme.getColor(inputValidationInfoBorder);\n\tif (border) {\n\t\tlet borderWidth = theme.type === HIGH_CONTRAST ? 2 : 1;\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor { border-top-color: ${border}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${borderWidth}px solid ${border}; }`);\n\t}\n\tconst background = theme.getColor(inputValidationInfoBackground);\n\tif (background) {\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`);\n\t}\n\tconst foreground = theme.getColor(inputValidationInfoForeground);\n\tif (foreground) {\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { 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 { CancelablePromise } from 'vs/base/common/async';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\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 } from 'vs/editor/browser/services/bulkEditService';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { CodeAction } from 'vs/editor/common/modes';\nimport { MessageController } from 'vs/editor/contrib/message/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 { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IMarkerService } from 'vs/platform/markers/common/markers';\nimport { IProgressService } from 'vs/platform/progress/common/progress';\nimport { CodeActionModel, SUPPORTED_CODE_ACTIONS, CodeActionsState } from './codeActionModel';\nimport { CodeActionAutoApply, CodeActionFilter, CodeActionKind } from './codeActionTrigger';\nimport { CodeActionContextMenu } from './codeActionWidget';\nimport { LightBulbWidget } from './lightBulbWidget';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction';\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\nexport class QuickFixController extends Disposable implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.quickFixController';\n\n\tpublic static get(editor: ICodeEditor): QuickFixController {\n\t\treturn editor.getContribution<QuickFixController>(QuickFixController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _model: CodeActionModel;\n\tprivate readonly _codeActionContextMenu: CodeActionContextMenu;\n\tprivate readonly _lightBulbWidget: LightBulbWidget;\n\n\tprivate _activeRequest: CancelablePromise<CodeActionSet> | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkerService markerService: IMarkerService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IProgressService progressService: IProgressService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t) {\n\t\tsuper();\n\n\t\tthis._editor = editor;\n\t\tthis._model = new CodeActionModel(this._editor, markerService, contextKeyService, progressService);\n\t\tthis._codeActionContextMenu = new CodeActionContextMenu(editor, contextMenuService, action => this._onApplyCodeAction(action));\n\t\tthis._lightBulbWidget = this._register(new LightBulbWidget(editor));\n\n\t\tthis._updateLightBulbTitle();\n\n\t\tthis._register(this._codeActionContextMenu.onDidExecuteCodeAction(_ => this._model.trigger({ type: 'auto', filter: {} })));\n\t\tthis._register(this._lightBulbWidget.onClick(this._handleLightBulbSelect, this));\n\t\tthis._register(this._model.onDidChangeState(e => this._onDidChangeCodeActionsState(e)));\n\t\tthis._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitle, this));\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._model.dispose();\n\t}\n\n\tprivate _onDidChangeCodeActionsState(newState: CodeActionsState.State): void {\n\t\tif (this._activeRequest) {\n\t\t\tthis._activeRequest.cancel();\n\t\t\tthis._activeRequest = undefined;\n\t\t}\n\n\t\tif (newState.type === CodeActionsState.Type.Triggered) {\n\t\t\tthis._activeRequest = newState.actions;\n\n\t\t\tif (newState.trigger.filter && newState.trigger.filter.kind) {\n\t\t\t\t// Triggered for specific scope\n\t\t\t\tnewState.actions.then(fixes => {\n\t\t\t\t\tif (fixes.actions.length > 0) {\n\t\t\t\t\t\t// Apply if we only have one action or requested autoApply\n\t\t\t\t\t\tif (newState.trigger.autoApply === CodeActionAutoApply.First || (newState.trigger.autoApply === CodeActionAutoApply.IfSingle && fixes.actions.length === 1)) {\n\t\t\t\t\t\t\tthis._onApplyCodeAction(fixes.actions[0]);\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\tthis._codeActionContextMenu.show(newState.actions, newState.position);\n\n\t\t\t\t}).catch(onUnexpectedError);\n\t\t\t} else if (newState.trigger.type === 'manual') {\n\t\t\t\tthis._codeActionContextMenu.show(newState.actions, newState.position);\n\t\t\t} else {\n\t\t\t\t// auto magically triggered\n\t\t\t\t// * update an existing list of code actions\n\t\t\t\t// * manage light bulb\n\t\t\t\tif (this._codeActionContextMenu.isVisible) {\n\t\t\t\t\tthis._codeActionContextMenu.show(newState.actions, newState.position);\n\t\t\t\t} else {\n\t\t\t\t\tthis._lightBulbWidget.tryShow(newState);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis._lightBulbWidget.hide();\n\t\t}\n\t}\n\n\tpublic getId(): string {\n\t\treturn QuickFixController.ID;\n\t}\n\n\tprivate _handleLightBulbSelect(e: { x: number, y: number, state: CodeActionsState.Triggered }): void {\n\t\tthis._codeActionContextMenu.show(e.state.actions, e);\n\t}\n\n\tpublic triggerFromEditorSelection(filter?: CodeActionFilter, autoApply?: CodeActionAutoApply): Promise<CodeActionSet | undefined> {\n\t\treturn this._model.trigger({ type: 'manual', filter, autoApply });\n\t}\n\n\tprivate _updateLightBulbTitle(): void {\n\t\tconst kb = this._keybindingService.lookupKeybinding(QuickFixAction.Id);\n\t\tlet title: string;\n\t\tif (kb) {\n\t\t\ttitle = nls.localize('quickFixWithKb', \"Show Fixes ({0})\", kb.getLabel());\n\t\t} else {\n\t\t\ttitle = nls.localize('quickFix', \"Show Fixes\");\n\t\t}\n\t\tthis._lightBulbWidget.title = title;\n\t}\n\n\tprivate _onApplyCodeAction(action: CodeAction): Promise<void> {\n\t\treturn applyCodeAction(action, this._bulkEditService, this._commandService, this._editor);\n\t}\n}\n\nexport async function applyCodeAction(\n\taction: CodeAction,\n\tbulkEditService: IBulkEditService,\n\tcommandService: ICommandService,\n\teditor?: ICodeEditor,\n): Promise<void> {\n\tif (action.edit) {\n\t\tawait bulkEditService.apply(action.edit, { editor });\n\t}\n\tif (action.command) {\n\t\tawait commandService.executeCommand(action.command.id, ...(action.command.arguments || []));\n\t}\n}\n\nfunction showCodeActionsForEditorSelection(\n\teditor: ICodeEditor,\n\tnotAvailableMessage: string,\n\tfilter?: CodeActionFilter,\n\tautoApply?: CodeActionAutoApply\n) {\n\tif (!editor.hasModel()) {\n\t\treturn;\n\t}\n\n\tconst controller = QuickFixController.get(editor);\n\tif (!controller) {\n\t\treturn;\n\t}\n\n\tconst pos = editor.getPosition();\n\tcontroller.triggerFromEditorSelection(filter, autoApply).then(codeActions => {\n\t\tif (!codeActions || !codeActions.actions.length) {\n\t\t\tMessageController.get(editor).showMessage(notAvailableMessage, pos);\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.US_DOT,\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 showCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"));\n\t}\n}\n\n\nclass 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\nexport class CodeActionCommand extends EditorCommand {\n\n\tstatic readonly Id = 'editor.action.codeAction';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: CodeActionCommand.Id,\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: [{\n\t\t\t\t\tname: 'args',\n\t\t\t\t\tschema: {\n\t\t\t\t\t\t'type': 'object',\n\t\t\t\t\t\t'required': ['kind'],\n\t\t\t\t\t\t'properties': {\n\t\t\t\t\t\t\t'kind': {\n\t\t\t\t\t\t\t\t'type': 'string'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'apply': {\n\t\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t\t'default': 'ifSingle',\n\t\t\t\t\t\t\t\t'enum': ['first', 'ifSingle', 'never']\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 runEditorCommand(_accessor: ServicesAccessor, editor: ICodeEditor, userArg: any) {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArg, {\n\t\t\tkind: CodeActionKind.Empty,\n\t\t\tapply: CodeActionAutoApply.IfSingle,\n\t\t});\n\t\treturn showCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"),\n\t\t\t{\n\t\t\t\tkind: 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\tstatic readonly Id = 'editor.action.refactor';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: RefactorAction.Id,\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.KEY_R,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_R\n\t\t\t\t},\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\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: [{\n\t\t\t\t\tname: 'args',\n\t\t\t\t\tschema: {\n\t\t\t\t\t\t'type': 'object',\n\t\t\t\t\t\t'properties': {\n\t\t\t\t\t\t\t'kind': {\n\t\t\t\t\t\t\t\t'type': 'string'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'apply': {\n\t\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t\t'default': 'never',\n\t\t\t\t\t\t\t\t'enum': ['first', 'ifSingle', 'never']\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, userArg: any): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArg, {\n\t\t\tkind: CodeActionKind.Refactor,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn showCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.refactor.noneMessage', \"No refactorings available\"),\n\t\t\t{\n\t\t\t\tkind: CodeActionKind.Refactor.contains(args.kind) ? args.kind : CodeActionKind.Empty,\n\t\t\t\tonlyIncludePreferredActions: args.preferred,\n\t\t\t},\n\t\t\targs.apply);\n\t}\n}\n\n\nexport class SourceAction extends EditorAction {\n\n\tstatic readonly Id = 'editor.action.sourceAction';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: SourceAction.Id,\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\tmenuOpts: {\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: [{\n\t\t\t\t\tname: 'args',\n\t\t\t\t\tschema: {\n\t\t\t\t\t\t'type': 'object',\n\t\t\t\t\t\t'properties': {\n\t\t\t\t\t\t\t'kind': {\n\t\t\t\t\t\t\t\t'type': 'string'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'apply': {\n\t\t\t\t\t\t\t\t'type': 'string',\n\t\t\t\t\t\t\t\t'default': 'never',\n\t\t\t\t\t\t\t\t'enum': ['first', 'ifSingle', 'never']\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, userArg: any): void {\n\t\tconst args = CodeActionCommandArgs.fromUser(userArg, {\n\t\t\tkind: CodeActionKind.Source,\n\t\t\tapply: CodeActionAutoApply.Never\n\t\t});\n\t\treturn showCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.source.noneMessage', \"No source actions available\"),\n\t\t\t{\n\t\t\t\tkind: CodeActionKind.Source.contains(args.kind) ? args.kind : CodeActionKind.Empty,\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\tstatic readonly Id = 'editor.action.organizeImports';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: OrganizeImportsAction.Id,\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.KEY_O,\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 showCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.organize.noneMessage', \"No organize imports action available\"),\n\t\t\t{ kind: CodeActionKind.SourceOrganizeImports, includeSourceActions: true },\n\t\t\tCodeActionAutoApply.IfSingle);\n\t}\n}\n\nexport class FixAllAction extends EditorAction {\n\n\tstatic readonly Id = 'editor.action.fixAll';\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: FixAllAction.Id,\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 showCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('fixAll.noneMessage', \"No fix all action available\"),\n\t\t\t{ kind: 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.US_DOT,\n\t\t\t\tmac: {\n\t\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_DOT\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 showCodeActionsForEditorSelection(editor,\n\t\t\tnls.localize('editor.action.autoFix.noneMessage', \"No auto fixes available\"),\n\t\t\t{\n\t\t\t\tkind: 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 { CodeActionCommand, OrganizeImportsAction, QuickFixAction, QuickFixController, RefactorAction, SourceAction, AutoFixAction, FixAllAction } from 'vs/editor/contrib/codeAction/codeActionCommands';\n\n\nregisterEditorContribution(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 * as nls from 'vs/nls';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { RevealTarget } from 'vs/editor/common/controller/cursorCommon';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';\nimport { CursorMoveCommands } from 'vs/editor/common/controller/cursorMoveCommands';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { Constants } from 'vs/editor/common/core/uint';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { FindMatch, ITextModel, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { DocumentHighlightProviderRegistry } from 'vs/editor/common/modes';\nimport { CommonFindController } from 'vs/editor/contrib/find/findController';\nimport { FindOptionOverride, INewFindReplaceState } from 'vs/editor/contrib/find/findState';\nimport { MenuId } from 'vs/platform/actions/common/actions';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { themeColorFromId } from 'vs/platform/theme/common/themeService';\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: null,\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\tmenubarOpts: {\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\tconst useLogicalLine = (args && args.logicalLine === true);\n\t\tconst cursors = editor._getCursors();\n\t\tconst context = cursors.context;\n\n\t\tif (context.config.readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.model.pushStackElement();\n\t\tcursors.setStates(\n\t\t\targs.source,\n\t\t\tCursorChangeReason.Explicit,\n\t\t\tCursorMoveCommands.addCursorUp(context, cursors.getAll(), useLogicalLine)\n\t\t);\n\t\tcursors.reveal(true, RevealTarget.TopMost, ScrollType.Smooth);\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: null,\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\tmenubarOpts: {\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\tconst useLogicalLine = (args && args.logicalLine === true);\n\t\tconst cursors = editor._getCursors();\n\t\tconst context = cursors.context;\n\n\t\tif (context.config.readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.model.pushStackElement();\n\t\tcursors.setStates(\n\t\t\targs.source,\n\t\t\tCursorChangeReason.Explicit,\n\t\t\tCursorMoveCommands.addCursorDown(context, cursors.getAll(), useLogicalLine)\n\t\t);\n\t\tcursors.reveal(true, RevealTarget.BottomMost, ScrollType.Smooth);\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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\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}\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: null\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\tif (newSelections.length > 0) {\n\t\t\teditor.setSelections(newSelections);\n\t\t}\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: null\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\tif (newSelections.length > 0) {\n\t\t\teditor.setSelections(newSelections);\n\t\t}\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.getModel().getWordAtPosition(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.getConfiguration().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.getConfiguration().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.getConfiguration().wordSeparators : null, false, Constants.MAX_SAFE_SMALL_INTEGER);\n\t}\n}\n\nexport class MultiCursorSelectionController extends Disposable implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.multiCursorController';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _ignoreSelectionChange: boolean;\n\tprivate _session: MultiCursorSession | null;\n\tprivate _sessionDispose: IDisposable[];\n\n\tpublic static get(editor: ICodeEditor): MultiCursorSelectionController {\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\tthis._sessionDispose = [];\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._endSession();\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn MultiCursorSelectionController.ID;\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 = [\n\t\t\t\tthis._editor.onDidChangeCursorSelection((e) => {\n\t\t\t\t\tif (this._ignoreSelectionChange) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._endSession();\n\t\t\t\t}),\n\t\t\t\tthis._editor.onDidBlurEditorText(() => {\n\t\t\t\t\tthis._endSession();\n\t\t\t\t}),\n\t\t\t\tfindController.getState().onFindReplaceStateChange((e) => {\n\t\t\t\t\tif (e.matchCase || e.wholeWord) {\n\t\t\t\t\t\tthis._endSession();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t}\n\n\tprivate _endSession(): void {\n\t\tthis._sessionDispose = dispose(this._sessionDispose);\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 = model.getWordAtPosition(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.getConfiguration().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 (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\tthis._run(multiCursorController, findController);\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_D,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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: null,\n\t\t\tmenubarOpts: {\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D),\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: null\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenubarOpts: {\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: EditorContextKeys.writable,\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\tmenuOpts: {\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\tpublic readonly searchText: string;\n\tpublic readonly matchCase: boolean;\n\tpublic readonly wordSeparators: string | null;\n\n\tconstructor(searchText: string, matchCase: boolean, wordSeparators: string | null) {\n\t\tthis.searchText = searchText;\n\t\tthis.matchCase = matchCase;\n\t\tthis.wordSeparators = wordSeparators;\n\t}\n\n\t/**\n\t * Everything equals except for `lastWordUnderCursor`\n\t */\n\tpublic static softEquals(a: SelectionHighlighterState | null, b: SelectionHighlighterState | 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 (\n\t\t\ta.searchText === b.searchText\n\t\t\t&& a.matchCase === b.matchCase\n\t\t\t&& a.wordSeparators === b.wordSeparators\n\t\t);\n\t}\n}\n\nexport class SelectionHighlighter extends Disposable implements IEditorContribution {\n\tprivate 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(editor: ICodeEditor) {\n\t\tsuper();\n\t\tthis.editor = editor;\n\t\tthis._isEnabled = editor.getConfiguration().contribInfo.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.getConfiguration().contribInfo.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\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(CommonFindController.get(editor).getState().onFindReplaceStateChange((e) => {\n\t\t\tthis._update();\n\t\t}));\n\t}\n\n\tpublic getId(): string {\n\t\treturn SelectionHighlighter.ID;\n\t}\n\n\tprivate _update(): void {\n\t\tthis._setState(SelectionHighlighter._createState(this._isEnabled, this.editor));\n\t}\n\n\tprivate static _createState(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(r.searchText, r.matchCase, r.wholeWord ? editor.getConfiguration().wordSeparators : null);\n\t}\n\n\tprivate _setState(state: SelectionHighlighterState | null): void {\n\t\tif (SelectionHighlighterState.softEquals(this.state, state)) {\n\t\t\tthis.state = state;\n\t\t\treturn;\n\t\t}\n\t\tthis.state = state;\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 takes is blocking the UI.\n\t\t\treturn;\n\t\t}\n\n\t\tconst hasFindOccurrences = DocumentHighlightProviderRegistry.has(model);\n\n\t\tlet allMatches = model.findMatches(this.state.searchText, true, false, this.state.matchCase, this.state.wordSeparators, false).map(m => m.range);\n\t\tallMatches.sort(Range.compareRangesUsingStarts);\n\n\t\tlet 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\tlet 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 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\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});\n\n\tprivate static readonly _SELECTION_HIGHLIGHT = ModelDecorationOptions.register({\n\t\tstickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,\n\t\tclassName: 'selectionHighlight',\n\t});\n\n\tpublic 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);\nregisterEditorContribution(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 * Copyright (c) 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 { domEvent, stop } from 'vs/base/browser/event';\nimport * as aria from 'vs/base/browser/ui/aria/aria';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { Event } from 'vs/base/common/event';\nimport { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport 'vs/css!./parameterHints';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport * as modes from 'vs/editor/common/modes';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';\nimport { Context } from 'vs/editor/contrib/parameterHints/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, textCodeBlockBackground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { HIGH_CONTRAST, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { ParameterHintsModel, TriggerContext } from 'vs/editor/contrib/parameterHints/parameterHintsModel';\n\nconst $ = dom.$;\n\nexport class ParameterHintsWidget implements IContentWidget, IDisposable {\n\n\tprivate static readonly ID = 'editor.widget.parameterHintsWidget';\n\n\tprivate readonly markdownRenderer: MarkdownRenderer;\n\tprivate renderDisposeables: IDisposable[];\n\tprivate model: ParameterHintsModel | null;\n\tprivate readonly keyVisible: IContextKey<boolean>;\n\tprivate readonly keyMultipleSignatures: IContextKey<boolean>;\n\tprivate element: HTMLElement;\n\tprivate signature: HTMLElement;\n\tprivate docs: HTMLElement;\n\tprivate overloads: HTMLElement;\n\tprivate visible: boolean;\n\tprivate announcedLabel: string | null;\n\tprivate scrollbar: DomScrollableElement;\n\tprivate disposables: IDisposable[];\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@IModeService modeService: IModeService,\n\t) {\n\t\tthis.markdownRenderer = new MarkdownRenderer(editor, modeService, openerService);\n\t\tthis.model = new ParameterHintsModel(editor);\n\t\tthis.keyVisible = Context.Visible.bindTo(contextKeyService);\n\t\tthis.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);\n\t\tthis.visible = false;\n\t\tthis.disposables = [];\n\n\t\tthis.disposables.push(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 createParamaterHintDOMNodes() {\n\t\tthis.element = $('.editor-widget.parameter-hints-widget');\n\t\tconst wrapper = dom.append(this.element, $('.wrapper'));\n\t\twrapper.tabIndex = -1;\n\n\t\tconst buttons = dom.append(wrapper, $('.buttons'));\n\t\tconst previous = dom.append(buttons, $('.button.previous'));\n\t\tconst next = dom.append(buttons, $('.button.next'));\n\n\t\tconst onPreviousClick = stop(domEvent(previous, 'click'));\n\t\tonPreviousClick(this.previous, this, this.disposables);\n\n\t\tconst onNextClick = stop(domEvent(next, 'click'));\n\t\tonNextClick(this.next, this, this.disposables);\n\n\t\tthis.overloads = dom.append(wrapper, $('.overloads'));\n\n\t\tconst body = $('.body');\n\t\tthis.scrollbar = new DomScrollableElement(body, {});\n\t\tthis.disposables.push(this.scrollbar);\n\t\twrapper.appendChild(this.scrollbar.getDomNode());\n\n\t\tthis.signature = dom.append(body, $('.signature'));\n\n\t\tthis.docs = dom.append(body, $('.docs'));\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.hide();\n\n\t\tthis.element.style.userSelect = 'text';\n\t\tthis.disposables.push(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\tconst fontInfo = this.editor.getConfiguration().fontInfo;\n\t\t\tthis.element.style.fontSize = `${fontInfo.fontSize}px`;\n\t\t};\n\n\t\tupdateFont();\n\n\t\tEvent.chain<IConfigurationChangedEvent>(this.editor.onDidChangeConfiguration.bind(this.editor))\n\t\t\t.filter(e => e.fontInfo)\n\t\t\t.on(updateFont, null, this.disposables);\n\n\t\tthis.disposables.push(this.editor.onDidLayoutChange(e => this.updateMaxHeight()));\n\t\tthis.updateMaxHeight();\n\t}\n\n\tprivate show(): void {\n\t\tif (!this.model || this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.element) {\n\t\t\tthis.createParamaterHintDOMNodes();\n\t\t}\n\n\t\tthis.keyVisible.set(true);\n\t\tthis.visible = true;\n\t\tsetTimeout(() => dom.addClass(this.element, 'visible'), 100);\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tprivate hide(): void {\n\t\tif (!this.model || !this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.element) {\n\t\t\tthis.createParamaterHintDOMNodes();\n\t\t}\n\n\t\tthis.keyVisible.reset();\n\t\tthis.visible = false;\n\t\tthis.announcedLabel = null;\n\t\tdom.removeClass(this.element, 'visible');\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: modes.SignatureHelp): void {\n\t\tconst multiple = hints.signatures.length > 1;\n\t\tdom.toggleClass(this.element, 'multiple', multiple);\n\t\tthis.keyMultipleSignatures.set(multiple);\n\n\t\tthis.signature.innerHTML = '';\n\t\tthis.docs.innerHTML = '';\n\n\t\tconst signature = hints.signatures[hints.activeSignature];\n\n\t\tif (!signature) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst code = dom.append(this.signature, $('.code'));\n\t\tconst hasParameters = signature.parameters.length > 0;\n\n\t\tconst fontInfo = this.editor.getConfiguration().fontInfo;\n\t\tcode.style.fontSize = `${fontInfo.fontSize}px`;\n\t\tcode.style.fontFamily = fontInfo.fontFamily;\n\n\t\tif (!hasParameters) {\n\t\t\tconst label = dom.append(code, $('span'));\n\t\t\tlabel.textContent = signature.label;\n\n\t\t} else {\n\t\t\tthis.renderParameters(code, signature, hints.activeParameter);\n\t\t}\n\n\t\tdispose(this.renderDisposeables);\n\t\tthis.renderDisposeables = [];\n\n\t\tconst activeParameter = signature.parameters[hints.activeParameter];\n\n\t\tif (activeParameter && 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.markdownRenderer.render(activeParameter.documentation);\n\t\t\t\tdom.addClass(renderedContents.element, 'markdown-docs');\n\t\t\t\tthis.renderDisposeables.push(renderedContents);\n\t\t\t\tdocumentation.appendChild(renderedContents.element);\n\t\t\t}\n\t\t\tdom.append(this.docs, $('p', {}, documentation));\n\t\t}\n\n\t\tdom.toggleClass(this.signature, 'has-docs', !!signature.documentation);\n\n\t\tif (signature.documentation === undefined) { /** no op */ }\n\t\telse if (typeof signature.documentation === 'string') {\n\t\t\tdom.append(this.docs, $('p', {}, signature.documentation));\n\t\t} else {\n\t\t\tconst renderedContents = this.markdownRenderer.render(signature.documentation);\n\t\t\tdom.addClass(renderedContents.element, 'markdown-docs');\n\t\t\tthis.renderDisposeables.push(renderedContents);\n\t\t\tdom.append(this.docs, renderedContents.element);\n\t\t}\n\n\t\tlet currentOverload = String(hints.activeSignature + 1);\n\n\t\tif (hints.signatures.length < 10) {\n\t\t\tcurrentOverload += `/${hints.signatures.length}`;\n\t\t}\n\n\t\tthis.overloads.textContent = currentOverload;\n\n\t\tif (activeParameter) {\n\t\t\tconst labelToAnnounce = this.getParameterLabel(signature, hints.activeParameter);\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.scrollbar.scanDomNode();\n\t}\n\n\tprivate renderParameters(parent: HTMLElement, signature: modes.SignatureInformation, currentParameter: number): void {\n\n\t\tconst [start, end] = this.getParameterLabelOffsets(signature, currentParameter);\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 getParameterLabel(signature: modes.SignatureInformation, paramIdx: number): string {\n\t\tconst param = signature.parameters[paramIdx];\n\t\tif (typeof param.label === 'string') {\n\t\t\treturn param.label;\n\t\t} else {\n\t\t\treturn signature.label.substring(param.label[0], param.label[1]);\n\t\t}\n\t}\n\n\tprivate getParameterLabelOffsets(signature: modes.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 {\n\t\t\tconst idx = signature.label.lastIndexOf(param.label);\n\t\t\treturn idx >= 0\n\t\t\t\t? [idx, idx + param.label.length]\n\t\t\t\t: [0, 0];\n\t\t}\n\t}\n\n\tnext(): void {\n\t\tif (this.model) {\n\t\t\tthis.editor.focus();\n\t\t\tthis.model.next();\n\t\t}\n\t}\n\n\tprevious(): void {\n\t\tif (this.model) {\n\t\t\tthis.editor.focus();\n\t\t\tthis.model.previous();\n\t\t}\n\t}\n\n\tcancel(): void {\n\t\tif (this.model) {\n\t\t\tthis.model.cancel();\n\t\t}\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this.element;\n\t}\n\n\tgetId(): string {\n\t\treturn ParameterHintsWidget.ID;\n\t}\n\n\ttrigger(context: TriggerContext): void {\n\t\tif (this.model) {\n\t\t\tthis.model.trigger(context, 0);\n\t\t}\n\t}\n\n\tprivate updateMaxHeight(): void {\n\t\tconst height = Math.max(this.editor.getLayoutInfo().height / 4, 250);\n\t\tthis.element.style.maxHeight = `${height}px`;\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables = dispose(this.disposables);\n\t\tthis.renderDisposeables = dispose(this.renderDisposeables);\n\n\t\tif (this.model) {\n\t\t\tthis.model.dispose();\n\t\t\tthis.model = null;\n\t\t}\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst border = theme.getColor(editorHoverBorder);\n\tif (border) {\n\t\tconst borderWidth = theme.type === 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 codeBackground = theme.getColor(textCodeBlockBackground);\n\tif (codeBackground) {\n\t\tcollector.addRule(`.monaco-editor .parameter-hints-widget 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 * as nls from 'vs/nls';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { dispose } from 'vs/base/common/lifecycle';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ParameterHintsWidget } from './parameterHintsWidget';\nimport { Context } from 'vs/editor/contrib/parameterHints/provideSignatureHelp';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport * as modes from 'vs/editor/common/modes';\nimport { TriggerContext } from 'vs/editor/contrib/parameterHints/parameterHintsModel';\n\nclass ParameterHintsController implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.controller.parameterHints';\n\n\tpublic static get(editor: ICodeEditor): ParameterHintsController {\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\tthis.editor = editor;\n\t\tthis.widget = instantiationService.createInstance(ParameterHintsWidget, this.editor);\n\t}\n\n\tgetId(): string {\n\t\treturn ParameterHintsController.ID;\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\tdispose(): void {\n\t\tdispose(this.widget);\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\tlet controller = ParameterHintsController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.trigger({\n\t\t\t\ttriggerKind: modes.SignatureHelpTriggerKind.Invoke\n\t\t\t});\n\t\t}\n\t}\n}\n\nregisterEditorContribution(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.KEY_P] }\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.KEY_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 * as dom from 'vs/base/browser/dom';\nimport { IMouseEvent } from 'vs/base/browser/mouseEvent';\nimport { ActionBar, IActionBarOptions } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { Action } from 'vs/base/common/actions';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport * as objects from 'vs/base/common/objects';\nimport * as strings from 'vs/base/common/strings';\nimport 'vs/css!./media/peekViewWidget';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';\nimport { IOptions, IStyles, ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget';\nimport * as nls from 'vs/nls';\nimport { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { ServicesAccessor, createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { registerSingleton } from 'vs/platform/instantiation/common/extensions';\n\n\nexport const IPeekViewService = createDecorator<IPeekViewService>('IPeekViewService');\nexport interface IPeekViewService {\n\t_serviceBrand: any;\n\taddExclusiveWidget(editor: ICodeEditor, widget: PeekViewWidget): void;\n}\n\nregisterSingleton(IPeekViewService, class implements IPeekViewService {\n\t_serviceBrand: any;\n\n\tprivate _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);\n\texport const notInPeekEditor: ContextKeyExpr = inPeekEditor.toNegated();\n}\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\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\tpublic _serviceBrand: any;\n\n\tprivate _onDidClose = new Emitter<PeekViewWidget>();\n\n\tprotected _headElement: HTMLDivElement;\n\tprotected _headingIcon: HTMLElement;\n\tprotected _primaryHeading: HTMLElement;\n\tprotected _secondaryHeading: HTMLElement;\n\tprotected _metaHeading: HTMLElement;\n\tprotected _actionbarWidget: ActionBar;\n\tprotected _bodyElement: HTMLDivElement;\n\n\tconstructor(editor: ICodeEditor, options: IPeekViewOptions = {}) {\n\t\tsuper(editor, options);\n\t\tobjects.mixin(this.options, defaultOptions, false);\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._onDidClose.fire(this);\n\t}\n\n\tpublic get onDidClose(): Event<PeekViewWidget> {\n\t\treturn this._onDidClose.event;\n\t}\n\n\tpublic 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 _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.$('.head');\n\t\tthis._bodyElement = dom.$('.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): void {\n\t\tconst titleElement = dom.$('.peekview-title');\n\t\tdom.append(this._headElement, titleElement);\n\t\tdom.addStandardDisposableListener(titleElement, 'click', event => this._onTitleClick(event));\n\n\t\tthis._headingIcon = dom.$('span');\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._headingIcon, 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.push(this._actionbarWidget);\n\n\t\tthis._actionbarWidget.push(new Action('peekview.close', nls.localize('label.close', \"Close\"), 'close-peekview-action', true, () => {\n\t\t\tthis.dispose();\n\t\t\treturn Promise.resolve();\n\t\t}), { label: false, icon: true });\n\t}\n\n\tprotected _getActionBarOptions(): IActionBarOptions {\n\t\treturn {};\n\t}\n\n\tprotected _onTitleClick(event: IMouseEvent): void {\n\t\t// implement me\n\t}\n\n\tpublic setTitleIcon(iconClassName: string): void {\n\t\tthis._headingIcon.className = iconClassName ? `icon ${iconClassName}` : '';\n\t}\n\n\tpublic setTitle(primaryHeading: string, secondaryHeading?: string): void {\n\t\tthis._primaryHeading.innerHTML = strings.escape(primaryHeading);\n\t\tthis._primaryHeading.setAttribute('aria-label', primaryHeading);\n\t\tif (secondaryHeading) {\n\t\t\tthis._secondaryHeading.innerHTML = strings.escape(secondaryHeading);\n\t\t} else {\n\t\t\tdom.clearNode(this._secondaryHeading);\n\t\t}\n\t}\n\n\tpublic setMetaTitle(value: string): void {\n\t\tif (value) {\n\t\t\tthis._metaHeading.innerHTML = strings.escape(value);\n\t\t} else {\n\t\t\tdom.clearNode(this._metaHeading);\n\t\t}\n\t}\n\n\tprotected abstract _fillBody(container: HTMLElement): void;\n\n\tpublic _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.getConfiguration().lineHeight * 1.2);\n\t\tconst bodyHeight = 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\tthis._headElement.style.height = `${heightInPixel}px`;\n\t\tthis._headElement.style.lineHeight = this._headElement.style.height;\n\t}\n\n\tprotected _doLayoutBody(heightInPixel: number, widthInPixel: number): void {\n\t\tthis._bodyElement.style.height = `${heightInPixel}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 { ReferencesModel, FileReferences, OneReference } from './referencesModel';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { ITreeRenderer, ITreeNode, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';\nimport { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel';\nimport { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { attachBadgeStyler } from 'vs/platform/theme/common/styler';\nimport * as dom from 'vs/base/browser/dom';\nimport { localize } from 'vs/nls';\nimport { getBaseLabel } from 'vs/base/common/labels';\nimport { dirname, basename } from 'vs/base/common/resources';\nimport { escape } from 'vs/base/common/strings';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';\nimport { IListVirtualDelegate, IKeyboardNavigationLabelProvider, IIdentityProvider } from 'vs/base/browser/ui/list/list';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { FuzzyScore, createMatches, IMatch } from 'vs/base/common/filters';\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 && !element.failure) {\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\t// todo@joao `OneReference` elements are lazy and their \"real\" label\n\t\t// isn't known yet\n\t\treturn basename(element.uri);\n\t}\n\n\tmightProducePrintableCharacter(event: IKeyboardEvent): boolean {\n\t\treturn this._keybindingService.mightProducePrintableCharacter(event);\n\t}\n}\n\nexport class IdentityProvider implements IIdentityProvider<TreeElement> {\n\n\tgetId(element: TreeElement): { toString(): string; } {\n\t\treturn element.id;\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\tdom.addClass(parent, '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 (element.failure) {\n\t\t\tthis.badge.setTitleFormat(localize('referencesFailre', \"Failed to resolve file.\"));\n\t\t} else if (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 before: HTMLSpanElement;\n\treadonly inside: HTMLSpanElement;\n\treadonly after: HTMLSpanElement;\n\n\tconstructor(container: HTMLElement) {\n\t\tconst parent = document.createElement('div');\n\t\tthis.before = document.createElement('span');\n\t\tthis.inside = document.createElement('span');\n\t\tthis.after = document.createElement('span');\n\t\tdom.addClass(this.inside, 'referenceMatch');\n\t\tdom.addClass(parent, 'reference');\n\t\tparent.appendChild(this.before);\n\t\tparent.appendChild(this.inside);\n\t\tparent.appendChild(this.after);\n\t\tcontainer.appendChild(parent);\n\t}\n\n\tset(element: OneReference): void {\n\t\tconst filePreview = element.parent.preview;\n\t\tconst preview = filePreview && filePreview.preview(element.range);\n\t\tif (preview) {\n\t\t\tconst { before, inside, after } = preview;\n\t\t\tthis.before.innerHTML = escape(before);\n\t\t\tthis.inside.innerHTML = escape(inside);\n\t\t\tthis.after.innerHTML = escape(after);\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(element: ITreeNode<OneReference, FuzzyScore>, index: number, templateData: OneReferenceTemplate): void {\n\t\ttemplateData.set(element.element);\n\t}\n\tdisposeTemplate(): void {\n\t\t//\n\t}\n}\n\n//#endregion\n\n\nexport class AriaProvider implements IAccessibilityProvider<FileReferences | OneReference> {\n\n\tgetAriaLabel(element: FileReferences | OneReference): string | null {\n\t\tif (element instanceof FileReferences) {\n\t\t\treturn element.getAriaMessage();\n\t\t} else if (element instanceof OneReference) {\n\t\t\treturn element.getAriaMessage();\n\t\t} else {\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';\nimport { illegalArgument, onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyMod, KeyCode } from 'vs/base/common/keyCodes';\nimport { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { IProgressService } from 'vs/platform/progress/common/progress';\nimport { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction, EditorCommand, registerEditorCommand, registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { RenameInputField, CONTEXT_RENAME_INPUT_VISIBLE } from './renameInputField';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { WorkspaceEdit, RenameProviderRegistry, RenameProvider, RenameLocation, Rejection } from 'vs/editor/common/modes';\nimport { Position, IPosition } from 'vs/editor/common/core/position';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { Range } from 'vs/editor/common/core/range';\nimport { MessageController } from 'vs/editor/contrib/message/messageController';\nimport { EditorState, CodeEditorStateFlag } from 'vs/editor/browser/core/editorState';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\n\nclass RenameSkeleton {\n\n\tprivate readonly _providers: RenameProvider[];\n\n\tconstructor(\n\t\tprivate readonly model: ITextModel,\n\t\tprivate readonly position: Position\n\t) {\n\t\tthis._providers = RenameProviderRegistry.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 | null | undefined> {\n\t\tconst firstProvider = this._providers[0];\n\t\tif (!firstProvider) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet res: RenameLocation & Rejection | null | undefined;\n\t\tif (firstProvider.resolveRenameLocation) {\n\t\t\tres = await firstProvider.resolveRenameLocation(this.model, this.position, token);\n\t\t}\n\n\t\tif (!res) {\n\t\t\tconst word = this.model.getWordAtPosition(this.position);\n\t\t\tif (word) {\n\t\t\t\treturn {\n\t\t\t\t\trange: new Range(this.position.lineNumber, word.startColumn, this.position.lineNumber, word.endColumn),\n\t\t\t\t\ttext: word.word\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tasync 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(model: ITextModel, position: Position, newName: string): Promise<WorkspaceEdit & Rejection> {\n\treturn new RenameSkeleton(model, position).provideRenameEdits(newName, 0, [], CancellationToken.None);\n}\n\n// --- register actions and commands\n\nclass RenameController extends Disposable implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.renameController';\n\n\tpublic static get(editor: ICodeEditor): RenameController {\n\t\treturn editor.getContribution<RenameController>(RenameController.ID);\n\t}\n\n\tprivate _renameInputField?: RenameInputField;\n\tprivate _renameOperationIdPool = 1;\n\n\tprivate _activeRename?: {\n\t\treadonly id: number;\n\t\treadonly operation: CancelablePromise<void>;\n\t};\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@IProgressService private readonly _progressService: IProgressService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\t\tsuper();\n\t\tthis._register(this.editor.onDidChangeModel(() => this.onModelChanged()));\n\t\tthis._register(this.editor.onDidChangeModelLanguage(() => this.onModelChanged()));\n\t\tthis._register(this.editor.onDidChangeCursorSelection(() => this.onModelChanged()));\n\t}\n\n\tprivate get renameInputField(): RenameInputField {\n\t\tif (!this._renameInputField) {\n\t\t\tthis._renameInputField = this._register(new RenameInputField(this.editor, this._themeService, this._contextKeyService));\n\t\t}\n\t\treturn this._renameInputField;\n\t}\n\n\tgetId(): string {\n\t\treturn RenameController.ID;\n\t}\n\n\tasync run(): Promise<void> {\n\t\tif (this._activeRename) {\n\t\t\tthis._activeRename.operation.cancel();\n\t\t}\n\n\t\tconst id = this._renameOperationIdPool++;\n\t\tthis._activeRename = {\n\t\t\tid,\n\t\t\toperation: createCancelablePromise(token => this.doRename(token, id))\n\t\t};\n\t\treturn this._activeRename.operation;\n\t}\n\n\tprivate async doRename(token: CancellationToken, id: number): Promise<void> {\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);\n\n\t\tif (!skeleton.hasProvider()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet loc: RenameLocation & Rejection | null | undefined;\n\t\ttry {\n\t\t\tconst resolveLocationOperation = skeleton.resolveRenameLocation(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._activeRename || this._activeRename.id !== id) {\n\t\t\treturn undefined;\n\t\t}\n\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\treturn this.renameInputField.getInput(loc.range, loc.text, selectionStart, selectionEnd).then(newNameOrFocusFlag => {\n\n\t\t\tif (typeof newNameOrFocusFlag === 'boolean') {\n\t\t\t\tif (newNameOrFocusFlag) {\n\t\t\t\t\tthis.editor.focus();\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthis.editor.focus();\n\n\t\t\tconst state = new EditorState(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value | CodeEditorStateFlag.Selection | CodeEditorStateFlag.Scroll);\n\n\t\t\tconst renameOperation = Promise.resolve(skeleton.provideRenameEdits(newNameOrFocusFlag, 0, [], token).then(result => {\n\n\t\t\t\tif (!this.editor.hasModel()) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tif (result.rejectReason) {\n\t\t\t\t\tif (state.validate(this.editor)) {\n\t\t\t\t\t\tMessageController.get(this.editor).showMessage(result.rejectReason, this.editor.getPosition());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._notificationService.info(result.rejectReason);\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn this._bulkEditService.apply(result, { editor: this.editor }).then(result => {\n\t\t\t\t\t// alert\n\t\t\t\t\tif (result.ariaSummary) {\n\t\t\t\t\t\talert(nls.localize('aria', \"Successfully renamed '{0}' to '{1}'. Summary: {2}\", loc!.text, newNameOrFocusFlag, result.ariaSummary));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}, err => {\n\t\t\t\tthis._notificationService.error(nls.localize('rename.failed', \"Rename failed to execute.\"));\n\t\t\t\treturn Promise.reject(err);\n\t\t\t}));\n\n\t\t\tthis._progressService.showWhile(renameOperation, 250);\n\t\t\treturn renameOperation;\n\n\t\t});\n\t}\n\n\tpublic acceptRenameInput(): void {\n\t\tif (this._renameInputField) {\n\t\t\tthis._renameInputField.acceptInput();\n\t\t}\n\t}\n\n\tpublic cancelRenameInput(): void {\n\t\tif (this._renameInputField) {\n\t\t\tthis._renameInputField.cancelInput(true);\n\t\t}\n\t}\n\n\tprivate onModelChanged(): void {\n\t\tif (this._activeRename) {\n\t\t\tthis._activeRename.operation.cancel();\n\t\t\tthis._activeRename = undefined;\n\t\t}\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\tmenuOpts: {\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\trunCommand(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);\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(),\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: '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\nregisterDefaultLanguageCommand('_executeDocumentRenameProvider', function (model, position, args) {\n\tlet { newName } = args;\n\tif (typeof newName !== 'string') {\n\t\tthrow illegalArgument('newName');\n\t}\n\treturn rename(model, position, newName);\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/suggest';\nimport * as nls from 'vs/nls';\nimport { createMatches } from 'vs/base/common/filters';\nimport * as strings from 'vs/base/common/strings';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';\nimport { addClass, append, $, hide, removeClass, show, toggleClass, getDomNodePagePosition, hasClass } from 'vs/base/browser/dom';\nimport { IListVirtualDelegate, IListEvent, IListRenderer, IListMouseEvent } from 'vs/base/browser/ui/list/list';\nimport { List } from 'vs/base/browser/ui/list/listWidget';\nimport { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';\nimport { Context as SuggestContext, CompletionItem } from './suggest';\nimport { CompletionModel } from './completionModel';\nimport { alert } from 'vs/base/browser/ui/aria/aria';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { attachListStyler } from 'vs/platform/theme/common/styler';\nimport { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { registerColor, editorWidgetBackground, listFocusBackground, activeContrastBorder, listHighlightForeground, editorForeground, editorWidgetBorder, focusBorder, textLinkForeground, textCodeBlockBackground } from 'vs/platform/theme/common/colorRegistry';\nimport { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { TimeoutTimer, CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { CompletionItemKind, completionKindToCssClass } from 'vs/editor/common/modes';\nimport { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';\nimport { getIconClasses } from 'vs/editor/common/services/getIconClasses';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { URI } from 'vs/base/common/uri';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { FileKind } from 'vs/platform/files/common/files';\n\nconst expandSuggestionDocsByDefault = false;\n\ninterface ISuggestionTemplateData {\n\troot: HTMLElement;\n\ticon: HTMLElement;\n\tcolorspan: HTMLElement;\n\ticonLabel: IconLabel;\n\ttypeLabel: HTMLElement;\n\treadMore: HTMLElement;\n\tdisposables: IDisposable[];\n}\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 editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: listFocusBackground, light: listFocusBackground, hc: listFocusBackground }, 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.'));\n\n\nconst colorRegExp = /^(#([\\da-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*\\))$/i;\nfunction extractColor(item: CompletionItem, out: string[]): boolean {\n\tif (item.completion.label.match(colorRegExp)) {\n\t\tout[0] = item.completion.label;\n\t\treturn true;\n\t}\n\tif (typeof item.completion.documentation === 'string' && item.completion.documentation.match(colorRegExp)) {\n\t\tout[0] = item.completion.documentation;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction canExpandCompletionItem(item: CompletionItem | null) {\n\tif (!item) {\n\t\treturn false;\n\t}\n\tconst suggestion = item.completion;\n\tif (suggestion.documentation) {\n\t\treturn true;\n\t}\n\treturn (suggestion.detail && suggestion.detail !== suggestion.label);\n}\n\nclass Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData> {\n\n\tconstructor(\n\t\tprivate widget: SuggestWidget,\n\t\tprivate editor: ICodeEditor,\n\t\tprivate triggerKeybindingLabel: string,\n\t\t@IModelService private readonly _modelService: IModelService,\n\t\t@IModeService private readonly _modeService: IModeService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t) {\n\n\t}\n\n\tget templateId(): string {\n\t\treturn 'suggestion';\n\t}\n\n\trenderTemplate(container: HTMLElement): ISuggestionTemplateData {\n\t\tconst data = <ISuggestionTemplateData>Object.create(null);\n\t\tdata.disposables = [];\n\t\tdata.root = container;\n\t\taddClass(data.root, '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.iconLabel = new IconLabel(main, { supportHighlights: true });\n\t\tdata.disposables.push(data.iconLabel);\n\n\t\tdata.typeLabel = append(main, $('span.type-label'));\n\n\t\tdata.readMore = append(main, $('span.readMore'));\n\t\tdata.readMore.title = nls.localize('readMore', \"Read More...{0}\", this.triggerKeybindingLabel);\n\n\t\tconst configureFont = () => {\n\t\t\tconst configuration = this.editor.getConfiguration();\n\t\t\tconst fontFamily = configuration.fontInfo.fontFamily;\n\t\t\tconst fontSize = configuration.contribInfo.suggestFontSize || configuration.fontInfo.fontSize;\n\t\t\tconst lineHeight = configuration.contribInfo.suggestLineHeight || configuration.fontInfo.lineHeight;\n\t\t\tconst fontWeight = configuration.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.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\tEvent.chain<IConfigurationChangedEvent>(this.editor.onDidChangeConfiguration.bind(this.editor))\n\t\t\t.filter(e => e.fontInfo || e.contribInfo)\n\t\t\t.on(configureFont, null, data.disposables);\n\n\t\treturn data;\n\t}\n\n\trenderElement(element: CompletionItem, _index: number, templateData: ISuggestionTemplateData): void {\n\t\tconst data = <ISuggestionTemplateData>templateData;\n\t\tconst suggestion = (<CompletionItem>element).completion;\n\n\t\tdata.icon.className = 'icon ' + completionKindToCssClass(suggestion.kind);\n\t\tdata.colorspan.style.backgroundColor = '';\n\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 (suggestion.kind === CompletionItemKind.Color && extractColor(element, color)) {\n\t\t\t// special logic for 'color' completion items\n\t\t\tdata.icon.className = 'icon customcolor';\n\t\t\tdata.colorspan.style.backgroundColor = color[0];\n\n\t\t} else if (suggestion.kind === CompletionItemKind.File && this._themeService.getIconTheme().hasFileIcons) {\n\t\t\t// special logic for 'file' completion items\n\t\t\tdata.icon.className = 'icon hide';\n\t\t\tlabelOptions.extraClasses = ([] as string[]).concat(\n\t\t\t\tgetIconClasses(this._modelService, this._modeService, URI.from({ scheme: 'fake', path: suggestion.label }), FileKind.FILE),\n\t\t\t\tgetIconClasses(this._modelService, this._modeService, URI.from({ scheme: 'fake', path: suggestion.detail }), FileKind.FILE)\n\t\t\t);\n\n\t\t} else if (suggestion.kind === CompletionItemKind.Folder && this._themeService.getIconTheme().hasFolderIcons) {\n\t\t\t// special logic for 'folder' completion items\n\t\t\tdata.icon.className = 'icon hide';\n\t\t\tlabelOptions.extraClasses = ([] as string[]).concat(\n\t\t\t\tgetIconClasses(this._modelService, this._modeService, URI.from({ scheme: 'fake', path: suggestion.label }), FileKind.FOLDER),\n\t\t\t\tgetIconClasses(this._modelService, this._modeService, URI.from({ scheme: 'fake', path: suggestion.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\tlabelOptions.extraClasses = [\n\t\t\t\t`suggest-icon ${completionKindToCssClass(suggestion.kind)}`\n\t\t\t];\n\t\t}\n\n\t\tdata.iconLabel.setLabel(suggestion.label, undefined, labelOptions);\n\t\tdata.typeLabel.textContent = (suggestion.detail || '').replace(/\\n.*$/m, '');\n\n\t\tif (canExpandCompletionItem(element)) {\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.widget.toggleDetails();\n\t\t\t};\n\t\t} else {\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(templateData.disposables);\n\t}\n}\n\nconst enum State {\n\tHidden,\n\tLoading,\n\tEmpty,\n\tOpen,\n\tFrozen,\n\tDetails\n}\n\nclass SuggestionDetails {\n\n\tprivate el: HTMLElement;\n\tprivate close: HTMLElement;\n\tprivate scrollbar: DomScrollableElement;\n\tprivate body: HTMLElement;\n\tprivate header: HTMLElement;\n\tprivate type: HTMLElement;\n\tprivate docs: HTMLElement;\n\tprivate ariaLabel: string | null;\n\tprivate disposables: IDisposable[];\n\tprivate renderDisposeable: IDisposable;\n\tprivate borderWidth: number = 1;\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate readonly widget: SuggestWidget,\n\t\tprivate readonly editor: ICodeEditor,\n\t\tprivate readonly markdownRenderer: MarkdownRenderer,\n\t\tprivate readonly triggerKeybindingLabel: string\n\t) {\n\t\tthis.disposables = [];\n\n\t\tthis.el = append(container, $('.details'));\n\t\tthis.disposables.push(toDisposable(() => container.removeChild(this.el)));\n\n\t\tthis.body = $('.body');\n\n\t\tthis.scrollbar = new DomScrollableElement(this.body, {});\n\t\tappend(this.el, this.scrollbar.getDomNode());\n\t\tthis.disposables.push(this.scrollbar);\n\n\t\tthis.header = append(this.body, $('.header'));\n\t\tthis.close = append(this.header, $('span.close'));\n\t\tthis.close.title = nls.localize('readLess', \"Read less...{0}\", this.triggerKeybindingLabel);\n\t\tthis.type = append(this.header, $('p.type'));\n\n\t\tthis.docs = append(this.body, $('p.docs'));\n\t\tthis.ariaLabel = null;\n\n\t\tthis.configureFont();\n\n\t\tEvent.chain<IConfigurationChangedEvent>(this.editor.onDidChangeConfiguration.bind(this.editor))\n\t\t\t.filter(e => e.fontInfo)\n\t\t\t.on(this.configureFont, this, this.disposables);\n\n\t\tmarkdownRenderer.onDidRenderCodeBlock(() => this.scrollbar.scanDomNode(), this, this.disposables);\n\t}\n\n\tget element() {\n\t\treturn this.el;\n\t}\n\n\trender(item: CompletionItem): void {\n\t\tthis.renderDisposeable = dispose(this.renderDisposeable);\n\n\t\tif (!item || !canExpandCompletionItem(item)) {\n\t\t\tthis.type.textContent = '';\n\t\t\tthis.docs.textContent = '';\n\t\t\taddClass(this.el, 'no-docs');\n\t\t\tthis.ariaLabel = null;\n\t\t\treturn;\n\t\t}\n\t\tremoveClass(this.el, 'no-docs');\n\t\tif (typeof item.completion.documentation === 'string') {\n\t\t\tremoveClass(this.docs, 'markdown-docs');\n\t\t\tthis.docs.textContent = item.completion.documentation;\n\t\t} else {\n\t\t\taddClass(this.docs, 'markdown-docs');\n\t\t\tthis.docs.innerHTML = '';\n\t\t\tconst renderedContents = this.markdownRenderer.render(item.completion.documentation);\n\t\t\tthis.renderDisposeable = renderedContents;\n\t\t\tthis.docs.appendChild(renderedContents.element);\n\t\t}\n\n\t\tif (item.completion.detail) {\n\t\t\tthis.type.innerText = item.completion.detail;\n\t\t\tshow(this.type);\n\t\t} else {\n\t\t\tthis.type.innerText = '';\n\t\t\thide(this.type);\n\t\t}\n\n\t\tthis.el.style.height = this.header.offsetHeight + this.docs.offsetHeight + (this.borderWidth * 2) + 'px';\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.widget.toggleDetails();\n\t\t};\n\n\t\tthis.body.scrollTop = 0;\n\t\tthis.scrollbar.scanDomNode();\n\n\t\tthis.ariaLabel = strings.format(\n\t\t\t'{0}{1}',\n\t\t\titem.completion.detail || '',\n\t\t\titem.completion.documentation ? (typeof item.completion.documentation === 'string' ? item.completion.documentation : item.completion.documentation.value) : '');\n\t}\n\n\tgetAriaLabel() {\n\t\treturn this.ariaLabel;\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\tsetBorderWidth(width: number): void {\n\t\tthis.borderWidth = width;\n\t}\n\n\tprivate configureFont() {\n\t\tconst configuration = this.editor.getConfiguration();\n\t\tconst fontFamily = configuration.fontInfo.fontFamily;\n\t\tconst fontSize = configuration.contribInfo.suggestFontSize || configuration.fontInfo.fontSize;\n\t\tconst lineHeight = configuration.contribInfo.suggestLineHeight || configuration.fontInfo.lineHeight;\n\t\tconst fontWeight = configuration.fontInfo.fontWeight;\n\t\tconst fontSizePx = `${fontSize}px`;\n\t\tconst lineHeightPx = `${lineHeight}px`;\n\n\t\tthis.el.style.fontSize = fontSizePx;\n\t\tthis.el.style.fontWeight = fontWeight;\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\tdispose(): void {\n\t\tthis.disposables = dispose(this.disposables);\n\t\tthis.renderDisposeable = dispose(this.renderDisposeable);\n\t}\n}\n\nexport interface ISelectedSuggestion {\n\titem: CompletionItem;\n\tindex: number;\n\tmodel: CompletionModel;\n}\n\nexport class SuggestWidget implements IContentWidget, IListVirtualDelegate<CompletionItem>, IDisposable {\n\n\tprivate static readonly ID: string = 'editor.widget.suggestWidget';\n\n\tstatic LOADING_MESSAGE: string = nls.localize('suggestWidget.loading', \"Loading...\");\n\tstatic NO_SUGGESTIONS_MESSAGE: string = nls.localize('suggestWidget.noSuggestions', \"No suggestions.\");\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\treadonly allowEditorOverflow = true;\n\n\tprivate state: State | null;\n\tprivate isAuto: boolean;\n\tprivate loadingTimeout: any;\n\tprivate currentSuggestionDetails: CancelablePromise<void> | null;\n\tprivate focusedItem: CompletionItem | null;\n\tprivate ignoreFocusEvents = false;\n\tprivate completionModel: CompletionModel | null;\n\n\tprivate element: HTMLElement;\n\tprivate messageElement: HTMLElement;\n\tprivate listElement: HTMLElement;\n\tprivate details: SuggestionDetails;\n\tprivate list: List<CompletionItem>;\n\tprivate listHeight: number;\n\n\tprivate readonly suggestWidgetVisible: IContextKey<boolean>;\n\tprivate readonly suggestWidgetMultipleSuggestions: IContextKey<boolean>;\n\n\tprivate readonly editorBlurTimeout = new TimeoutTimer();\n\tprivate readonly showTimeout = new TimeoutTimer();\n\tprivate toDispose: IDisposable[];\n\n\tprivate onDidSelectEmitter = new Emitter<ISelectedSuggestion>();\n\tprivate onDidFocusEmitter = new Emitter<ISelectedSuggestion>();\n\tprivate onDidHideEmitter = new Emitter<this>();\n\tprivate onDidShowEmitter = new Emitter<this>();\n\n\n\treadonly onDidSelect: Event<ISelectedSuggestion> = this.onDidSelectEmitter.event;\n\treadonly onDidFocus: Event<ISelectedSuggestion> = this.onDidFocusEmitter.event;\n\treadonly onDidHide: Event<this> = this.onDidHideEmitter.event;\n\treadonly onDidShow: Event<this> = this.onDidShowEmitter.event;\n\n\tprivate readonly maxWidgetWidth = 660;\n\tprivate readonly listWidth = 330;\n\tprivate readonly storageService: IStorageService;\n\tprivate detailsFocusBorderColor: string;\n\tprivate detailsBorderColor: string;\n\n\tprivate firstFocusInCurrentList: boolean = false;\n\n\tprivate preferDocPositionTop: boolean = false;\n\tprivate docsPositionPreviousWidgetY: number | null;\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IThemeService themeService: IThemeService,\n\t\t@IStorageService storageService: IStorageService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IModeService modeService: IModeService,\n\t\t@IOpenerService openerService: IOpenerService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tconst kb = keybindingService.lookupKeybinding('editor.action.triggerSuggest');\n\t\tconst triggerKeybindingLabel = !kb ? '' : ` (${kb.getLabel()})`;\n\t\tconst markdownRenderer = new MarkdownRenderer(editor, modeService, openerService);\n\n\t\tthis.isAuto = false;\n\t\tthis.focusedItem = null;\n\t\tthis.storageService = storageService;\n\n\t\tthis.element = $('.editor-widget.suggest-widget');\n\n\t\tthis.messageElement = append(this.element, $('.message'));\n\t\tthis.listElement = append(this.element, $('.tree'));\n\t\tthis.details = new SuggestionDetails(this.element, this, this.editor, markdownRenderer, triggerKeybindingLabel);\n\n\t\tconst applyIconStyle = () => toggleClass(this.element, 'no-icons', !this.editor.getConfiguration().contribInfo.suggest.showIcons);\n\t\tapplyIconStyle();\n\n\t\tlet renderer = instantiationService.createInstance(Renderer, this, this.editor, triggerKeybindingLabel);\n\n\t\tthis.list = new List(this.listElement, this, [renderer], {\n\t\t\tuseShadows: false,\n\t\t\topenController: { shouldOpen: () => false },\n\t\t\tmouseSupport: false\n\t\t});\n\n\t\tthis.toDispose = [\n\t\t\tattachListStyler(this.list, themeService, {\n\t\t\t\tlistInactiveFocusBackground: editorSuggestWidgetSelectedBackground,\n\t\t\t\tlistInactiveFocusOutline: activeContrastBorder\n\t\t\t}),\n\t\t\tthemeService.onThemeChange(t => this.onThemeChange(t)),\n\t\t\teditor.onDidLayoutChange(() => this.onEditorLayoutChange()),\n\t\t\tthis.list.onMouseDown(e => this.onListMouseDown(e)),\n\t\t\tthis.list.onSelectionChange(e => this.onListSelection(e)),\n\t\t\tthis.list.onFocusChange(e => this.onListFocus(e)),\n\t\t\tthis.editor.onDidChangeCursorSelection(() => this.onCursorSelectionChanged()),\n\t\t\tthis.editor.onDidChangeConfiguration(e => e.contribInfo && applyIconStyle())\n\t\t];\n\n\t\tthis.suggestWidgetVisible = SuggestContext.Visible.bindTo(contextKeyService);\n\t\tthis.suggestWidgetMultipleSuggestions = SuggestContext.MultipleSuggestions.bindTo(contextKeyService);\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.setState(State.Hidden);\n\n\t\tthis.onThemeChange(themeService.getTheme());\n\t}\n\n\tprivate onCursorSelectionChanged(): void {\n\t\tif (this.state === State.Hidden) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tprivate onEditorLayoutChange(): void {\n\t\tif ((this.state === State.Open || this.state === State.Details) && this.expandDocsSettingFromStorage()) {\n\t\t\tthis.expandSideOrBelow();\n\t\t}\n\t}\n\n\tprivate onListMouseDown(e: IListMouseEvent<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\treturn;\n\t\t}\n\n\t\tthis.select(e.elements[0], e.indexes[0]);\n\t}\n\n\tprivate select(item: CompletionItem, index: number): void {\n\t\tconst completionModel = this.completionModel;\n\n\t\tif (!completionModel) {\n\t\t\treturn;\n\t\t}\n\n\t\titem.resolve(CancellationToken.None).then(() => {\n\t\t\tthis.onDidSelectEmitter.fire({ item, index, model: completionModel });\n\t\t\tthis.editor.focus();\n\t\t});\n\t}\n\n\tprivate _getSuggestionAriaAlertLabel(item: CompletionItem): string {\n\t\tif (this.expandDocsSettingFromStorage()) {\n\t\t\treturn nls.localize('ariaCurrenttSuggestionReadDetails', \"Item {0}, docs: {1}\", item.completion.label, this.details.getAriaLabel());\n\t\t} else {\n\t\t\treturn item.completion.label;\n\t\t}\n\t}\n\n\tprivate _lastAriaAlertLabel: string | null;\n\tprivate _ariaAlert(newAriaAlertLabel: string | null): void {\n\t\tif (this._lastAriaAlertLabel === newAriaAlertLabel) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lastAriaAlertLabel = newAriaAlertLabel;\n\t\tif (this._lastAriaAlertLabel) {\n\t\t\talert(this._lastAriaAlertLabel, true);\n\t\t}\n\t}\n\n\tprivate onThemeChange(theme: ITheme) {\n\t\tconst backgroundColor = theme.getColor(editorSuggestWidgetBackground);\n\t\tif (backgroundColor) {\n\t\t\tthis.listElement.style.backgroundColor = backgroundColor.toString();\n\t\t\tthis.details.element.style.backgroundColor = backgroundColor.toString();\n\t\t\tthis.messageElement.style.backgroundColor = backgroundColor.toString();\n\t\t}\n\t\tconst borderColor = theme.getColor(editorSuggestWidgetBorder);\n\t\tif (borderColor) {\n\t\t\tthis.listElement.style.borderColor = borderColor.toString();\n\t\t\tthis.details.element.style.borderColor = borderColor.toString();\n\t\t\tthis.messageElement.style.borderColor = borderColor.toString();\n\t\t\tthis.detailsBorderColor = borderColor.toString();\n\t\t}\n\t\tconst focusBorderColor = theme.getColor(focusBorder);\n\t\tif (focusBorderColor) {\n\t\t\tthis.detailsFocusBorderColor = focusBorderColor.toString();\n\t\t}\n\t\tthis.details.setBorderWidth(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 = null;\n\t\t\t\tthis.focusedItem = null;\n\t\t\t}\n\n\t\t\tthis._ariaAlert(null);\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\tthis.firstFocusInCurrentList = !this.focusedItem;\n\t\tif (item !== this.focusedItem) {\n\n\n\t\t\tif (this.currentSuggestionDetails) {\n\t\t\t\tthis.currentSuggestionDetails.cancel();\n\t\t\t\tthis.currentSuggestionDetails = null;\n\t\t\t}\n\n\t\t\tthis.focusedItem = item;\n\n\t\t\tthis.list.reveal(index);\n\n\t\t\tthis.currentSuggestionDetails = createCancelablePromise(token => item.resolve(token));\n\n\t\t\tthis.currentSuggestionDetails.then(() => {\n\t\t\t\tif (this.list.length < 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.expandDocsSettingFromStorage()) {\n\t\t\t\t\tthis.showDetails();\n\t\t\t\t} else {\n\t\t\t\t\tremoveClass(this.element, 'docs-side');\n\t\t\t\t}\n\n\t\t\t\tthis._ariaAlert(this._getSuggestionAriaAlertLabel(item));\n\t\t\t}).catch(onUnexpectedError).then(() => {\n\t\t\t\tif (this.focusedItem === item) {\n\t\t\t\t\tthis.currentSuggestionDetails = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// emit an event\n\t\tthis.onDidFocusEmitter.fire({ item, index, model: this.completionModel });\n\t}\n\n\tprivate setState(state: State): void {\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst stateChanged = this.state !== state;\n\t\tthis.state = state;\n\n\t\ttoggleClass(this.element, 'frozen', state === State.Frozen);\n\n\t\tswitch (state) {\n\t\t\tcase State.Hidden:\n\t\t\t\thide(this.messageElement, this.details.element, this.listElement);\n\t\t\t\tthis.hide();\n\t\t\t\tthis.listHeight = 0;\n\t\t\t\tif (stateChanged) {\n\t\t\t\t\tthis.list.splice(0, this.list.length);\n\t\t\t\t}\n\t\t\t\tthis.focusedItem = null;\n\t\t\t\tbreak;\n\t\t\tcase State.Loading:\n\t\t\t\tthis.messageElement.textContent = SuggestWidget.LOADING_MESSAGE;\n\t\t\t\thide(this.listElement, this.details.element);\n\t\t\t\tshow(this.messageElement);\n\t\t\t\tremoveClass(this.element, 'docs-side');\n\t\t\t\tthis.show();\n\t\t\t\tthis.focusedItem = null;\n\t\t\t\tbreak;\n\t\t\tcase State.Empty:\n\t\t\t\tthis.messageElement.textContent = SuggestWidget.NO_SUGGESTIONS_MESSAGE;\n\t\t\t\thide(this.listElement, this.details.element);\n\t\t\t\tshow(this.messageElement);\n\t\t\t\tremoveClass(this.element, 'docs-side');\n\t\t\t\tthis.show();\n\t\t\t\tthis.focusedItem = null;\n\t\t\t\tbreak;\n\t\t\tcase State.Open:\n\t\t\t\thide(this.messageElement);\n\t\t\t\tshow(this.listElement);\n\t\t\t\tthis.show();\n\t\t\t\tbreak;\n\t\t\tcase State.Frozen:\n\t\t\t\thide(this.messageElement);\n\t\t\t\tshow(this.listElement);\n\t\t\t\tthis.show();\n\t\t\t\tbreak;\n\t\t\tcase State.Details:\n\t\t\t\thide(this.messageElement);\n\t\t\t\tshow(this.details.element, this.listElement);\n\t\t\t\tthis.show();\n\t\t\t\tthis._ariaAlert(this.details.getAriaLabel());\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tshowTriggered(auto: boolean, delay: number) {\n\t\tif (this.state !== State.Hidden) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isAuto = !!auto;\n\n\t\tif (!this.isAuto) {\n\t\t\tthis.loadingTimeout = setTimeout(() => {\n\t\t\t\tthis.loadingTimeout = null;\n\t\t\t\tthis.setState(State.Loading);\n\t\t\t}, delay);\n\t\t}\n\t}\n\n\tshowSuggestions(completionModel: CompletionModel, selectionIndex: number, isFrozen: boolean, isAuto: boolean): void {\n\t\tthis.preferDocPositionTop = false;\n\t\tthis.docsPositionPreviousWidgetY = null;\n\n\t\tif (this.loadingTimeout) {\n\t\t\tclearTimeout(this.loadingTimeout);\n\t\t\tthis.loadingTimeout = null;\n\t\t}\n\n\t\tif (this.currentSuggestionDetails) {\n\t\t\tthis.currentSuggestionDetails.cancel();\n\t\t\tthis.currentSuggestionDetails = null;\n\t\t}\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\tlet visibleCount = this.completionModel.items.length;\n\n\t\tconst isEmpty = visibleCount === 0;\n\t\tthis.suggestWidgetMultipleSuggestions.set(visibleCount > 1);\n\n\t\tif (isEmpty) {\n\t\t\tif (isAuto) {\n\t\t\t\tthis.setState(State.Hidden);\n\t\t\t} else {\n\t\t\t\tthis.setState(State.Empty);\n\t\t\t}\n\n\t\t\tthis.completionModel = null;\n\n\t\t} else {\n\n\t\t\tif (this.state !== State.Open) {\n\t\t\t\tconst { stats } = this.completionModel;\n\t\t\t\tstats['wasAutomaticallyTriggered'] = !!isAuto;\n\t\t\t\t/* __GDPR__\n\t\t\t\t\t\"suggestWidget\" : {\n\t\t\t\t\t\t\"wasAutomaticallyTriggered\" : { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\", \"isMeasurement\": true },\n\t\t\t\t\t\t\"${include}\": [\n\t\t\t\t\t\t\t\"${ICompletionStats}\",\n\t\t\t\t\t\t\t\"${EditorTelemetryData}\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tthis.telemetryService.publicLog('suggestWidget', { ...stats, ...this.editor.getTelemetryData() });\n\t\t\t}\n\n\t\t\tthis.focusedItem = null;\n\t\t\tthis.list.splice(0, this.list.length, this.completionModel.items);\n\n\t\t\tif (isFrozen) {\n\t\t\t\tthis.setState(State.Frozen);\n\t\t\t} else {\n\t\t\t\tthis.setState(State.Open);\n\t\t\t}\n\n\t\t\tthis.list.reveal(selectionIndex, 0);\n\t\t\tthis.list.setFocus([selectionIndex]);\n\n\t\t\t// Reset focus border\n\t\t\tif (this.detailsBorderColor) {\n\t\t\t\tthis.details.element.style.borderColor = this.detailsBorderColor;\n\t\t\t}\n\t\t}\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.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.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.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.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\tif (this.detailsBorderColor) {\n\t\t\t\tthis.details.element.style.borderColor = this.detailsBorderColor;\n\t\t\t}\n\t\t} else if (this.state === State.Open && this.expandDocsSettingFromStorage()) {\n\t\t\tthis.setState(State.Details);\n\t\t\tif (this.detailsFocusBorderColor) {\n\t\t\t\tthis.details.element.style.borderColor = this.detailsFocusBorderColor;\n\t\t\t}\n\t\t}\n\t\t/* __GDPR__\n\t\t\t\"suggestWidget:toggleDetailsFocus\" : {\n\t\t\t\t\"${include}\": [\n\t\t\t\t\t\"${EditorTelemetryData}\"\n\t\t\t\t]\n\t\t\t}\n\t\t*/\n\t\tthis.telemetryService.publicLog('suggestWidget:toggleDetailsFocus', this.editor.getTelemetryData());\n\t}\n\n\ttoggleDetails(): void {\n\t\tif (!canExpandCompletionItem(this.list.getFocusedElements()[0])) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.expandDocsSettingFromStorage()) {\n\t\t\tthis.updateExpandDocsSetting(false);\n\t\t\thide(this.details.element);\n\t\t\tremoveClass(this.element, 'docs-side');\n\t\t\tremoveClass(this.element, 'docs-below');\n\t\t\tthis.editor.layoutContentWidget(this);\n\t\t\t/* __GDPR__\n\t\t\t\t\"suggestWidget:collapseDetails\" : {\n\t\t\t\t\t\"${include}\": [\n\t\t\t\t\t\t\"${EditorTelemetryData}\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t*/\n\t\t\tthis.telemetryService.publicLog('suggestWidget:collapseDetails', this.editor.getTelemetryData());\n\t\t} else {\n\t\t\tif (this.state !== State.Open && this.state !== State.Details && this.state !== State.Frozen) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.updateExpandDocsSetting(true);\n\t\t\tthis.showDetails();\n\t\t\tthis._ariaAlert(this.details.getAriaLabel());\n\t\t\t/* __GDPR__\n\t\t\t\t\"suggestWidget:expandDetails\" : {\n\t\t\t\t\t\"${include}\": [\n\t\t\t\t\t\t\"${EditorTelemetryData}\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t*/\n\t\t\tthis.telemetryService.publicLog('suggestWidget:expandDetails', this.editor.getTelemetryData());\n\t\t}\n\t}\n\n\tshowDetails(): void {\n\t\tthis.expandSideOrBelow();\n\n\t\tshow(this.details.element);\n\t\tthis.details.render(this.list.getFocusedElements()[0]);\n\t\tthis.details.element.style.maxHeight = this.maxWidgetHeight + 'px';\n\n\t\t// Reset margin-top that was set as Fix for #26416\n\t\tthis.listElement.style.marginTop = '0px';\n\n\t\t// with docs showing up widget width/height may change, so reposition the widget\n\t\tthis.editor.layoutContentWidget(this);\n\n\t\tthis.adjustDocsPosition();\n\n\t\tthis.editor.focus();\n\t}\n\n\tprivate show(): void {\n\t\tconst newHeight = this.updateListHeight();\n\t\tif (newHeight !== this.listHeight) {\n\t\t\tthis.editor.layoutContentWidget(this);\n\t\t\tthis.listHeight = newHeight;\n\t\t}\n\n\t\tthis.suggestWidgetVisible.set(true);\n\n\t\tthis.showTimeout.cancelAndSet(() => {\n\t\t\taddClass(this.element, 'visible');\n\t\t\tthis.onDidShowEmitter.fire(this);\n\t\t}, 100);\n\t}\n\n\tprivate hide(): void {\n\t\tthis.suggestWidgetVisible.reset();\n\t\tthis.suggestWidgetMultipleSuggestions.reset();\n\t\tremoveClass(this.element, 'visible');\n\t}\n\n\thideWidget(): void {\n\t\tclearTimeout(this.loadingTimeout);\n\t\tthis.setState(State.Hidden);\n\t\tthis.onDidHideEmitter.fire(this);\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\tif (this.state === State.Hidden) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet preference = [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE];\n\t\tif (this.preferDocPositionTop) {\n\t\t\tpreference = [ContentWidgetPositionPreference.ABOVE];\n\t\t}\n\n\t\treturn {\n\t\t\tposition: this.editor.getPosition(),\n\t\t\tpreference: preference\n\t\t};\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\treturn this.element;\n\t}\n\n\tgetId(): string {\n\t\treturn SuggestWidget.ID;\n\t}\n\n\tprivate updateListHeight(): number {\n\t\tlet height = 0;\n\n\t\tif (this.state === State.Empty || this.state === State.Loading) {\n\t\t\theight = this.unfocusedHeight;\n\t\t} else {\n\t\t\tconst suggestionCount = this.list.contentHeight / this.unfocusedHeight;\n\t\t\tconst { maxVisibleSuggestions } = this.editor.getConfiguration().contribInfo.suggest;\n\t\t\theight = Math.min(suggestionCount, maxVisibleSuggestions) * this.unfocusedHeight;\n\t\t}\n\n\t\tthis.element.style.lineHeight = `${this.unfocusedHeight}px`;\n\t\tthis.listElement.style.height = `${height}px`;\n\t\tthis.list.layout(height);\n\t\treturn height;\n\t}\n\n\t/**\n\t * Adds the propert classes, margins when positioning the docs to the side\n\t */\n\tprivate adjustDocsPosition() {\n\t\tif (!this.editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineHeight = this.editor.getConfiguration().fontInfo.lineHeight;\n\t\tconst cursorCoords = this.editor.getScrolledVisiblePosition(this.editor.getPosition());\n\t\tconst editorCoords = getDomNodePagePosition(this.editor.getDomNode());\n\t\tconst cursorX = editorCoords.left + cursorCoords.left;\n\t\tconst cursorY = editorCoords.top + cursorCoords.top + cursorCoords.height;\n\t\tconst widgetCoords = getDomNodePagePosition(this.element);\n\t\tconst widgetX = widgetCoords.left;\n\t\tconst widgetY = widgetCoords.top;\n\n\t\t// Fixes #27649\n\t\t// Check if the Y changed to the top of the cursor and keep the widget flagged to prefer top\n\t\tif (this.docsPositionPreviousWidgetY &&\n\t\t\tthis.docsPositionPreviousWidgetY < widgetY &&\n\t\t\t!this.preferDocPositionTop) {\n\t\t\tthis.preferDocPositionTop = true;\n\t\t\tthis.adjustDocsPosition();\n\t\t\treturn;\n\t\t}\n\t\tthis.docsPositionPreviousWidgetY = widgetY;\n\n\t\tif (widgetX < cursorX - this.listWidth) {\n\t\t\t// Widget is too far to the left of cursor, swap list and docs\n\t\t\taddClass(this.element, 'list-right');\n\t\t} else {\n\t\t\tremoveClass(this.element, 'list-right');\n\t\t}\n\n\t\t// Compare top of the cursor (cursorY - lineheight) with widgetTop to determine if\n\t\t// margin-top needs to be applied on list to make it appear right above the cursor\n\t\t// Cannot compare cursorY directly as it may be a few decimals off due to zoooming\n\t\tif (hasClass(this.element, 'docs-side')\n\t\t\t&& cursorY - lineHeight > widgetY\n\t\t\t&& this.details.element.offsetHeight > this.listElement.offsetHeight) {\n\n\t\t\t// Fix for #26416\n\t\t\t// Docs is bigger than list and widget is above cursor, apply margin-top so that list appears right above cursor\n\t\t\tthis.listElement.style.marginTop = `${this.details.element.offsetHeight - this.listElement.offsetHeight}px`;\n\t\t}\n\t}\n\n\t/**\n\t * Adds the proper classes for positioning the docs to the side or below\n\t */\n\tprivate expandSideOrBelow() {\n\t\tif (!canExpandCompletionItem(this.focusedItem) && this.firstFocusInCurrentList) {\n\t\t\tremoveClass(this.element, 'docs-side');\n\t\t\tremoveClass(this.element, 'docs-below');\n\t\t\treturn;\n\t\t}\n\n\t\tlet matches = this.element.style.maxWidth!.match(/(\\d+)px/);\n\t\tif (!matches || Number(matches[1]) < this.maxWidgetWidth) {\n\t\t\taddClass(this.element, 'docs-below');\n\t\t\tremoveClass(this.element, 'docs-side');\n\t\t} else if (canExpandCompletionItem(this.focusedItem)) {\n\t\t\taddClass(this.element, 'docs-side');\n\t\t\tremoveClass(this.element, 'docs-below');\n\t\t}\n\t}\n\n\t// Heights\n\n\tprivate get maxWidgetHeight(): number {\n\t\treturn this.unfocusedHeight * this.editor.getConfiguration().contribInfo.suggest.maxVisibleSuggestions;\n\t}\n\n\tprivate get unfocusedHeight(): number {\n\t\tconst configuration = this.editor.getConfiguration();\n\t\treturn configuration.contribInfo.suggestLineHeight || configuration.fontInfo.lineHeight;\n\t}\n\n\t// IDelegate\n\n\tgetHeight(element: CompletionItem): number {\n\t\treturn this.unfocusedHeight;\n\t}\n\n\tgetTemplateId(element: CompletionItem): string {\n\t\treturn 'suggestion';\n\t}\n\n\tprivate expandDocsSettingFromStorage(): boolean {\n\t\treturn this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault);\n\t}\n\n\tprivate updateExpandDocsSetting(value: boolean) {\n\t\tthis.storageService.store('expandSuggestionDocs', value, StorageScope.GLOBAL);\n\t}\n\n\tdispose(): void {\n\t\tthis.state = null;\n\t\tthis.currentSuggestionDetails = null;\n\t\tthis.focusedItem = null;\n\t\tthis.element = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.messageElement = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.listElement = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.details.dispose();\n\t\tthis.details = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.list.dispose();\n\t\tthis.list = null!; // StrictNullOverride: nulling out ok in dispose\n\t\tthis.toDispose = dispose(this.toDispose);\n\t\tif (this.loadingTimeout) {\n\t\t\tclearTimeout(this.loadingTimeout);\n\t\t\tthis.loadingTimeout = null;\n\t\t}\n\n\t\tthis.editorBlurTimeout.dispose();\n\t\tthis.showTimeout.dispose();\n\t}\n}\n\nregisterThemingParticipant((theme, collector) => {\n\tconst matchHighlight = theme.getColor(editorSuggestWidgetHighlightForeground);\n\tif (matchHighlight) {\n\t\tcollector.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${matchHighlight}; }`);\n\t}\n\tconst foreground = theme.getColor(editorSuggestWidgetForeground);\n\tif (foreground) {\n\t\tcollector.addRule(`.monaco-editor .suggest-widget { color: ${foreground}; }`);\n\t}\n\n\tconst link = theme.getColor(textLinkForeground);\n\tif (link) {\n\t\tcollector.addRule(`.monaco-editor .suggest-widget a { color: ${link}; }`);\n\t}\n\n\tconst codeBackground = theme.getColor(textCodeBlockBackground);\n\tif (codeBackground) {\n\t\tcollector.addRule(`.monaco-editor .suggest-widget 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 * as nls from 'vs/nls';\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, IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerDefaultLanguageCommand, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/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 * as editorCommon from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { IModelDeltaDecoration, ITextModel, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProviderRegistry } from 'vs/editor/common/modes';\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, overviewRulerSelectionHighlightForeground, registerColor } from 'vs/platform/theme/common/colorRegistry';\nimport { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService';\n\nexport const 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);\nexport const 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);\nexport const 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.'));\nexport const 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.'));\n\nexport const 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);\nexport const 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);\n\nexport const ctxHasWordHighlights = new RawContextKey<boolean>('hasWordHighlights', false);\n\nexport function getOccurrencesAtPosition(model: ITextModel, position: Position, token: CancellationToken): Promise<DocumentHighlight[] | null | undefined> {\n\n\tconst orderedByScore = DocumentHighlightProviderRegistry.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\tpublic readonly result: CancelablePromise<DocumentHighlight[]>;\n\n\tconstructor(model: ITextModel, selection: Selection, wordSeparators: string) {\n\t\tthis._wordRange = this._getCurrentWordRange(model, selection);\n\t\tthis.result = createCancelablePromise(token => this._compute(model, selection, wordSeparators, token));\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\tprotected _compute(model: ITextModel, selection: Selection, wordSeparators: string, token: CancellationToken): Promise<DocumentHighlight[]> {\n\t\treturn getOccurrencesAtPosition(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) {\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 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(model: ITextModel, selection: Selection, wordSeparators: string): IOccurenceAtPositionRequest {\n\tif (DocumentHighlightProviderRegistry.has(model)) {\n\t\treturn new SemanticOccurenceAtPositionRequest(model, selection, wordSeparators);\n\t}\n\treturn new TextualOccurenceAtPositionRequest(model, selection, wordSeparators);\n}\n\nregisterDefaultLanguageCommand('_executeDocumentHighlights', (model, position) => getOccurrencesAtPosition(model, position, CancellationToken.None));\n\nclass WordHighlighter {\n\n\tprivate readonly editor: IActiveCodeEditor;\n\tprivate occurrencesHighlight: boolean;\n\tprivate readonly model: ITextModel;\n\tprivate _decorationIds: string[];\n\tprivate toUnhook: IDisposable[];\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, contextKeyService: IContextKeyService) {\n\t\tthis.editor = editor;\n\t\tthis._hasWordHighlights = ctxHasWordHighlights.bindTo(contextKeyService);\n\t\tthis._ignorePositionChangeEvent = false;\n\t\tthis.occurrencesHighlight = this.editor.getConfiguration().contribInfo.occurrencesHighlight;\n\t\tthis.model = this.editor.getModel();\n\t\tthis.toUnhook = [];\n\t\tthis.toUnhook.push(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.push(editor.onDidChangeModelContent((e) => {\n\t\t\tthis._stopAll();\n\t\t}));\n\t\tthis.toUnhook.push(editor.onDidChangeConfiguration((e) => {\n\t\t\tlet newValue = this.editor.getConfiguration().contribInfo.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 = arrays.firstIndex(highlights, (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} 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 = arrays.firstIndex(highlights, (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} 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 _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 lineNumber = editorSelection.startLineNumber;\n\t\tlet startColumn = editorSelection.startColumn;\n\t\tlet endColumn = editorSelection.endColumn;\n\n\t\tlet word = this.model.getWordAtPosition({\n\t\t\tlineNumber: lineNumber,\n\t\t\tcolumn: startColumn\n\t\t});\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.model, this.editor.getSelection(), this.editor.getConfiguration().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 (let i = 0, len = this.workerRequestValue.length; i < len; i++) {\n\t\t\tlet info = this.workerRequestValue[i];\n\t\t\tdecorations.push({\n\t\t\t\trange: info.range,\n\t\t\t\toptions: WordHighlighter._getDecorationOptions(info.kind)\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\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});\n\n\tprivate static readonly _TEXT_OPTIONS = ModelDecorationOptions.register({\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});\n\n\tprivate static readonly _REGULAR_OPTIONS = ModelDecorationOptions.register({\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});\n\n\tpublic dispose(): void {\n\t\tthis._stopAll();\n\t\tthis.toUnhook = dispose(this.toUnhook);\n\t}\n}\n\nclass WordHighlighterContribution extends Disposable implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.wordHighlighter';\n\n\tpublic static get(editor: ICodeEditor): WordHighlighterContribution {\n\t\treturn editor.getContribution<WordHighlighterContribution>(WordHighlighterContribution.ID);\n\t}\n\n\tprivate wordHighligher: WordHighlighter | null;\n\n\tconstructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService) {\n\t\tsuper();\n\t\tconst createWordHighlighterIfPossible = () => {\n\t\t\tif (editor.hasModel()) {\n\t\t\t\tthis.wordHighligher = new WordHighlighter(editor, contextKeyService);\n\t\t\t}\n\t\t};\n\t\tthis._register(editor.onDidChangeModel((e) => {\n\t\t\tif (this.wordHighligher) {\n\t\t\t\tthis.wordHighligher.dispose();\n\t\t\t\tthis.wordHighligher = null;\n\t\t\t}\n\t\t\tcreateWordHighlighterIfPossible();\n\t\t}));\n\t\tcreateWordHighlighterIfPossible();\n\t}\n\n\tpublic getId(): string {\n\t\treturn WordHighlighterContribution.ID;\n\t}\n\n\tpublic saveViewState(): boolean {\n\t\tif (this.wordHighligher && this.wordHighligher.hasDecorations()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic moveNext() {\n\t\tif (this.wordHighligher) {\n\t\t\tthis.wordHighligher.moveNext();\n\t\t}\n\t}\n\n\tpublic moveBack() {\n\t\tif (this.wordHighligher) {\n\t\t\tthis.wordHighligher.moveBack();\n\t\t}\n\t}\n\n\tpublic restoreViewState(state: boolean | undefined): void {\n\t\tif (this.wordHighligher && state) {\n\t\t\tthis.wordHighligher.restore();\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.wordHighligher) {\n\t\t\tthis.wordHighligher.dispose();\n\t\t\tthis.wordHighligher = 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);\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 'vs/css!./accessibilityHelp';\nimport * as browser from 'vs/base/browser/browser';\nimport * as dom from 'vs/base/browser/dom';\nimport { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode';\nimport { renderFormattedText } from 'vs/base/browser/htmlContentRenderer';\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/toggleTabFocusMode';\nimport { IEditorConstructionOptions } 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 } 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';\n\nconst CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessibilityHelpWidgetVisible', false);\n\nclass AccessibilityHelpController extends Disposable\n\timplements IEditorContribution {\n\tprivate static readonly ID = 'editor.contrib.accessibilityHelpController';\n\n\tpublic static get(editor: ICodeEditor): AccessibilityHelpController {\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 getId(): string {\n\t\treturn AccessibilityHelpController.ID;\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.KEY_E)) {\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.KEY_H)) {\n\t\t\t\talert(AccessibilityHelpNLS.openingDocs);\n\n\t\t\t\tlet url = (<IEditorConstructionOptions>this._editor.getRawConfiguration()).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 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\tlet 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\tlet opts = this._editor.getConfiguration();\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 (opts.wrappingInfo.inDiffEditor) {\n\t\t\tif (opts.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 (opts.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 (opts.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 (opts.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\tlet editorLayout = this._editor.getLayoutInfo();\n\n\t\tlet w = Math.max(5, Math.min(AccessibilityHelpWidget.WIDTH, editorLayout.width - 40));\n\t\tlet 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\tlet top = Math.round((editorLayout.height - h) / 2);\n\t\tthis._domNode.setTop(top);\n\n\t\tlet 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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: (browser.isIE ? KeyMod.CtrlCmd | KeyCode.F1 : KeyMod.Alt | KeyCode.F1),\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 controller = AccessibilityHelpController.get(editor);\n\t\tif (controller) {\n\t\t\tcontroller.show();\n\t\t}\n\t}\n}\n\nregisterEditorContribution(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\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!./inspectTokens';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { Color } from 'vs/base/common/color';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { escape } from 'vs/base/common/strings';\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 { Token } from 'vs/editor/common/core/token';\nimport { IEditorContribution } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { FontStyle, IState, ITokenizationSupport, LanguageIdentifier, StandardTokenType, TokenMetadata, TokenizationRegistry } from 'vs/editor/common/modes';\nimport { NULL_STATE, nullTokenize, nullTokenize2 } from 'vs/editor/common/modes/nullMode';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\nimport { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry';\nimport { HIGH_CONTRAST, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { InspectTokensNLS } from 'vs/editor/common/standaloneStrings';\n\n\nclass InspectTokensController extends Disposable implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.inspectTokens';\n\n\tpublic static get(editor: ICodeEditor): InspectTokensController {\n\t\treturn editor.getContribution<InspectTokensController>(InspectTokensController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _modeService: IModeService;\n\tprivate _widget: InspectTokensWidget | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IStandaloneThemeService standaloneColorService: IStandaloneThemeService,\n\t\t@IModeService modeService: IModeService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._modeService = modeService;\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}\n\n\tpublic getId(): string {\n\t\treturn InspectTokensController.ID;\n\t}\n\n\tpublic 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._modeService);\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: null\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet 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\tlanguageIdentifier: LanguageIdentifier;\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\tlet charCode = tokenText.charCodeAt(charIndex);\n\t\tswitch (charCode) {\n\t\t\tcase CharCode.Tab:\n\t\t\t\tresult += '→';\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.Space:\n\t\t\t\tresult += '·';\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.LessThan:\n\t\t\t\tresult += '<';\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.GreaterThan:\n\t\t\t\tresult += '>';\n\t\t\t\tbreak;\n\n\t\t\tcase CharCode.Ampersand:\n\t\t\t\tresult += '&';\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(languageIdentifier: LanguageIdentifier): ITokenizationSupport {\n\tlet tokenizationSupport = TokenizationRegistry.get(languageIdentifier.language);\n\tif (tokenizationSupport) {\n\t\treturn tokenizationSupport;\n\t}\n\treturn {\n\t\tgetInitialState: () => NULL_STATE,\n\t\ttokenize: (line: string, state: IState, deltaOffset: number) => nullTokenize(languageIdentifier.language, line, state, deltaOffset),\n\t\ttokenize2: (line: string, state: IState, deltaOffset: number) => nullTokenize2(languageIdentifier.id, line, state, deltaOffset)\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 _modeService: IModeService;\n\tprivate readonly _tokenizationSupport: ITokenizationSupport;\n\tprivate readonly _model: ITextModel;\n\tprivate readonly _domNode: HTMLElement;\n\n\tconstructor(\n\t\teditor: IActiveCodeEditor,\n\t\tmodeService: IModeService\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\t\tthis._modeService = modeService;\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._model.getLanguageIdentifier());\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 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\tlet 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\tlet 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\tlet result = '';\n\n\t\tlet lineContent = this._model.getLineContent(position.lineNumber);\n\t\tlet tokenText = '';\n\t\tif (token1Index < data.tokens1.length) {\n\t\t\tlet tokenStartIndex = data.tokens1[token1Index].offset;\n\t\t\tlet 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\tresult += `<h2 class=\"tm-token\">${renderTokenText(tokenText)}<span class=\"tm-token-length\">(${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'})</span></h2>`;\n\n\t\tresult += `<hr class=\"tokens-inspect-separator\" style=\"clear:both\"/>`;\n\n\t\tlet metadata = this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]);\n\t\tresult += `<table class=\"tm-metadata-table\"><tbody>`;\n\t\tresult += `<tr><td class=\"tm-metadata-key\">language</td><td class=\"tm-metadata-value\">${escape(metadata.languageIdentifier.language)}</td>`;\n\t\tresult += `<tr><td class=\"tm-metadata-key\">token type</td><td class=\"tm-metadata-value\">${this._tokenTypeToString(metadata.tokenType)}</td>`;\n\t\tresult += `<tr><td class=\"tm-metadata-key\">font style</td><td class=\"tm-metadata-value\">${this._fontStyleToString(metadata.fontStyle)}</td>`;\n\t\tresult += `<tr><td class=\"tm-metadata-key\">foreground</td><td class=\"tm-metadata-value\">${Color.Format.CSS.formatHex(metadata.foreground)}</td>`;\n\t\tresult += `<tr><td class=\"tm-metadata-key\">background</td><td class=\"tm-metadata-value\">${Color.Format.CSS.formatHex(metadata.background)}</td>`;\n\t\tresult += `</tbody></table>`;\n\n\t\tresult += `<hr class=\"tokens-inspect-separator\"/>`;\n\n\t\tif (token1Index < data.tokens1.length) {\n\t\t\tresult += `<span class=\"tm-token-type\">${escape(data.tokens1[token1Index].type)}</span>`;\n\t\t}\n\n\t\tthis._domNode.innerHTML = result;\n\t\tthis._editor.layoutContentWidget(this);\n\t}\n\n\tprivate _decodeMetadata(metadata: number): IDecodedMetadata {\n\t\tlet colorMap = TokenizationRegistry.getColorMap()!;\n\t\tlet languageId = TokenMetadata.getLanguageId(metadata);\n\t\tlet tokenType = TokenMetadata.getTokenType(metadata);\n\t\tlet fontStyle = TokenMetadata.getFontStyle(metadata);\n\t\tlet foreground = TokenMetadata.getForeground(metadata);\n\t\tlet background = TokenMetadata.getBackground(metadata);\n\t\treturn {\n\t\t\tlanguageIdentifier: this._modeService.getLanguageIdentifier(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}\n\t\treturn '??';\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 (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\tlet stateBeforeLine = this._getStateBeforeLine(lineNumber);\n\n\t\tlet tokenizationResult1 = this._tokenizationSupport.tokenize(this._model.getLineContent(lineNumber), stateBeforeLine, 0);\n\t\tlet tokenizationResult2 = this._tokenizationSupport.tokenize2(this._model.getLineContent(lineNumber), stateBeforeLine, 0);\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\tlet tokenizationResult = this._tokenizationSupport.tokenize(this._model.getLineContent(i), state, 0);\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);\nregisterEditorAction(InspectTokens);\n\nregisterThemingParticipant((theme, collector) => {\n\tconst border = theme.getColor(editorHoverBorder);\n\tif (border) {\n\t\tlet borderWidth = theme.type === 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});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./editorQuickOpen';\nimport { QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';\nimport { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { IModelDeltaDecoration } from 'vs/editor/common/model';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { QuickOpenEditorWidget } from 'vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\n\nexport interface IQuickOpenControllerOpts {\n\tinputAriaLabel: string;\n\tgetModel(value: string): QuickOpenModel;\n\tgetAutoFocus(searchValue: string): IAutoFocus;\n}\n\nexport class QuickOpenController implements editorCommon.IEditorContribution, IDecorator {\n\n\tprivate static readonly ID = 'editor.controller.quickOpenController';\n\n\tpublic static get(editor: ICodeEditor): QuickOpenController {\n\t\treturn editor.getContribution<QuickOpenController>(QuickOpenController.ID);\n\t}\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate widget: QuickOpenEditorWidget | null;\n\tprivate rangeHighlightDecorationId: string | null;\n\tprivate lastKnownEditorSelection: Selection | null;\n\n\tconstructor(editor: ICodeEditor, @IThemeService private readonly themeService: IThemeService) {\n\t\tthis.editor = editor;\n\t}\n\n\tpublic getId(): string {\n\t\treturn QuickOpenController.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\t// Dispose widget\n\t\tif (this.widget) {\n\t\t\tthis.widget.destroy();\n\t\t\tthis.widget = null;\n\t\t}\n\t}\n\n\tpublic run(opts: IQuickOpenControllerOpts): void {\n\t\tif (this.widget) {\n\t\t\tthis.widget.destroy();\n\t\t\tthis.widget = null;\n\t\t}\n\n\t\t// Create goto line widget\n\t\tlet onClose = (canceled: boolean) => {\n\t\t\t// Clear Highlight Decorations if present\n\t\t\tthis.clearDecorations();\n\n\t\t\t// Restore selection if canceled\n\t\t\tif (canceled && this.lastKnownEditorSelection) {\n\t\t\t\tthis.editor.setSelection(this.lastKnownEditorSelection);\n\t\t\t\tthis.editor.revealRangeInCenterIfOutsideViewport(this.lastKnownEditorSelection, editorCommon.ScrollType.Smooth);\n\t\t\t}\n\n\t\t\tthis.lastKnownEditorSelection = null;\n\n\t\t\t// Return focus to the editor if\n\t\t\t// - focus is back on the <body> element because no other focusable element was clicked\n\t\t\t// - a command was picked from the picker which indicates the editor should get focused\n\t\t\tif (document.activeElement === document.body || !canceled) {\n\t\t\t\tthis.editor.focus();\n\t\t\t}\n\t\t};\n\n\t\tthis.widget = new QuickOpenEditorWidget(\n\t\t\tthis.editor,\n\t\t\t() => onClose(false),\n\t\t\t() => onClose(true),\n\t\t\t(value: string) => {\n\t\t\t\tthis.widget!.setInput(opts.getModel(value), opts.getAutoFocus(value));\n\t\t\t},\n\t\t\t{\n\t\t\t\tinputAriaLabel: opts.inputAriaLabel\n\t\t\t},\n\t\t\tthis.themeService\n\t\t);\n\n\t\t// Remember selection to be able to restore on cancel\n\t\tif (!this.lastKnownEditorSelection) {\n\t\t\tthis.lastKnownEditorSelection = this.editor.getSelection();\n\t\t}\n\n\t\t// Show\n\t\tthis.widget.show('');\n\t}\n\n\tprivate static readonly _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({\n\t\tclassName: 'rangeHighlight',\n\t\tisWholeLine: true\n\t});\n\n\tpublic decorateLine(range: Range, editor: ICodeEditor): void {\n\t\tconst oldDecorations: string[] = [];\n\t\tif (this.rangeHighlightDecorationId) {\n\t\t\toldDecorations.push(this.rangeHighlightDecorationId);\n\t\t\tthis.rangeHighlightDecorationId = null;\n\t\t}\n\n\t\tconst newDecorations: IModelDeltaDecoration[] = [\n\t\t\t{\n\t\t\t\trange: range,\n\t\t\t\toptions: QuickOpenController._RANGE_HIGHLIGHT_DECORATION\n\t\t\t}\n\t\t];\n\n\t\tconst decorations = editor.deltaDecorations(oldDecorations, newDecorations);\n\t\tthis.rangeHighlightDecorationId = decorations[0];\n\t}\n\n\tpublic clearDecorations(): void {\n\t\tif (this.rangeHighlightDecorationId) {\n\t\t\tthis.editor.deltaDecorations([this.rangeHighlightDecorationId], []);\n\t\t\tthis.rangeHighlightDecorationId = null;\n\t\t}\n\t}\n}\n\nexport interface IQuickOpenOpts {\n\t/**\n\t * provide the quick open model for the given search value.\n\t */\n\tgetModel(value: string): QuickOpenModel;\n\n\t/**\n\t * provide the quick open auto focus mode for the given search value.\n\t */\n\tgetAutoFocus(searchValue: string): IAutoFocus;\n}\n\n/**\n * Base class for providing quick open in the editor.\n */\nexport abstract class BaseEditorQuickOpenAction extends EditorAction {\n\n\tprivate readonly _inputAriaLabel: string;\n\n\tconstructor(inputAriaLabel: string, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis._inputAriaLabel = inputAriaLabel;\n\t}\n\n\tprotected getController(editor: ICodeEditor): QuickOpenController {\n\t\treturn QuickOpenController.get(editor);\n\t}\n\n\tprotected _show(controller: QuickOpenController, opts: IQuickOpenOpts): void {\n\t\tcontroller.run({\n\t\t\tinputAriaLabel: this._inputAriaLabel,\n\t\t\tgetModel: (value: string): QuickOpenModel => opts.getModel(value),\n\t\t\tgetAutoFocus: (searchValue: string): IAutoFocus => opts.getAutoFocus(searchValue)\n\t\t});\n\t}\n}\n\nexport interface IDecorator {\n\tdecorateLine(range: Range, editor: editorCommon.IEditor): void;\n\tclearDecorations(): void;\n}\n\nregisterEditorContribution(QuickOpenController);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./gotoLine';\nimport * as strings from 'vs/base/common/strings';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';\nimport { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { ICodeEditor, IDiffEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { BaseEditorQuickOpenAction, IDecorator } from 'vs/editor/standalone/browser/quickOpen/editorQuickOpen';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { GoToLineNLS } from 'vs/editor/common/standaloneStrings';\n\ninterface ParseResult {\n\tposition: Position;\n\tisValid: boolean;\n\tlabel: string;\n}\n\nexport class GotoLineEntry extends QuickOpenEntry {\n\tprivate readonly parseResult: ParseResult;\n\tprivate readonly decorator: IDecorator;\n\tprivate readonly editor: editorCommon.IEditor;\n\n\tconstructor(line: string, editor: editorCommon.IEditor, decorator: IDecorator) {\n\t\tsuper();\n\n\t\tthis.editor = editor;\n\t\tthis.decorator = decorator;\n\t\tthis.parseResult = this.parseInput(line);\n\t}\n\n\tprivate parseInput(line: string): ParseResult {\n\t\tconst numbers = line.split(',').map(part => parseInt(part, 10)).filter(part => !isNaN(part));\n\t\tlet position: Position;\n\n\t\tif (numbers.length === 0) {\n\t\t\tposition = new Position(-1, -1);\n\t\t} else if (numbers.length === 1) {\n\t\t\tposition = new Position(numbers[0], 1);\n\t\t} else {\n\t\t\tposition = new Position(numbers[0], numbers[1]);\n\t\t}\n\n\t\tlet model: ITextModel | null;\n\t\tif (isCodeEditor(this.editor)) {\n\t\t\tmodel = this.editor.getModel();\n\t\t} else {\n\t\t\tconst diffModel = (<IDiffEditor>this.editor).getModel();\n\t\t\tmodel = diffModel ? diffModel.modified : null;\n\t\t}\n\n\t\tconst isValid = model ? model.validatePosition(position).equals(position) : false;\n\t\tlet label: string;\n\n\t\tif (isValid) {\n\t\t\tif (position.column && position.column > 1) {\n\t\t\t\tlabel = strings.format(GoToLineNLS.gotoLineLabelValidLineAndColumn, position.lineNumber, position.column);\n\t\t\t} else {\n\t\t\t\tlabel = strings.format(GoToLineNLS.gotoLineLabelValidLine, position.lineNumber);\n\t\t\t}\n\t\t} else if (position.lineNumber < 1 || position.lineNumber > (model ? model.getLineCount() : 0)) {\n\t\t\tlabel = strings.format(GoToLineNLS.gotoLineLabelEmptyWithLineLimit, model ? model.getLineCount() : 0);\n\t\t} else {\n\t\t\tlabel = strings.format(GoToLineNLS.gotoLineLabelEmptyWithLineAndColumnLimit, model ? model.getLineMaxColumn(position.lineNumber) : 0);\n\t\t}\n\n\t\treturn {\n\t\t\tposition: position,\n\t\t\tisValid: isValid,\n\t\t\tlabel: label\n\t\t};\n\t}\n\n\tgetLabel(): string {\n\t\treturn this.parseResult.label;\n\t}\n\n\tgetAriaLabel(): string {\n\t\tconst position = this.editor.getPosition();\n\t\tconst currentLine = position ? position.lineNumber : 0;\n\t\treturn strings.format(GoToLineNLS.gotoLineAriaLabel, currentLine, this.parseResult.label);\n\t}\n\n\trun(mode: Mode, _context: IEntryRunContext): boolean {\n\t\tif (mode === Mode.OPEN) {\n\t\t\treturn this.runOpen();\n\t\t}\n\n\t\treturn this.runPreview();\n\t}\n\n\trunOpen(): boolean {\n\n\t\t// No-op if range is not valid\n\t\tif (!this.parseResult.isValid) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Apply selection and focus\n\t\tconst range = this.toSelection();\n\t\t(<ICodeEditor>this.editor).setSelection(range);\n\t\t(<ICodeEditor>this.editor).revealRangeInCenter(range, editorCommon.ScrollType.Smooth);\n\t\tthis.editor.focus();\n\n\t\treturn true;\n\t}\n\n\trunPreview(): boolean {\n\n\t\t// No-op if range is not valid\n\t\tif (!this.parseResult.isValid) {\n\t\t\tthis.decorator.clearDecorations();\n\t\t\treturn false;\n\t\t}\n\n\t\t// Select Line Position\n\t\tconst range = this.toSelection();\n\t\tthis.editor.revealRangeInCenter(range, editorCommon.ScrollType.Smooth);\n\n\t\t// Decorate if possible\n\t\tthis.decorator.decorateLine(range, this.editor);\n\n\t\treturn false;\n\t}\n\n\tprivate toSelection(): Range {\n\t\treturn new Range(\n\t\t\tthis.parseResult.position.lineNumber,\n\t\t\tthis.parseResult.position.column,\n\t\t\tthis.parseResult.position.lineNumber,\n\t\t\tthis.parseResult.position.column\n\t\t);\n\t}\n}\n\nexport class GotoLineAction extends BaseEditorQuickOpenAction {\n\n\tconstructor() {\n\t\tsuper(GoToLineNLS.gotoLineActionInput, {\n\t\t\tid: 'editor.action.gotoLine',\n\t\t\tlabel: GoToLineNLS.gotoLineActionLabel,\n\t\t\talias: 'Go to Line...',\n\t\t\tprecondition: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: KeyMod.CtrlCmd | KeyCode.KEY_G,\n\t\t\t\tmac: { primary: KeyMod.WinCtrl | KeyCode.KEY_G },\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t}\n\t\t});\n\t}\n\n\trun(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tthis._show(this.getController(editor), {\n\t\t\tgetModel: (value: string): QuickOpenModel => {\n\t\t\t\treturn new QuickOpenModel([new GotoLineEntry(value, editor, this.getController(editor))]);\n\t\t\t},\n\n\t\t\tgetAutoFocus: (searchValue: string): IAutoFocus => {\n\t\t\t\treturn {\n\t\t\t\t\tautoFocusFirstEntry: searchValue.length > 0\n\t\t\t\t};\n\t\t\t}\n\t\t});\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 * as strings from 'vs/base/common/strings';\nimport * as browser from 'vs/base/browser/browser';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { matchesFuzzy } from 'vs/base/common/filters';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';\nimport { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { IEditor, IEditorAction } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { BaseEditorQuickOpenAction } from 'vs/editor/standalone/browser/quickOpen/editorQuickOpen';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { QuickCommandNLS } from 'vs/editor/common/standaloneStrings';\n\nexport class EditorActionCommandEntry extends QuickOpenEntryGroup {\n\tprivate readonly key: string;\n\tprivate readonly action: IEditorAction;\n\tprivate readonly editor: IEditor;\n\tprivate readonly keyAriaLabel: string;\n\n\tconstructor(key: string, keyAriaLabel: string, highlights: IHighlight[], action: IEditorAction, editor: IEditor) {\n\t\tsuper();\n\n\t\tthis.key = key;\n\t\tthis.keyAriaLabel = keyAriaLabel;\n\t\tthis.setHighlights(highlights);\n\t\tthis.action = action;\n\t\tthis.editor = editor;\n\t}\n\n\tpublic getLabel(): string {\n\t\treturn this.action.label;\n\t}\n\n\tpublic getAriaLabel(): string {\n\t\tif (this.keyAriaLabel) {\n\t\t\treturn strings.format(QuickCommandNLS.ariaLabelEntryWithKey, this.getLabel(), this.keyAriaLabel);\n\t\t}\n\n\t\treturn strings.format(QuickCommandNLS.ariaLabelEntry, this.getLabel());\n\t}\n\n\tpublic getGroupLabel(): string {\n\t\treturn this.key;\n\t}\n\n\tpublic run(mode: Mode, context: IEntryRunContext): boolean {\n\t\tif (mode === Mode.OPEN) {\n\n\t\t\t// Use a timeout to give the quick open widget a chance to close itself first\n\t\t\tsetTimeout(() => {\n\n\t\t\t\t// Some actions are enabled only when editor has focus\n\t\t\t\tthis.editor.focus();\n\n\t\t\t\ttry {\n\t\t\t\t\tlet promise = this.action.run() || Promise.resolve();\n\t\t\t\t\tpromise.then(undefined, onUnexpectedError);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonUnexpectedError(error);\n\t\t\t\t}\n\t\t\t}, 50);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nexport class QuickCommandAction extends BaseEditorQuickOpenAction {\n\n\tconstructor() {\n\t\tsuper(QuickCommandNLS.quickCommandActionInput, {\n\t\t\tid: 'editor.action.quickCommand',\n\t\t\tlabel: QuickCommandNLS.quickCommandActionLabel,\n\t\t\talias: 'Command Palette',\n\t\t\tprecondition: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.focus,\n\t\t\t\tprimary: (browser.isIE ? KeyMod.Alt | KeyCode.F1 : KeyCode.F1),\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tgroup: 'z_commands',\n\t\t\t\torder: 1\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tconst keybindingService = accessor.get(IKeybindingService);\n\n\t\tthis._show(this.getController(editor), {\n\t\t\tgetModel: (value: string): QuickOpenModel => {\n\t\t\t\treturn new QuickOpenModel(this._editorActionsToEntries(keybindingService, editor, value));\n\t\t\t},\n\n\t\t\tgetAutoFocus: (searchValue: string): IAutoFocus => {\n\t\t\t\treturn {\n\t\t\t\t\tautoFocusFirstEntry: true,\n\t\t\t\t\tautoFocusPrefixMatch: searchValue\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _sort(elementA: QuickOpenEntryGroup, elementB: QuickOpenEntryGroup): number {\n\t\tlet elementAName = (elementA.getLabel() || '').toLowerCase();\n\t\tlet elementBName = (elementB.getLabel() || '').toLowerCase();\n\n\t\treturn elementAName.localeCompare(elementBName);\n\t}\n\n\tprivate _editorActionsToEntries(keybindingService: IKeybindingService, editor: ICodeEditor, searchValue: string): EditorActionCommandEntry[] {\n\t\tlet actions: IEditorAction[] = editor.getSupportedActions();\n\t\tlet entries: EditorActionCommandEntry[] = [];\n\n\t\tfor (const action of actions) {\n\n\t\t\tlet keybinding = keybindingService.lookupKeybinding(action.id);\n\n\t\t\tif (action.label) {\n\t\t\t\tlet highlights = matchesFuzzy(searchValue, action.label);\n\t\t\t\tif (highlights) {\n\t\t\t\t\tentries.push(new EditorActionCommandEntry(keybinding ? keybinding.getLabel() || '' : '', keybinding ? keybinding.getAriaLabel() || '' : '', highlights, action, editor));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sort by name\n\t\tentries = entries.sort(this._sort);\n\n\t\treturn entries;\n\t}\n}\n\nregisterEditorAction(QuickCommandAction);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./quickOutline';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { matchesFuzzy } from 'vs/base/common/filters';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport * as strings from 'vs/base/common/strings';\nimport { IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';\nimport { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { DocumentSymbol, DocumentSymbolProviderRegistry, symbolKindToCssClass } from 'vs/editor/common/modes';\nimport { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/quickOpen';\nimport { BaseEditorQuickOpenAction, IDecorator } from 'vs/editor/standalone/browser/quickOpen/editorQuickOpen';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { QuickOutlineNLS } from 'vs/editor/common/standaloneStrings';\n\nlet SCOPE_PREFIX = ':';\n\nexport class SymbolEntry extends QuickOpenEntryGroup {\n\tprivate readonly name: string;\n\tprivate readonly type: string;\n\tprivate readonly description: string | null;\n\tprivate readonly range: Range;\n\tprivate readonly editor: ICodeEditor;\n\tprivate readonly decorator: IDecorator;\n\n\tconstructor(name: string, type: string, description: string | null, range: Range, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator) {\n\t\tsuper();\n\n\t\tthis.name = name;\n\t\tthis.type = type;\n\t\tthis.description = description;\n\t\tthis.range = range;\n\t\tthis.setHighlights(highlights);\n\t\tthis.editor = editor;\n\t\tthis.decorator = decorator;\n\t}\n\n\tpublic getLabel(): string {\n\t\treturn this.name;\n\t}\n\n\tpublic getAriaLabel(): string {\n\t\treturn strings.format(QuickOutlineNLS.entryAriaLabel, this.name);\n\t}\n\n\tpublic getIcon(): string {\n\t\treturn this.type;\n\t}\n\n\tpublic getDescription(): string | null {\n\t\treturn this.description;\n\t}\n\n\tpublic getType(): string {\n\t\treturn this.type;\n\t}\n\n\tpublic getRange(): Range {\n\t\treturn this.range;\n\t}\n\n\tpublic run(mode: Mode, context: IEntryRunContext): boolean {\n\t\tif (mode === Mode.OPEN) {\n\t\t\treturn this.runOpen(context);\n\t\t}\n\n\t\treturn this.runPreview();\n\t}\n\n\tprivate runOpen(_context: IEntryRunContext): boolean {\n\n\t\t// Apply selection and focus\n\t\tlet range = this.toSelection();\n\t\tthis.editor.setSelection(range);\n\t\tthis.editor.revealRangeInCenter(range, ScrollType.Smooth);\n\t\tthis.editor.focus();\n\n\t\treturn true;\n\t}\n\n\tprivate runPreview(): boolean {\n\n\t\t// Select Outline Position\n\t\tlet range = this.toSelection();\n\t\tthis.editor.revealRangeInCenter(range, ScrollType.Smooth);\n\n\t\t// Decorate if possible\n\t\tthis.decorator.decorateLine(this.range, this.editor);\n\n\t\treturn false;\n\t}\n\n\tprivate toSelection(): Range {\n\t\treturn new Range(\n\t\t\tthis.range.startLineNumber,\n\t\t\tthis.range.startColumn || 1,\n\t\t\tthis.range.startLineNumber,\n\t\t\tthis.range.startColumn || 1\n\t\t);\n\t}\n}\n\nexport class QuickOutlineAction extends BaseEditorQuickOpenAction {\n\n\tconstructor() {\n\t\tsuper(QuickOutlineNLS.quickOutlineActionInput, {\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.KEY_O,\n\t\t\t\tweight: KeybindingWeight.EditorContrib\n\t\t\t},\n\t\t\tmenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 3\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor) {\n\t\tif (!editor.hasModel()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst model = editor.getModel();\n\n\t\tif (!DocumentSymbolProviderRegistry.has(model)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Resolve outline\n\t\treturn getDocumentSymbols(model, true, CancellationToken.None).then((result: DocumentSymbol[]) => {\n\t\t\tif (result.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._run(editor, result);\n\t\t});\n\t}\n\n\tprivate _run(editor: ICodeEditor, result: DocumentSymbol[]): void {\n\t\tthis._show(this.getController(editor), {\n\t\t\tgetModel: (value: string): QuickOpenModel => {\n\t\t\t\treturn new QuickOpenModel(this.toQuickOpenEntries(editor, result, value));\n\t\t\t},\n\n\t\t\tgetAutoFocus: (searchValue: string): IAutoFocus => {\n\t\t\t\t// Remove any type pattern (:) from search value as needed\n\t\t\t\tif (searchValue.indexOf(SCOPE_PREFIX) === 0) {\n\t\t\t\t\tsearchValue = searchValue.substr(SCOPE_PREFIX.length);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tautoFocusPrefixMatch: searchValue,\n\t\t\t\t\tautoFocusFirstEntry: !!searchValue\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate symbolEntry(name: string, type: string, description: string | null, range: IRange, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator): SymbolEntry {\n\t\treturn new SymbolEntry(name, type, description, Range.lift(range), highlights, editor, decorator);\n\t}\n\n\tprivate toQuickOpenEntries(editor: ICodeEditor, flattened: DocumentSymbol[], searchValue: string): SymbolEntry[] {\n\t\tconst controller = this.getController(editor);\n\n\t\tlet results: SymbolEntry[] = [];\n\n\t\t// Convert to Entries\n\t\tlet normalizedSearchValue = searchValue;\n\t\tif (searchValue.indexOf(SCOPE_PREFIX) === 0) {\n\t\t\tnormalizedSearchValue = normalizedSearchValue.substr(SCOPE_PREFIX.length);\n\t\t}\n\n\t\tfor (const element of flattened) {\n\t\t\tlet label = strings.trim(element.name);\n\n\t\t\t// Check for meatch\n\t\t\tlet highlights = matchesFuzzy(normalizedSearchValue, label);\n\t\t\tif (highlights) {\n\n\t\t\t\t// Show parent scope as description\n\t\t\t\tlet description: string | null = null;\n\t\t\t\tif (element.containerName) {\n\t\t\t\t\tdescription = element.containerName;\n\t\t\t\t}\n\n\t\t\t\t// Add\n\t\t\t\tresults.push(this.symbolEntry(label, symbolKindToCssClass(element.kind), description, element.range, highlights, editor, controller));\n\t\t\t}\n\t\t}\n\n\t\t// Sort properly if actually searching\n\t\tif (searchValue) {\n\t\t\tif (searchValue.indexOf(SCOPE_PREFIX) === 0) {\n\t\t\t\tresults = results.sort(this.sortScoped.bind(this, searchValue.toLowerCase()));\n\t\t\t} else {\n\t\t\t\tresults = results.sort(this.sortNormal.bind(this, searchValue.toLowerCase()));\n\t\t\t}\n\t\t}\n\n\t\t// Mark all type groups\n\t\tif (results.length > 0 && searchValue.indexOf(SCOPE_PREFIX) === 0) {\n\t\t\tlet currentType: string | null = null;\n\t\t\tlet currentResult: SymbolEntry | null = null;\n\t\t\tlet typeCounter = 0;\n\n\t\t\tfor (let i = 0; i < results.length; i++) {\n\t\t\t\tlet result = results[i];\n\n\t\t\t\t// Found new type\n\t\t\t\tif (currentType !== result.getType()) {\n\n\t\t\t\t\t// Update previous result with count\n\t\t\t\t\tif (currentResult) {\n\t\t\t\t\t\tcurrentResult.setGroupLabel(this.typeToLabel(currentType || '', typeCounter));\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentType = result.getType();\n\t\t\t\t\tcurrentResult = result;\n\t\t\t\t\ttypeCounter = 1;\n\n\t\t\t\t\tresult.setShowBorder(i > 0);\n\t\t\t\t}\n\n\t\t\t\t// Existing type, keep counting\n\t\t\t\telse {\n\t\t\t\t\ttypeCounter++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update previous result with count\n\t\t\tif (currentResult) {\n\t\t\t\tcurrentResult.setGroupLabel(this.typeToLabel(currentType || '', typeCounter));\n\t\t\t}\n\t\t}\n\n\t\t// Mark first entry as outline\n\t\telse if (results.length > 0) {\n\t\t\tresults[0].setGroupLabel(strings.format(QuickOutlineNLS._symbols_, results.length));\n\t\t}\n\n\t\treturn results;\n\t}\n\n\tprivate typeToLabel(type: string, count: number): string {\n\t\tswitch (type) {\n\t\t\tcase 'module': return strings.format(QuickOutlineNLS._modules_, count);\n\t\t\tcase 'class': return strings.format(QuickOutlineNLS._class_, count);\n\t\t\tcase 'interface': return strings.format(QuickOutlineNLS._interface_, count);\n\t\t\tcase 'method': return strings.format(QuickOutlineNLS._method_, count);\n\t\t\tcase 'function': return strings.format(QuickOutlineNLS._function_, count);\n\t\t\tcase 'property': return strings.format(QuickOutlineNLS._property_, count);\n\t\t\tcase 'variable': return strings.format(QuickOutlineNLS._variable_, count);\n\t\t\tcase 'var': return strings.format(QuickOutlineNLS._variable2_, count);\n\t\t\tcase 'constructor': return strings.format(QuickOutlineNLS._constructor_, count);\n\t\t\tcase 'call': return strings.format(QuickOutlineNLS._call_, count);\n\t\t}\n\n\t\treturn type;\n\t}\n\n\tprivate sortNormal(searchValue: string, elementA: SymbolEntry, elementB: SymbolEntry): number {\n\t\tlet elementAName = elementA.getLabel().toLowerCase();\n\t\tlet elementBName = elementB.getLabel().toLowerCase();\n\n\t\t// Compare by name\n\t\tlet r = elementAName.localeCompare(elementBName);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\n\t\t// If name identical sort by range instead\n\t\tlet elementARange = elementA.getRange();\n\t\tlet elementBRange = elementB.getRange();\n\t\treturn elementARange.startLineNumber - elementBRange.startLineNumber;\n\t}\n\n\tprivate sortScoped(searchValue: string, elementA: SymbolEntry, elementB: SymbolEntry): number {\n\n\t\t// Remove scope char\n\t\tsearchValue = searchValue.substr(SCOPE_PREFIX.length);\n\n\t\t// Sort by type first if scoped search\n\t\tlet elementAType = elementA.getType();\n\t\tlet elementBType = elementB.getType();\n\t\tlet r = elementAType.localeCompare(elementBType);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\n\t\t// Special sort when searching in scoped mode\n\t\tif (searchValue) {\n\t\t\tlet elementAName = elementA.getLabel().toLowerCase();\n\t\t\tlet elementBName = elementB.getLabel().toLowerCase();\n\n\t\t\t// Compare by name\n\t\t\tlet r = elementAName.localeCompare(elementBName);\n\t\t\tif (r !== 0) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\t// Default to sort by range\n\t\tlet elementARange = elementA.getRange();\n\t\tlet elementBRange = elementB.getRange();\n\t\treturn elementARange.startLineNumber - elementBRange.startLineNumber;\n\t}\n}\n\nregisterEditorAction(QuickOutlineAction);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IResourceInput } from 'vs/platform/editor/common/editor';\n\nexport class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {\n\n\tpublic getActiveCodeEditor(): ICodeEditor | null {\n\t\treturn null; // not supported in the standalone case\n\t}\n\n\tpublic openCodeEditor(input: IResourceInput, 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: IResourceInput): 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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/view/editorColorRegistry';\nimport { IStandaloneThemeData } from 'vs/editor/standalone/common/standaloneThemeService';\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: '09885A' },\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: '09885A' },\n\t\t{ token: 'attribute.value.unit', foreground: '09885A' },\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: 'FF00FF' },\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 * as dom from 'vs/base/browser/dom';\nimport { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { TokenizationRegistry } from 'vs/editor/common/modes';\nimport { ITokenThemeRule, TokenTheme, generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization';\nimport { BuiltinTheme, IStandaloneTheme, IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\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 { ColorIdentifier, Extensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry';\nimport { Extensions as ThemingExtensions, ICssStyleCollector, IIconTheme, IThemingRegistry } from 'vs/platform/theme/common/themeService';\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\tpublic readonly id: string;\n\tpublic readonly themeName: string;\n\n\tprivate readonly themeData: IStandaloneThemeData;\n\tprivate colors: { [colorId: 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\tlet base = standaloneThemeData.base;\n\t\tif (name.length > 0) {\n\t\t\tthis.id = base + ' ' + name;\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(): { [colorId: string]: Color } {\n\t\tif (!this.colors) {\n\t\t\tlet colors: { [colorId: string]: Color } = Object.create(null);\n\t\t\tfor (let id in this.themeData.colors) {\n\t\t\t\tcolors[id] = Color.fromHex(this.themeData.colors[id]);\n\t\t\t}\n\t\t\tif (this.themeData.inherit) {\n\t\t\t\tlet baseData = getBuiltinRules(this.themeData.base);\n\t\t\t\tfor (let id in baseData.colors) {\n\t\t\t\t\tif (!colors[id]) {\n\t\t\t\t\t\tcolors[id] = Color.fromHex(baseData.colors[id]);\n\t\t\t\t\t}\n\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()[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() {\n\t\tswitch (this.base) {\n\t\t\tcase VS_THEME_NAME: return 'light';\n\t\t\tcase HC_BLACK_THEME_NAME: return 'hc';\n\t\t\tdefault: return '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\tlet 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\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\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\tlet themeData = getBuiltinRules(builtinTheme);\n\treturn new StandaloneTheme(builtinTheme, themeData);\n}\n\nexport class StandaloneThemeServiceImpl implements IStandaloneThemeService {\n\n\t_serviceBrand: any;\n\n\tprivate readonly _knownThemes: Map<string, StandaloneTheme>;\n\tprivate readonly _styleElement: HTMLStyleElement;\n\tprivate _theme: IStandaloneTheme;\n\tprivate readonly _onThemeChange: Emitter<IStandaloneTheme>;\n\tprivate readonly _onIconThemeChange: Emitter<IIconTheme>;\n\tprivate readonly environment: IEnvironmentService = Object.create(null);\n\n\tconstructor() {\n\t\tthis._onThemeChange = new Emitter<IStandaloneTheme>();\n\t\tthis._onIconThemeChange = new Emitter<IIconTheme>();\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\t\tthis._styleElement = dom.createStyleSheet();\n\t\tthis._styleElement.className = 'monaco-colors';\n\t\tthis.setTheme(VS_THEME_NAME);\n\t}\n\n\tpublic get onThemeChange(): Event<IStandaloneTheme> {\n\t\treturn this._onThemeChange.event;\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 && this._theme.themeName === themeName) {\n\t\t\tthis.setTheme(themeName); // refresh theme\n\t\t}\n\t}\n\n\tpublic getTheme(): IStandaloneTheme {\n\t\treturn this._theme;\n\t}\n\n\tpublic setTheme(themeName: string): string {\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\tif (this._theme === theme) {\n\t\t\t// Nothing to do\n\t\t\treturn theme.id;\n\t\t}\n\t\tthis._theme = theme;\n\n\t\tlet cssRules: string[] = [];\n\t\tlet hasRule: { [rule: string]: boolean; } = {};\n\t\tlet 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(theme, ruleCollector, this.environment));\n\n\t\tlet tokenTheme = theme.tokenTheme;\n\t\tlet colorMap = tokenTheme.getColorMap();\n\t\truleCollector.addRule(generateTokensCSSForColorMap(colorMap));\n\n\t\tthis._styleElement.innerHTML = cssRules.join('\\n');\n\n\t\tTokenizationRegistry.setColorMap(colorMap);\n\t\tthis._onThemeChange.fire(theme);\n\n\t\treturn theme.id;\n\t}\n\n\tpublic getIconTheme(): IIconTheme {\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","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ContextMenuHandler, IContextMenuHandlerOptions } from './contextMenuHandler';\nimport { IContextViewService, IContextMenuService } from './contextView';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { Emitter } from 'vs/base/common/event';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IContextMenuDelegate } from 'vs/base/browser/contextmenu';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { Disposable } from 'vs/base/common/lifecycle';\n\nexport class ContextMenuService extends Disposable implements IContextMenuService {\n\t_serviceBrand: any;\n\n\tprivate _onDidContextMenu = this._register(new Emitter<void>());\n\n\tprivate contextMenuHandler: ContextMenuHandler;\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(delegate);\n\t\tthis._onDidContextMenu.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, IListTouchEvent, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { PagedList } from 'vs/base/browser/ui/list/listPaging';\nimport { DefaultStyleController, IListOptions, IMultipleSelectionController, IOpenController, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, List } from 'vs/base/browser/ui/list/listWidget';\nimport { combinedDisposable, Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ITree } from 'vs/base/parts/tree/browser/tree';\nimport { localize } from 'vs/nls';\nimport { IConfigurationService, getMigratedSettingValue } from 'vs/platform/configuration/common/configuration';\nimport { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\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 } from 'vs/platform/theme/common/styler';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { ObjectTree, IObjectTreeOptions } from 'vs/base/browser/ui/tree/objectTree';\nimport { ITreeRenderer, IAsyncDataSource, IDataSource } from 'vs/base/browser/ui/tree/tree';\nimport { AsyncDataTree, IAsyncDataTreeOptions } from 'vs/base/browser/ui/tree/asyncDataTree';\nimport { DataTree, IDataTreeOptions } from 'vs/base/browser/ui/tree/dataTree';\nimport { IKeyboardNavigationEventFilter, IAbstractTreeOptions } from 'vs/base/browser/ui/tree/abstractTree';\nimport { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\n\nexport type ListWidget = List<any> | PagedList<any> | ITree | ObjectTree<any, any> | DataTree<any, any, any> | AsyncDataTree<any, any, any>;\n\nexport const IListService = createDecorator<IListService>('listService');\n\nexport interface IListService {\n\n\t_serviceBrand: any;\n\n\t/**\n\t * Returns the currently focused list widget if any.\n\t */\n\treadonly lastFocusedList: ListWidget | undefined;\n}\n\ninterface IRegisteredList {\n\twidget: ListWidget;\n\textraContextKeys?: (IContextKey<boolean>)[];\n}\n\nexport class ListService implements IListService {\n\n\t_serviceBrand: any;\n\n\tprivate lists: IRegisteredList[] = [];\n\tprivate _lastFocusedWidget: ListWidget | undefined = undefined;\n\n\tget lastFocusedList(): ListWidget | undefined {\n\t\treturn this._lastFocusedWidget;\n\t}\n\n\tconstructor(@IContextKeyService contextKeyService: IContextKeyService) { }\n\n\tregister(widget: ListWidget, extraContextKeys?: (IContextKey<boolean>)[]): IDisposable {\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._lastFocusedWidget = widget;\n\t\t}\n\n\t\tconst result = combinedDisposable([\n\t\t\twidget.onDidFocus(() => this._lastFocusedWidget = 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._lastFocusedWidget = undefined;\n\t\t\t\t}\n\t\t\t})\n\t\t]);\n\n\t\treturn result;\n\t}\n}\n\nconst RawWorkbenchListFocusContextKey = new RawContextKey<boolean>('listFocus', true);\nexport const WorkbenchListSupportsMultiSelectContextKey = new RawContextKey<boolean>('listSupportsMultiselect', true);\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 WorkbenchListSupportsKeyboardNavigation = new RawContextKey<boolean>('listSupportsKeyboardNavigation', true);\nexport const WorkbenchListAutomaticKeyboardNavigationKey = 'listAutomaticKeyboardNavigation';\nexport const WorkbenchListAutomaticKeyboardNavigation = new RawContextKey<boolean>(WorkbenchListAutomaticKeyboardNavigationKey, true);\nexport let didBindWorkbenchListAutomaticKeyboardNavigation = false;\n\nfunction createScopedContextKeyService(contextKeyService: IContextKeyService, widget: ListWidget): IContextKeyService {\n\tconst result = contextKeyService.createScoped(widget.getHTMLElement());\n\tRawWorkbenchListFocusContextKey.bindTo(result);\n\treturn result;\n}\n\nexport const multiSelectModifierSettingKey = 'workbench.list.multiSelectModifier';\nexport const openModeSettingKey = 'workbench.list.openMode';\nexport const horizontalScrollingKey = 'workbench.list.horizontalScrolling';\nexport const keyboardNavigationSettingKey = 'workbench.list.keyboardNavigation';\nexport const automaticKeyboardNavigationSettingKey = 'workbench.list.automaticKeyboardNavigation';\nconst treeIndentKey = 'workbench.tree.indent';\n\nfunction getHorizontalScrollingSetting(configurationService: IConfigurationService): boolean {\n\treturn getMigratedSettingValue<boolean>(configurationService, horizontalScrollingKey, 'workbench.tree.horizontalScrolling');\n}\n\nfunction useAltAsMultipleSelectionModifier(configurationService: IConfigurationService): boolean {\n\treturn configurationService.getValue(multiSelectModifierSettingKey) === 'alt';\n}\n\nfunction useSingleClickToOpen(configurationService: IConfigurationService): boolean {\n\treturn configurationService.getValue(openModeSettingKey) !== 'doubleClick';\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\nclass WorkbenchOpenController extends Disposable implements IOpenController {\n\tprivate openOnSingleClick: boolean;\n\n\tconstructor(private configurationService: IConfigurationService, private existingOpenController?: IOpenController) {\n\t\tsuper();\n\n\t\tthis.openOnSingleClick = useSingleClickToOpen(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(openModeSettingKey)) {\n\t\t\t\tthis.openOnSingleClick = useSingleClickToOpen(this.configurationService);\n\t\t\t}\n\t\t}));\n\t}\n\n\tshouldOpen(event: UIEvent): boolean {\n\t\tif (event instanceof MouseEvent) {\n\t\t\tconst isLeftButton = event.button === 0;\n\t\t\tconst isDoubleClick = event.detail === 2;\n\t\t\tif (isLeftButton && !this.openOnSingleClick && !isDoubleClick) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (isLeftButton /* left mouse button */ || event.button === 1 /* middle mouse button */) {\n\t\t\t\treturn this.existingOpenController ? this.existingOpenController.shouldOpen(event) : true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.existingOpenController ? this.existingOpenController.shouldOpen(event) : true;\n\t}\n}\n\nfunction toWorkbenchListOptions<T>(options: IListOptions<T>, configurationService: IConfigurationService, keybindingService: IKeybindingService): [IListOptions<T>, IDisposable] {\n\tconst disposables: IDisposable[] = [];\n\tconst result = { ...options };\n\n\tif (options.multipleSelectionSupport !== false && !options.multipleSelectionController) {\n\t\tconst multipleSelectionController = new MultipleSelectionController(configurationService);\n\t\tresult.multipleSelectionController = multipleSelectionController;\n\t\tdisposables.push(multipleSelectionController);\n\t}\n\n\tconst openController = new WorkbenchOpenController(configurationService, options.openController);\n\tresult.openController = openController;\n\tdisposables.push(openController);\n\n\tif (options.keyboardNavigationLabelProvider) {\n\t\tconst tlp = options.keyboardNavigationLabelProvider;\n\n\t\tresult.keyboardNavigationLabelProvider = {\n\t\t\tgetKeyboardNavigationLabel(e) { return tlp.getKeyboardNavigationLabel(e); },\n\t\t\tmightProducePrintableCharacter(e) { return keybindingService.mightProducePrintableCharacter(e); }\n\t\t};\n\t}\n\n\treturn [result, combinedDisposable(disposables)];\n}\n\nlet sharedListStyleSheet: HTMLStyleElement;\nfunction getSharedListStyleSheet(): HTMLStyleElement {\n\tif (!sharedListStyleSheet) {\n\t\tsharedListStyleSheet = createStyleSheet();\n\t}\n\n\treturn sharedListStyleSheet;\n}\n\nfunction createKeyboardNavigationEventFilter(container: HTMLElement, keybindingService: IKeybindingService): IKeyboardNavigationEventFilter {\n\tlet inChord = false;\n\n\treturn event => {\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 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\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, TFilterData, any>[],\n\t\toptions: IObjectTreeOptions<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(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(container, delegate, renderers, treeOptions);\n\t\tthis.disposables.push(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.push(this.internals);\n\t}\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\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, TFilterData, any>[],\n\t\tdataSource: IDataSource<TInput, T>,\n\t\toptions: IDataTreeOptions<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(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(container, delegate, renderers, dataSource, treeOptions);\n\t\tthis.disposables.push(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.push(this.internals);\n\t}\n}\n\nexport class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends AsyncDataTree<TInput, T, TFilterData> {\n\n\tprivate internals: WorkbenchTreeInternals<TInput, T, TFilterData>;\n\tget contextKeyService(): IContextKeyService { return this.internals.contextKeyService; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tdelegate: IListVirtualDelegate<T>,\n\t\trenderers: ITreeRenderer<any /* TODO@joao */, TFilterData, any>[],\n\t\tdataSource: IAsyncDataSource<TInput, T>,\n\t\toptions: IAsyncDataTreeOptions<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(container, options, contextKeyService, themeService, configurationService, keybindingService, accessibilityService);\n\t\tsuper(container, delegate, renderers, dataSource, treeOptions);\n\t\tthis.disposables.push(disposable);\n\t\tthis.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, contextKeyService, listService, themeService, configurationService, accessibilityService);\n\t\tthis.disposables.push(this.internals);\n\t}\n}\n\nfunction workbenchTreeDataPreamble<T, TFilterData>(\n\tcontainer: HTMLElement,\n\toptions: IAbstractTreeOptions<T, TFilterData>,\n\tcontextKeyService: IContextKeyService,\n\tthemeService: IThemeService,\n\tconfigurationService: IConfigurationService,\n\tkeybindingService: IKeybindingService,\n\taccessibilityService: IAccessibilityService,\n): { options: IAbstractTreeOptions<T, TFilterData>, getAutomaticKeyboardNavigation: () => boolean | undefined, disposable: IDisposable } {\n\tWorkbenchListSupportsKeyboardNavigation.bindTo(contextKeyService);\n\n\tif (!didBindWorkbenchListAutomaticKeyboardNavigation) {\n\t\tWorkbenchListAutomaticKeyboardNavigation.bindTo(contextKeyService);\n\t\tdidBindWorkbenchListAutomaticKeyboardNavigation = true;\n\t}\n\n\tconst getAutomaticKeyboardNavigation = () => {\n\t\t// give priority to the context key value to disable this completely\n\t\tlet automaticKeyboardNavigation = contextKeyService.getContextKeyValue<boolean>(WorkbenchListAutomaticKeyboardNavigationKey);\n\n\t\tif (automaticKeyboardNavigation) {\n\t\t\tautomaticKeyboardNavigation = configurationService.getValue<boolean>(automaticKeyboardNavigationSettingKey);\n\t\t}\n\n\t\treturn automaticKeyboardNavigation;\n\t};\n\n\tconst accessibilityOn = accessibilityService.getAccessibilitySupport() === AccessibilitySupport.Enabled;\n\tconst keyboardNavigation = accessibilityOn ? 'simple' : configurationService.getValue<string>(keyboardNavigationSettingKey);\n\tconst horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : getHorizontalScrollingSetting(configurationService);\n\tconst openOnSingleClick = useSingleClickToOpen(configurationService);\n\tconst [workbenchListOptions, disposable] = toWorkbenchListOptions(options, configurationService, keybindingService);\n\n\treturn {\n\t\tgetAutomaticKeyboardNavigation,\n\t\tdisposable,\n\t\toptions: {\n\t\t\tkeyboardSupport: false,\n\t\t\tstyleController: new DefaultStyleController(getSharedListStyleSheet()),\n\t\t\t...computeStyles(themeService.getTheme(), defaultListStyles),\n\t\t\t...workbenchListOptions,\n\t\t\tindent: configurationService.getValue<number>(treeIndentKey),\n\t\t\tautomaticKeyboardNavigation: getAutomaticKeyboardNavigation(),\n\t\t\tsimpleKeyboardNavigation: keyboardNavigation === 'simple',\n\t\t\tfilterOnType: keyboardNavigation === 'filter',\n\t\t\thorizontalScrolling,\n\t\t\topenOnSingleClick,\n\t\t\tkeyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService)\n\t\t}\n\t};\n}\n\nclass WorkbenchTreeInternals<TInput, T, TFilterData> {\n\n\treadonly contextKeyService: IContextKeyService;\n\tprivate hasSelectionOrFocus: IContextKey<boolean>;\n\tprivate hasDoubleSelection: IContextKey<boolean>;\n\tprivate hasMultiSelection: IContextKey<boolean>;\n\tprivate _useAltAsMultipleSelectionModifier: boolean;\n\tprivate disposables: IDisposable[] = [];\n\n\tconstructor(\n\t\ttree: WorkbenchObjectTree<T, TFilterData> | WorkbenchDataTree<TInput, T, TFilterData> | WorkbenchAsyncDataTree<TInput, T, TFilterData>,\n\t\toptions: IAbstractTreeOptions<T, TFilterData>,\n\t\tgetAutomaticKeyboardNavigation: () => boolean | undefined,\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@IAccessibilityService accessibilityService: IAccessibilityService,\n\t) {\n\t\tthis.contextKeyService = createScopedContextKeyService(contextKeyService, tree);\n\n\t\tconst listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService);\n\t\tlistSupportsMultiSelect.set(!(options.multipleSelectionSupport === false));\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._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.getAccessibilitySupport() === AccessibilitySupport.Enabled;\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.disposables.push(\n\t\t\tthis.contextKeyService,\n\t\t\t(listService as ListService).register(tree),\n\t\t\tattachListStyler(tree, themeService),\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.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0);\n\t\t\t\tthis.hasMultiSelection.set(selection.length > 1);\n\t\t\t\tthis.hasDoubleSelection.set(selection.length === 2);\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}),\n\t\t\tconfigurationService.onDidChangeConfiguration(e => {\n\t\t\t\tif (e.affectsConfiguration(openModeSettingKey)) {\n\t\t\t\t\ttree.updateOptions({ openOnSingleClick: useSingleClickToOpen(configurationService) });\n\t\t\t\t}\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\ttree.updateOptions({ indent });\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\ttree.updateOptions({ automaticKeyboardNavigation: getAutomaticKeyboardNavigation() });\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.onDidChangeAccessibilitySupport(() => updateKeyboardNavigation())\n\t\t);\n\t}\n\n\tdispose(): void {\n\t\tthis.disposables = dispose(this.disposables);\n\t}\n}\n\nconst configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);\n\nconfigurationRegistry.registerConfiguration({\n\t'id': 'workbench',\n\t'order': 7,\n\t'title': localize('workbenchConfigurationTitle', \"Workbench\"),\n\t'type': 'object',\n\t'properties': {\n\t\t[multiSelectModifierSettingKey]: {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['ctrlCmd', 'alt'],\n\t\t\t'enumDescriptions': [\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\t'default': 'ctrlCmd',\n\t\t\t'description': 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\t'type': 'string',\n\t\t\t'enum': ['singleClick', 'doubleClick'],\n\t\t\t'default': 'singleClick',\n\t\t\t'description': 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). For parents with children in trees, this setting will control if a single click expands the parent or a double click. 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\t'type': 'boolean',\n\t\t\t'default': false,\n\t\t\t'description': localize('horizontalScrolling setting', \"Controls whether lists and trees support horizontal scrolling in the workbench.\")\n\t\t},\n\t\t'workbench.tree.horizontalScrolling': {\n\t\t\t'type': 'boolean',\n\t\t\t'default': false,\n\t\t\t'description': localize('tree horizontalScrolling setting', \"Controls whether trees support horizontal scrolling in the workbench.\"),\n\t\t\t'deprecationMessage': localize('deprecated', \"This setting is deprecated, please use '{0}' instead.\", horizontalScrollingKey)\n\t\t},\n\t\t[treeIndentKey]: {\n\t\t\t'type': 'number',\n\t\t\t'default': 8,\n\t\t\tminimum: 0,\n\t\t\tmaximum: 40,\n\t\t\t'description': localize('tree indent setting', \"Controls tree indentation in pixels.\")\n\t\t},\n\t\t[keyboardNavigationSettingKey]: {\n\t\t\t'type': 'string',\n\t\t\t'enum': ['simple', 'highlight', 'filter'],\n\t\t\t'enumDescriptions': [\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\t'default': 'highlight',\n\t\t\t'description': 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\t'type': 'boolean',\n\t\t\t'default': 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}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { Color } from 'vs/base/common/color';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { 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!./media/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 * as editorCommon 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/modes';\nimport { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { AriaProvider, DataSource, Delegate, FileReferencesRenderer, OneReferenceRenderer, TreeElement, StringRepresentationProvider, IdentityProvider } from 'vs/editor/contrib/referenceSearch/referencesTree';\nimport * as nls from 'vs/nls';\nimport { RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';\nimport { activeContrastBorder, contrastBorder, registerColor } from 'vs/platform/theme/common/colorRegistry';\nimport { ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { PeekViewWidget, IPeekViewService } from './peekViewWidget';\nimport { FileReferences, OneReference, ReferencesModel } from './referencesModel';\nimport { ITreeRenderer, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';\nimport { IAsyncDataTreeOptions } from 'vs/base/browser/ui/tree/asyncDataTree';\nimport { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';\nimport { FuzzyScore } from 'vs/base/common/filters';\nimport { SplitView, Sizing } from 'vs/base/browser/ui/splitview/splitview';\n\n\nclass DecorationsManager implements IDisposable {\n\n\tprivate static readonly DecorationOptions = ModelDecorationOptions.register({\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 _callOnDispose: IDisposable[] = [];\n\tprivate _callOnModelChange: IDisposable[] = [];\n\n\tconstructor(private _editor: ICodeEditor, private _model: ReferencesModel) {\n\t\tthis._callOnDispose.push(this._editor.onDidChangeModel(() => this._onModelChanged()));\n\t\tthis._onModelChanged();\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._callOnModelChange = dispose(this._callOnModelChange);\n\t\tthis._callOnDispose = dispose(this._callOnDispose);\n\t\tthis.removeDecorations();\n\t}\n\n\tprivate _onModelChanged(): void {\n\t\tthis._callOnModelChange = dispose(this._callOnModelChange);\n\t\tconst model = this._editor.getModel();\n\t\tif (model) {\n\t\t\tfor (const ref of this._model.groups) {\n\t\t\t\tif (ref.uri.toString() === model.uri.toString()) {\n\t\t\t\t\tthis._addDecorations(ref);\n\t\t\t\t\treturn;\n\t\t\t\t}\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.push(this._editor.getModel().onDidChangeDecorations((event) => 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\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\tthis._decorations.forEach((reference, decorationId) => {\n\t\t\tconst newRange = model.getDecorationRange(decorationId);\n\n\t\t\tif (!newRange) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet ignore = false;\n\n\t\t\tif (Range.equalsRange(newRange, reference.range)) {\n\t\t\t\treturn;\n\n\t\t\t} else if (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\tpublic removeDecorations(): void {\n\t\tlet toRemove: string[] = [];\n\t\tthis._decorations.forEach((value, key) => {\n\t\t\ttoRemove.push(key);\n\t\t});\n\t\tthis._editor.deltaDecorations(toRemove, []);\n\t\tthis._decorations.clear();\n\t}\n}\n\nexport class LayoutData {\n\tratio: number;\n\theightInLines: number;\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\tkind: 'goto' | 'show' | 'side' | 'open';\n\tsource: 'editor' | 'tree' | 'title';\n\telement?: Location;\n}\n\nexport const ctxReferenceWidgetSearchTreeFocused = new RawContextKey<boolean>('referenceSearchTreeFocused', true);\n\n/**\n * ZoneWidget that is shown inside the editor\n */\nexport class ReferenceWidget extends PeekViewWidget {\n\n\tprivate _model: ReferencesModel | undefined;\n\tprivate _decorationsManager: DecorationsManager;\n\n\tprivate _disposeOnNewModel: IDisposable[] = [];\n\tprivate _callOnDispose: IDisposable[] = [];\n\tprivate _onDidSelectReference = new Emitter<SelectionEvent>();\n\n\tprivate _tree: WorkbenchAsyncDataTree<ReferencesModel | FileReferences, TreeElement, FuzzyScore>;\n\tprivate _treeContainer: HTMLElement;\n\t// private _sash: VSash;\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: dom.Dimension = { height: 0, width: 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@IPeekViewService private readonly _peekViewService: IPeekViewService,\n\t\t@ILabelService private readonly _uriLabel: ILabelService\n\t) {\n\t\tsuper(editor, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true });\n\n\t\tthis._applyTheme(themeService.getTheme());\n\t\tthis._callOnDispose.push(themeService.onThemeChange(this._applyTheme.bind(this)));\n\t\tthis._peekViewService.addExclusiveWidget(editor, this);\n\t\tthis.create();\n\t}\n\n\tdispose(): void {\n\t\tthis.setModel(undefined);\n\t\tthis._callOnDispose = dispose(this._callOnDispose);\n\t\tdispose<IDisposable>(this._preview, this._previewNotAvailableMessage, this._tree, this._previewModelReference);\n\t\tthis._splitView.dispose();\n\t\tsuper.dispose();\n\t}\n\n\tprivate _applyTheme(theme: ITheme) {\n\t\tconst borderColor = theme.getColor(peekViewBorder) || Color.transparent;\n\t\tthis.style({\n\t\t\tarrowColor: borderColor,\n\t\t\tframeColor: borderColor,\n\t\t\theaderBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent,\n\t\t\tprimaryHeadingColor: theme.getColor(peekViewTitleForeground),\n\t\t\tsecondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground)\n\t\t});\n\t}\n\n\tget onDidSelectReference(): Event<SelectionEvent> {\n\t\treturn this._onDidSelectReference.event;\n\t}\n\n\tshow(where: IRange) {\n\t\tthis.editor.revealRangeInCenterIfOutsideViewport(where, editorCommon.ScrollType.Smooth);\n\t\tsuper.show(where, this.layoutData.heightInLines || 18);\n\t}\n\n\tfocus(): void {\n\t\tthis._tree.domFocus();\n\t}\n\n\tprotected _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},\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 = TextModel.createFromString(nls.localize('missingPreviewMessage', \"no preview available\"));\n\n\t\t// tree\n\t\tthis._treeContainer = dom.append(containerElement, dom.$('div.ref-tree.inline'));\n\t\tconst treeOptions: IAsyncDataTreeOptions<TreeElement, FuzzyScore> = {\n\t\t\tariaLabel: nls.localize('treeAriaLabel', \"References\"),\n\t\t\tkeyboardSupport: this._defaultTreeKeyboardSupport,\n\t\t\taccessibilityProvider: new AriaProvider(),\n\t\t\tkeyboardNavigationLabelProvider: this._instantiationService.createInstance(StringRepresentationProvider),\n\t\t\tidentityProvider: new IdentityProvider()\n\t\t};\n\t\tthis._tree = this._instantiationService.createInstance<HTMLElement, IListVirtualDelegate<TreeElement>, ITreeRenderer<any, FuzzyScore, any>[], IAsyncDataSource<ReferencesModel | FileReferences, TreeElement>, IAsyncDataTreeOptions<TreeElement, FuzzyScore>, WorkbenchAsyncDataTree<ReferencesModel | FileReferences, TreeElement, FuzzyScore>>(\n\t\t\tWorkbenchAsyncDataTree,\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\t\tctxReferenceWidgetSearchTreeFocused.bindTo(this._tree.contextKeyService);\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._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, this._disposables);\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.onDidChangeFocus(e => {\n\t\t\tonEvent(e.elements[0], 'show');\n\t\t});\n\t\tthis._tree.onDidChangeSelection(e => {\n\t\t\tlet aside = false;\n\t\t\tlet goto = false;\n\t\t\tif (e.browserEvent instanceof KeyboardEvent) {\n\t\t\t\t// todo@joh make this a command\n\t\t\t\tgoto = true;\n\t\t\t}\n\t\t\tif (aside) {\n\t\t\t\tonEvent(e.elements[0], 'side');\n\t\t\t} else if (goto) {\n\t\t\t\tonEvent(e.elements[0], 'goto');\n\t\t\t} else {\n\t\t\t\tonEvent(e.elements[0], 'show');\n\t\t\t}\n\t\t});\n\t\tthis._tree.onDidOpen(e => {\n\t\t\tconst aside = (e.browserEvent instanceof MouseEvent) && (e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey);\n\t\t\tconst goto = !e.browserEvent || ((e.browserEvent instanceof MouseEvent) && e.browserEvent.detail === 2);\n\n\t\t\tif (aside) {\n\t\t\t\tonEvent(e.elements[0], 'side');\n\t\t\t} else if (goto) {\n\t\t\t\tonEvent(e.elements[0], 'goto');\n\t\t\t} else {\n\t\t\t\tonEvent(e.elements[0], 'show');\n\t\t\t}\n\t\t});\n\n\t\tdom.hide(this._treeContainer);\n\t}\n\n\tprotected _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 _doLayoutBody(heightInPixel: number, widthInPixel: number): void {\n\t\tsuper._doLayoutBody(heightInPixel, widthInPixel);\n\t\tthis._dim = { height: heightInPixel, width: widthInPixel };\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\tpublic setSelection(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\tpublic setModel(newModel: ReferencesModel | undefined): Promise<any> {\n\t\t// clean up\n\t\tthis._disposeOnNewModel = dispose(this._disposeOnNewModel);\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.empty) {\n\t\t\tthis.setTitle('');\n\t\t\tthis._messageContainer.innerHTML = 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.push(this._decorationsManager);\n\n\t\t// listen on model changes\n\t\tthis._disposeOnNewModel.push(this._model.onDidChangeReferenceRange(reference => this._tree.rerender(reference)));\n\n\t\t// listen on editor\n\t\tthis._disposeOnNewModel.push(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\tdom.addClass(this.container, '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.focus();\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\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 ? editorCommon.ScrollType.Smooth : editorCommon.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// theming\n\nexport const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: '#1E1E1E', light: '#FFFFFF', hc: '#0C141F' }, nls.localize('peekViewTitleBackground', 'Background color of the peek view title area.'));\nexport const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: '#FFFFFF', light: '#333333', hc: '#FFFFFF' }, nls.localize('peekViewTitleForeground', 'Color of the peek view title.'));\nexport const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#6c6c6cb3', hc: '#FFFFFF99' }, nls.localize('peekViewTitleInfoForeground', 'Color of the peek view title info.'));\nexport const peekViewBorder = registerColor('peekView.border', { dark: '#007acc', light: '#007acc', 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\nregisterThemingParticipant((theme, collector) => {\n\tconst findMatchHighlightColor = theme.getColor(peekViewResultsMatchHighlight);\n\tif (findMatchHighlightColor) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch { background-color: ${findMatchHighlightColor}; }`);\n\t}\n\tconst referenceHighlightColor = theme.getColor(peekViewEditorMatchHighlight);\n\tif (referenceHighlightColor) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${referenceHighlightColor}; }`);\n\t}\n\tconst referenceHighlightBorder = theme.getColor(peekViewEditorMatchHighlightBorder);\n\tif (referenceHighlightBorder) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${referenceHighlightBorder}; box-sizing: border-box; }`);\n\t}\n\tconst hcOutline = theme.getColor(activeContrastBorder);\n\tif (hcOutline) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`);\n\t}\n\tconst resultsBackground = theme.getColor(peekViewResultsBackground);\n\tif (resultsBackground) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${resultsBackground}; }`);\n\t}\n\tconst resultsMatchForeground = theme.getColor(peekViewResultsMatchForeground);\n\tif (resultsMatchForeground) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${resultsMatchForeground}; }`);\n\t}\n\tconst resultsFileForeground = theme.getColor(peekViewResultsFileForeground);\n\tif (resultsFileForeground) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${resultsFileForeground}; }`);\n\t}\n\tconst resultsSelectedBackground = theme.getColor(peekViewResultsSelectionBackground);\n\tif (resultsSelectedBackground) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${resultsSelectedBackground}; }`);\n\t}\n\tconst resultsSelectedForeground = theme.getColor(peekViewResultsSelectionForeground);\n\tif (resultsSelectedForeground) {\n\t\tcollector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${resultsSelectedForeground} !important; }`);\n\t}\n\tconst editorBackground = theme.getColor(peekViewEditorBackground);\n\tif (editorBackground) {\n\t\tcollector.addRule(\n\t\t\t`.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,` +\n\t\t\t`.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {` +\n\t\t\t`\tbackground-color: ${editorBackground};` +\n\t\t\t`}`);\n\t}\n\tconst editorGutterBackground = theme.getColor(peekViewEditorGutterBackground);\n\tif (editorGutterBackground) {\n\t\tcollector.addRule(\n\t\t\t`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin {` +\n\t\t\t`\tbackground-color: ${editorGutterBackground};` +\n\t\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!./media/gotoErrorWidget';\nimport * as nls from 'vs/nls';\nimport * as dom from 'vs/base/browser/dom';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { IMarker, MarkerSeverity, IRelatedInformation } from 'vs/platform/markers/common/markers';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { registerColor, oneOf, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { Color } from 'vs/base/common/color';\nimport { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder } from 'vs/editor/common/view/editorColorRegistry';\nimport { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';\nimport { ScrollbarVisibility } from 'vs/base/common/scrollable';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { getBaseLabel, getPathLabel } from 'vs/base/common/labels';\nimport { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { PeekViewWidget } from 'vs/editor/contrib/referenceSearch/peekViewWidget';\nimport { basename } from 'vs/base/common/resources';\nimport { IAction } from 'vs/base/common/actions';\nimport { IActionBarOptions, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';\nimport { peekViewTitleForeground, peekViewTitleInfoForeground } from 'vs/editor/contrib/referenceSearch/referencesWidget';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\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: IDisposable[] = [];\n\n\tconstructor(parent: HTMLElement, editor: ICodeEditor, onRelatedInformation: (related: IRelatedInformation) => void) {\n\t\tthis._editor = editor;\n\n\t\tconst domNode = document.createElement('div');\n\t\tdomNode.className = 'descriptioncontainer';\n\t\tdomNode.setAttribute('aria-live', 'assertive');\n\t\tdomNode.setAttribute('role', 'alert');\n\n\t\tthis._messageBlock = document.createElement('div');\n\t\tdom.addClass(this._messageBlock, 'message');\n\t\tdomNode.appendChild(this._messageBlock);\n\n\t\tthis._relatedBlock = document.createElement('div');\n\t\tdomNode.appendChild(this._relatedBlock);\n\t\tthis._disposables.push(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: 3,\n\t\t\tverticalScrollbarSize: 3\n\t\t});\n\t\tparent.appendChild(this._scrollable.getDomNode());\n\t\tthis._disposables.push(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.push(this._scrollable);\n\t}\n\n\tdispose(): void {\n\t\tdispose(this._disposables);\n\t}\n\n\tupdate({ source, message, relatedInformation, code }: IMarker): void {\n\n\t\tconst lines = message.split(/\\r\\n|\\r|\\n/g);\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, this._longestLineLength);\n\t\t}\n\n\t\tdom.clearNode(this._messageBlock);\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\tdom.addClass(detailsElement, '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\tdom.addClass(sourceElement, 'source');\n\t\t\t\tdetailsElement.appendChild(sourceElement);\n\t\t\t}\n\t\t\tif (code) {\n\t\t\t\tconst codeElement = document.createElement('span');\n\t\t\t\tcodeElement.innerText = `(${code})`;\n\t\t\t\tdom.addClass(codeElement, 'code');\n\t\t\t\tdetailsElement.appendChild(codeElement);\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.getConfiguration().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\tdom.addClass(relatedResource, 'filename');\n\t\t\t\trelatedResource.innerHTML = `${getBaseLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `;\n\t\t\t\trelatedResource.title = getPathLabel(related.resource, undefined);\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.getConfiguration().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\nexport class MarkerNavigationWidget extends PeekViewWidget {\n\n\tprivate _parentContainer: HTMLElement;\n\tprivate _container: HTMLElement;\n\tprivate _message: MessageWidget;\n\tprivate _callOnDispose: IDisposable[] = [];\n\tprivate _severity: MarkerSeverity;\n\tprivate _backgroundColor?: Color;\n\tprivate _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\tprivate readonly actions: IAction[],\n\t\tprivate readonly _themeService: IThemeService\n\t) {\n\t\tsuper(editor, { showArrow: true, showFrame: true, isAccessible: true });\n\t\tthis._severity = MarkerSeverity.Warning;\n\t\tthis._backgroundColor = Color.white;\n\n\t\tthis._applyTheme(_themeService.getTheme());\n\t\tthis._callOnDispose.push(_themeService.onThemeChange(this._applyTheme.bind(this)));\n\n\t\tthis.create();\n\t}\n\n\tprivate _applyTheme(theme: ITheme) {\n\t\tthis._backgroundColor = theme.getColor(editorMarkerNavigationBackground);\n\t\tlet colorId = editorMarkerNavigationError;\n\t\tif (this._severity === MarkerSeverity.Warning) {\n\t\t\tcolorId = editorMarkerNavigationWarning;\n\t\t} else if (this._severity === MarkerSeverity.Info) {\n\t\t\tcolorId = editorMarkerNavigationInfo;\n\t\t}\n\t\tconst frameColor = theme.getColor(colorId);\n\t\tthis.style({\n\t\t\tarrowColor: frameColor,\n\t\t\tframeColor: frameColor,\n\t\t\theaderBackgroundColor: this._backgroundColor,\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 _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\tdispose(): void {\n\t\tthis._callOnDispose = dispose(this._callOnDispose);\n\t\tsuper.dispose();\n\t}\n\n\tfocus(): void {\n\t\tthis._parentContainer.focus();\n\t}\n\n\tprotected _fillHead(container: HTMLElement): void {\n\t\tsuper._fillHead(container);\n\t\tthis._actionbarWidget.push(this.actions, { label: false, icon: true });\n\t}\n\n\tprotected _getActionBarOptions(): IActionBarOptions {\n\t\treturn {\n\t\t\torientation: ActionsOrientation.HORIZONTAL_REVERSE\n\t\t};\n\t}\n\n\tprotected _fillBody(container: HTMLElement): void {\n\t\tthis._parentContainer = container;\n\t\tdom.addClass(container, '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));\n\t\tthis._disposables.push(this._message);\n\t}\n\n\tshow(where: Position, heightInLines: number): 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.getTheme());\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\tlet headingIconClassName = 'error';\n\t\tif (this._severity === MarkerSeverity.Warning) {\n\t\t\theadingIconClassName = 'warning';\n\t\t} else if (this._severity === MarkerSeverity.Info) {\n\t\t\theadingIconClassName = 'info';\n\t\t}\n\t\tthis.setTitleIcon(headingIconClassName);\n\n\t\tthis.editor.revealPositionInCenter(position, ScrollType.Smooth);\n\n\t\tif (this.editor.getConfiguration().accessibilitySupport !== AccessibilitySupport.Disabled) {\n\t\t\tthis.focus();\n\t\t}\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 _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 _onWidth(widthInPixel: number): void {\n\t\tthis._message.layout(this._heightInPixel, widthInPixel);\n\t}\n\n\tprotected _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: errorDefault }, nls.localize('editorMarkerNavigationError', 'Editor marker navigation widget error color.'));\nexport const editorMarkerNavigationWarning = registerColor('editorMarkerNavigationWarning.background', { dark: warningDefault, light: warningDefault, hc: warningDefault }, nls.localize('editorMarkerNavigationWarning', 'Editor marker navigation widget warning color.'));\nexport const editorMarkerNavigationInfo = registerColor('editorMarkerNavigationInfo.background', { dark: infoDefault, light: infoDefault, hc: infoDefault }, nls.localize('editorMarkerNavigationInfo', 'Editor marker navigation widget info color.'));\nexport const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', { dark: '#2D2D30', light: Color.white, hc: '#0C141F' }, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.'));\n\nregisterThemingParticipant((theme, collector) => {\n\tconst link = theme.getColor(textLinkForeground);\n\tif (link) {\n\t\tcollector.addRule(`.monaco-editor .marker-widget a { color: ${link}; }`);\n\t}\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 } from 'vs/base/common/event';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { URI } from 'vs/base/common/uri';\nimport { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { registerEditorAction, registerEditorContribution, ServicesAccessor, IActionOptions, EditorAction, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { MarkerNavigationWidget } from './gotoErrorWidget';\nimport { compare } from 'vs/base/common/strings';\nimport { binarySearch } from 'vs/base/common/arrays';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';\nimport { Action } from 'vs/base/common/actions';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\n\nclass MarkerModel {\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _markers: IMarker[];\n\tprivate _nextIdx: number;\n\tprivate _toUnbind: IDisposable[];\n\tprivate _ignoreSelectionChange: boolean;\n\tprivate readonly _onCurrentMarkerChanged: Emitter<IMarker | undefined>;\n\tprivate readonly _onMarkerSetChanged: Emitter<MarkerModel>;\n\n\tconstructor(editor: ICodeEditor, markers: IMarker[]) {\n\t\tthis._editor = editor;\n\t\tthis._markers = [];\n\t\tthis._nextIdx = -1;\n\t\tthis._toUnbind = [];\n\t\tthis._ignoreSelectionChange = false;\n\t\tthis._onCurrentMarkerChanged = new Emitter<IMarker>();\n\t\tthis._onMarkerSetChanged = new Emitter<MarkerModel>();\n\t\tthis.setMarkers(markers);\n\n\t\t// listen on editor\n\t\tthis._toUnbind.push(this._editor.onDidDispose(() => this.dispose()));\n\t\tthis._toUnbind.push(this._editor.onDidChangeCursorPosition(() => {\n\t\t\tif (this._ignoreSelectionChange) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.currentMarker && this._editor.getPosition() && Range.containsPosition(this.currentMarker, this._editor.getPosition()!)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._nextIdx = -1;\n\t\t}));\n\t}\n\n\tpublic get onCurrentMarkerChanged() {\n\t\treturn this._onCurrentMarkerChanged.event;\n\t}\n\n\tpublic get onMarkerSetChanged() {\n\t\treturn this._onMarkerSetChanged.event;\n\t}\n\n\tpublic setMarkers(markers: IMarker[]): void {\n\n\t\tlet oldMarker = this._nextIdx >= 0 ? this._markers[this._nextIdx] : undefined;\n\t\tthis._markers = markers || [];\n\t\tthis._markers.sort(MarkerNavigationAction.compareMarker);\n\t\tif (!oldMarker) {\n\t\t\tthis._nextIdx = -1;\n\t\t} else {\n\t\t\tthis._nextIdx = Math.max(-1, binarySearch(this._markers, oldMarker, MarkerNavigationAction.compareMarker));\n\t\t}\n\t\tthis._onMarkerSetChanged.fire(this);\n\t}\n\n\tpublic withoutWatchingEditorPosition(callback: () => void): void {\n\t\tthis._ignoreSelectionChange = true;\n\t\ttry {\n\t\t\tcallback();\n\t\t} finally {\n\t\t\tthis._ignoreSelectionChange = false;\n\t\t}\n\t}\n\n\tprivate _initIdx(fwd: boolean): void {\n\t\tlet found = false;\n\t\tconst position = this._editor.getPosition();\n\t\tfor (let i = 0; i < this._markers.length; i++) {\n\t\t\tlet range = Range.lift(this._markers[i]);\n\n\t\t\tif (range.isEmpty() && this._editor.getModel()) {\n\t\t\t\tconst word = this._editor.getModel()!.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\t\t}\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\tget currentMarker(): IMarker | undefined {\n\t\treturn this.canNavigate() ? this._markers[this._nextIdx] : undefined;\n\t}\n\n\tset currentMarker(marker: IMarker | undefined) {\n\t\tconst idx = this._nextIdx;\n\t\tthis._nextIdx = -1;\n\t\tif (marker) {\n\t\t\tthis._nextIdx = this.indexOf(marker);\n\t\t}\n\t\tif (this._nextIdx !== idx) {\n\t\t\tthis._onCurrentMarkerChanged.fire(marker);\n\t\t}\n\t}\n\n\tpublic move(fwd: boolean, inCircles: boolean): boolean {\n\t\tif (!this.canNavigate()) {\n\t\t\tthis._onCurrentMarkerChanged.fire(undefined);\n\t\t\treturn !inCircles;\n\t\t}\n\n\t\tlet oldIdx = this._nextIdx;\n\t\tlet atEdge = false;\n\n\t\tif (this._nextIdx === -1) {\n\t\t\tthis._initIdx(fwd);\n\n\t\t} else if (fwd) {\n\t\t\tif (inCircles || this._nextIdx + 1 < this._markers.length) {\n\t\t\t\tthis._nextIdx = (this._nextIdx + 1) % this._markers.length;\n\t\t\t} else {\n\t\t\t\tatEdge = true;\n\t\t\t}\n\n\t\t} else if (!fwd) {\n\t\t\tif (inCircles || this._nextIdx > 0) {\n\t\t\t\tthis._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length;\n\t\t\t} else {\n\t\t\t\tatEdge = true;\n\t\t\t}\n\t\t}\n\n\t\tif (oldIdx !== this._nextIdx) {\n\t\t\tconst marker = this._markers[this._nextIdx];\n\t\t\tthis._onCurrentMarkerChanged.fire(marker);\n\t\t}\n\n\t\treturn atEdge;\n\t}\n\n\tpublic canNavigate(): boolean {\n\t\treturn this._markers.length > 0;\n\t}\n\n\tpublic findMarkerAtPosition(pos: Position): IMarker | undefined {\n\t\tfor (const marker of this._markers) {\n\t\t\tif (Range.containsPosition(marker, pos)) {\n\t\t\t\treturn marker;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic get total() {\n\t\treturn this._markers.length;\n\t}\n\n\tpublic indexOf(marker: IMarker): number {\n\t\treturn 1 + this._markers.indexOf(marker);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._toUnbind = dispose(this._toUnbind);\n\t}\n}\n\nexport class MarkerController implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.markerController';\n\n\tpublic static get(editor: ICodeEditor): MarkerController {\n\t\treturn editor.getContribution<MarkerController>(MarkerController.ID);\n\t}\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _model: MarkerModel | null = null;\n\tprivate _widget: MarkerNavigationWidget | null = null;\n\tprivate readonly _widgetVisible: IContextKey<boolean>;\n\tprivate _disposeOnClose: IDisposable[] = [];\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkerService private readonly _markerService: IMarkerService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@ICodeEditorService private readonly _editorService: ICodeEditorService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._widgetVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService);\n\t}\n\n\tpublic getId(): string {\n\t\treturn MarkerController.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._cleanUp();\n\t}\n\n\tprivate _cleanUp(): void {\n\t\tthis._widgetVisible.reset();\n\t\tthis._disposeOnClose = dispose(this._disposeOnClose);\n\t\tthis._widget = null;\n\t\tthis._model = null;\n\t}\n\n\tpublic getOrCreateModel(): MarkerModel {\n\n\t\tif (this._model) {\n\t\t\treturn this._model;\n\t\t}\n\n\t\tconst markers = this._getMarkers();\n\t\tthis._model = new MarkerModel(this._editor, markers);\n\t\tthis._markerService.onMarkerChanged(this._onMarkerChanged, this, this._disposeOnClose);\n\n\t\tconst prevMarkerKeybinding = this._keybindingService.lookupKeybinding(PrevMarkerAction.ID);\n\t\tconst nextMarkerKeybinding = this._keybindingService.lookupKeybinding(NextMarkerAction.ID);\n\t\tconst actions = [\n\t\t\tnew Action(PrevMarkerAction.ID, PrevMarkerAction.LABEL + (prevMarkerKeybinding ? ` (${prevMarkerKeybinding.getLabel()})` : ''), 'show-previous-problem chevron-up', this._model.canNavigate(), async () => { if (this._model) { this._model.move(false, true); } }),\n\t\t\tnew Action(NextMarkerAction.ID, NextMarkerAction.LABEL + (nextMarkerKeybinding ? ` (${nextMarkerKeybinding.getLabel()})` : ''), 'show-next-problem chevron-down', this._model.canNavigate(), async () => { if (this._model) { this._model.move(true, true); } })\n\t\t];\n\t\tthis._widget = new MarkerNavigationWidget(this._editor, actions, this._themeService);\n\t\tthis._widgetVisible.set(true);\n\t\tthis._widget.onDidClose(() => this._cleanUp(), this, this._disposeOnClose);\n\n\t\tthis._disposeOnClose.push(this._model);\n\t\tthis._disposeOnClose.push(this._widget);\n\t\tthis._disposeOnClose.push(...actions);\n\t\tthis._disposeOnClose.push(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).then(undefined, onUnexpectedError);\n\t\t\tthis.closeMarkersNavigation(false);\n\t\t}));\n\t\tthis._disposeOnClose.push(this._editor.onDidChangeModel(() => this._cleanUp()));\n\n\t\tthis._disposeOnClose.push(this._model.onCurrentMarkerChanged(marker => {\n\t\t\tif (!marker || !this._model) {\n\t\t\t\tthis._cleanUp();\n\t\t\t} else {\n\t\t\t\tthis._model.withoutWatchingEditorPosition(() => {\n\t\t\t\t\tif (!this._widget || !this._model) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._widget.showAtMarker(marker, this._model.indexOf(marker), this._model.total);\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\t\tthis._disposeOnClose.push(this._model.onMarkerSetChanged(() => {\n\t\t\tif (!this._widget || !this._widget.position || !this._model) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst marker = this._model.findMarkerAtPosition(this._widget.position);\n\t\t\tif (marker) {\n\t\t\t\tthis._widget.updateMarker(marker);\n\t\t\t} else {\n\t\t\t\tthis._widget.showStale();\n\t\t\t}\n\t\t}));\n\n\t\treturn this._model;\n\t}\n\n\tpublic closeMarkersNavigation(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\tpublic show(marker: IMarker): void {\n\t\tconst model = this.getOrCreateModel();\n\t\tmodel.currentMarker = marker;\n\t}\n\n\tprivate _onMarkerChanged(changedResources: URI[]): void {\n\t\tlet editorModel = this._editor.getModel();\n\t\tif (!editorModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._model) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!changedResources.some(r => editorModel!.uri.toString() === r.toString())) {\n\t\t\treturn;\n\t\t}\n\t\tthis._model.setMarkers(this._getMarkers());\n\t}\n\n\tprivate _getMarkers(): IMarker[] {\n\t\tlet model = this._editor.getModel();\n\t\tif (!model) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn this._markerService.read({\n\t\t\tresource: model.uri,\n\t\t\tseverities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info\n\t\t});\n\t}\n}\n\nclass MarkerNavigationAction extends EditorAction {\n\n\tprivate readonly _isNext: boolean;\n\n\tprivate readonly _multiFile: boolean;\n\n\tconstructor(next: boolean, multiFile: boolean, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis._isNext = next;\n\t\tthis._multiFile = multiFile;\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {\n\n\t\tconst markerService = accessor.get(IMarkerService);\n\t\tconst editorService = accessor.get(ICodeEditorService);\n\t\tconst controller = MarkerController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\tconst model = controller.getOrCreateModel();\n\t\tconst atEdge = model.move(this._isNext, !this._multiFile);\n\t\tif (!atEdge || !this._multiFile) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\t// try with the next/prev file\n\t\tlet markers = markerService.read({ severities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info }).sort(MarkerNavigationAction.compareMarker);\n\t\tif (markers.length === 0) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\tlet editorModel = editor.getModel();\n\t\tif (!editorModel) {\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\tlet oldMarker = model.currentMarker || <IMarker>{ resource: editorModel!.uri, severity: MarkerSeverity.Error, startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 };\n\t\tlet idx = binarySearch(markers, oldMarker, MarkerNavigationAction.compareMarker);\n\t\tif (idx < 0) {\n\t\t\t// find best match...\n\t\t\tidx = ~idx;\n\t\t\tidx %= markers.length;\n\t\t} else if (this._isNext) {\n\t\t\tidx = (idx + 1) % markers.length;\n\t\t} else {\n\t\t\tidx = (idx + markers.length - 1) % markers.length;\n\t\t}\n\n\t\tlet newMarker = markers[idx];\n\t\tif (newMarker.resource.toString() === editorModel!.uri.toString()) {\n\t\t\t// the next `resource` is this resource which\n\t\t\t// means we cycle within this file\n\t\t\tmodel.move(this._isNext, true);\n\t\t\treturn Promise.resolve(undefined);\n\t\t}\n\n\t\t// close the widget for this editor-instance, open the resource\n\t\t// for the next marker and re-start marker navigation in there\n\t\tcontroller.closeMarkersNavigation();\n\n\t\treturn editorService.openCodeEditor({\n\t\t\tresource: newMarker.resource,\n\t\t\toptions: { pinned: false, revealIfOpened: true, revealInCenterIfOutsideViewport: true, selection: newMarker }\n\t\t}, editor).then(editor => {\n\t\t\tif (!editor) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn editor.getAction(this.id).run();\n\t\t});\n\t}\n\n\tstatic compareMarker(a: IMarker, b: IMarker): number {\n\t\tlet res = compare(a.resource.toString(), b.resource.toString());\n\t\tif (res === 0) {\n\t\t\tres = MarkerSeverity.compare(a.severity, b.severity);\n\t\t}\n\t\tif (res === 0) {\n\t\t\tres = Range.compareRangesUsingStarts(a, b);\n\t\t}\n\t\treturn res;\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 Error or Warning',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib }\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 Error or Warning',\n\t\t\tprecondition: EditorContextKeys.writable,\n\t\t\tkbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib }\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 Error or Warning in Files',\n\t\t\tprecondition: EditorContextKeys.writable,\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});\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 Error or Warning in Files',\n\t\t\tprecondition: EditorContextKeys.writable,\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});\n\t}\n}\n\nregisterEditorContribution(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.closeMarkersNavigation(),\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// Go to menu\nMenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {\n\tgroup: '6_problem_nav',\n\tcommand: {\n\t\tid: 'editor.action.marker.nextInFiles',\n\t\ttitle: nls.localize({ key: 'miGotoNextProblem', comment: ['&& denotes a mnemonic'] }, \"Next &&Problem\")\n\t},\n\torder: 1\n});\n\nMenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {\n\tgroup: '6_problem_nav',\n\tcommand: {\n\t\tid: 'editor.action.marker.prevInFiles',\n\t\ttitle: nls.localize({ key: 'miGotoPreviousProblem', comment: ['&& denotes a mnemonic'] }, \"Previous &&Problem\")\n\t},\n\torder: 2\n});","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { CancellationToken } from 'vs/base/common/cancellation';\nimport { Color, RGBA } from 'vs/base/common/color';\nimport { IMarkdownString, MarkdownString, isEmptyMarkdownString, markedStringsEquals } from 'vs/base/common/htmlContent';\nimport { Disposable, IDisposable, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { Position } from 'vs/editor/common/core/position';\nimport { IRange, Range } from 'vs/editor/common/core/range';\nimport { ModelDecorationOptions } from 'vs/editor/common/model/textModel';\nimport { DocumentColorProvider, Hover as MarkdownHover, HoverProviderRegistry, IColor } from 'vs/editor/common/modes';\nimport { getColorPresentations } from 'vs/editor/contrib/colorPicker/color';\nimport { ColorDetector } from 'vs/editor/contrib/colorPicker/colorDetector';\nimport { ColorPickerModel } from 'vs/editor/contrib/colorPicker/colorPickerModel';\nimport { ColorPickerWidget } from 'vs/editor/contrib/colorPicker/colorPickerWidget';\nimport { getHover } from 'vs/editor/contrib/hover/getHover';\nimport { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contrib/hover/hoverOperation';\nimport { ContentHoverWidget } from 'vs/editor/contrib/hover/hoverWidgets';\nimport { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { coalesce, isNonEmptyArray, asArray } from 'vs/base/common/arrays';\nimport { IMarker, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers';\nimport { basename } from 'vs/base/common/resources';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener';\nimport { MarkerController, NextMarkerAction } from 'vs/editor/contrib/gotoError/gotoError';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';\nimport { getCodeActions } from 'vs/editor/contrib/codeAction/codeAction';\nimport { applyCodeAction, QuickFixAction } from 'vs/editor/contrib/codeAction/codeActionCommands';\nimport { Action } from 'vs/base/common/actions';\nimport { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { withNullAsUndefined } from 'vs/base/common/types';\nimport { IIdentifiedSingleEditOperation } from 'vs/editor/common/model';\n\nconst $ = dom.$;\n\nclass ColorHover {\n\n\tconstructor(\n\t\tpublic readonly range: IRange,\n\t\tpublic readonly color: IColor,\n\t\tpublic readonly provider: DocumentColorProvider\n\t) { }\n}\n\nclass MarkerHover {\n\n\tconstructor(\n\t\tpublic readonly range: IRange,\n\t\tpublic readonly marker: IMarker,\n\t) { }\n}\n\ntype HoverPart = MarkdownHover | ColorHover | MarkerHover;\n\nclass ModesContentComputer implements IHoverComputer<HoverPart[]> {\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _result: HoverPart[];\n\tprivate _range: Range | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tprivate readonly _markerDecorationsService: IMarkerDecorationsService\n\t) {\n\t\tthis._editor = editor;\n\t\tthis._range = null;\n\t}\n\n\tsetRange(range: Range): void {\n\t\tthis._range = range;\n\t\tthis._result = [];\n\t}\n\n\tclearResult(): void {\n\t\tthis._result = [];\n\t}\n\n\tcomputeAsync(token: CancellationToken): Promise<HoverPart[]> {\n\t\tif (!this._editor.hasModel() || !this._range) {\n\t\t\treturn Promise.resolve([]);\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\n\t\tif (!HoverProviderRegistry.has(model)) {\n\t\t\treturn Promise.resolve([]);\n\t\t}\n\n\t\treturn getHover(model, new Position(\n\t\t\tthis._range.startLineNumber,\n\t\t\tthis._range.startColumn\n\t\t), token);\n\t}\n\n\tcomputeSync(): HoverPart[] {\n\t\tif (!this._editor.hasModel() || !this._range) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst lineNumber = this._range.startLineNumber;\n\n\t\tif (lineNumber > this._editor.getModel().getLineCount()) {\n\t\t\t// Illegal line number => no results\n\t\t\treturn [];\n\t\t}\n\n\t\tconst colorDetector = ColorDetector.get(this._editor);\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tconst lineDecorations = this._editor.getLineDecorations(lineNumber);\n\t\tlet didFindColor = false;\n\n\t\tconst hoverRange = this._range;\n\t\tconst result = lineDecorations.map((d): HoverPart | null => {\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\tif (startColumn > hoverRange.startColumn || hoverRange.endColumn > endColumn) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst range = new Range(hoverRange.startLineNumber, startColumn, hoverRange.startLineNumber, endColumn);\n\t\t\tconst marker = this._markerDecorationsService.getMarker(model, d);\n\t\t\tif (marker) {\n\t\t\t\treturn new MarkerHover(range, marker);\n\t\t\t}\n\n\t\t\tconst colorData = colorDetector.getColorData(d.range.getStartPosition());\n\n\t\t\tif (!didFindColor && colorData) {\n\t\t\t\tdidFindColor = true;\n\n\t\t\t\tconst { color, range } = colorData.colorInfo;\n\t\t\t\treturn new ColorHover(range, color, colorData.provider);\n\t\t\t} else {\n\t\t\t\tif (isEmptyMarkdownString(d.options.hoverMessage)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst contents: IMarkdownString[] = d.options.hoverMessage ? asArray(d.options.hoverMessage) : [];\n\t\t\t\treturn { contents, range };\n\t\t\t}\n\t\t});\n\n\t\treturn coalesce(result);\n\t}\n\n\tonResult(result: HoverPart[], isFromSynchronousComputation: boolean): void {\n\t\t// Always put synchronous messages before asynchronous ones\n\t\tif (isFromSynchronousComputation) {\n\t\t\tthis._result = result.concat(this._result.sort((a, b) => {\n\t\t\t\tif (a instanceof ColorHover) { // sort picker messages at to the top\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (b instanceof ColorHover) {\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} else {\n\t\t\tthis._result = this._result.concat(result);\n\t\t}\n\t}\n\n\tgetResult(): HoverPart[] {\n\t\treturn this._result.slice(0);\n\t}\n\n\tgetResultWithLoadingMessage(): HoverPart[] {\n\t\treturn this._result.slice(0).concat([this._getLoadingMessage()]);\n\t}\n\n\tprivate _getLoadingMessage(): HoverPart {\n\t\treturn {\n\t\t\trange: withNullAsUndefined(this._range),\n\t\t\tcontents: [new MarkdownString().appendText(nls.localize('modesContentHover.loading', \"Loading...\"))]\n\t\t};\n\t}\n}\n\nexport class ModesContentHoverWidget extends ContentHoverWidget {\n\n\tstatic readonly ID = 'editor.contrib.modesContentHoverWidget';\n\n\tprivate _messages: HoverPart[];\n\tprivate _lastRange: Range | null;\n\tprivate readonly _computer: ModesContentComputer;\n\tprivate readonly _hoverOperation: HoverOperation<HoverPart[]>;\n\tprivate _highlightDecorations: string[];\n\tprivate _isChangingDecorations: boolean;\n\tprivate _shouldFocus: boolean;\n\tprivate _colorPicker: ColorPickerWidget | null;\n\n\tprivate renderDisposable: IDisposable = Disposable.None;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tmarkerDecorationsService: IMarkerDecorationsService,\n\t\tprivate readonly _themeService: IThemeService,\n\t\tprivate readonly _keybindingService: IKeybindingService,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _bulkEditService: IBulkEditService,\n\t\tprivate readonly _commandService: ICommandService,\n\t\tprivate readonly _modeService: IModeService,\n\t\tprivate readonly _openerService: IOpenerService | null = NullOpenerService,\n\t) {\n\t\tsuper(ModesContentHoverWidget.ID, editor);\n\n\t\tthis._messages = [];\n\t\tthis._lastRange = null;\n\t\tthis._computer = new ModesContentComputer(this._editor, markerDecorationsService);\n\t\tthis._highlightDecorations = [];\n\t\tthis._isChangingDecorations = false;\n\n\t\tthis._hoverOperation = new HoverOperation(\n\t\t\tthis._computer,\n\t\t\tresult => this._withResult(result, true),\n\t\t\tnull,\n\t\t\tresult => this._withResult(result, false),\n\t\t\tthis._editor.getConfiguration().contribInfo.hover.delay\n\t\t);\n\n\t\tthis._register(dom.addStandardDisposableListener(this.getDomNode(), dom.EventType.FOCUS, () => {\n\t\t\tif (this._colorPicker) {\n\t\t\t\tdom.addClass(this.getDomNode(), 'colorpicker-hover');\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this.getDomNode(), dom.EventType.BLUR, () => {\n\t\t\tdom.removeClass(this.getDomNode(), 'colorpicker-hover');\n\t\t}));\n\t\tthis._register(editor.onDidChangeConfiguration((e) => {\n\t\t\tthis._hoverOperation.setHoverTime(this._editor.getConfiguration().contribInfo.hover.delay);\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis.renderDisposable.dispose();\n\t\tthis.renderDisposable = Disposable.None;\n\t\tthis._hoverOperation.cancel();\n\t\tsuper.dispose();\n\t}\n\n\tonModelDecorationsChanged(): void {\n\t\tif (this._isChangingDecorations) {\n\t\t\treturn;\n\t\t}\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._computer.clearResult();\n\n\t\t\tif (!this._colorPicker) { // 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\tstartShowingAt(range: Range, mode: HoverStartMode, focus: boolean): void {\n\t\tif (this._lastRange && this._lastRange.equalsRange(range)) {\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.isVisible) {\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._showAtPosition || this._showAtPosition.lineNumber !== range.startLineNumber) {\n\t\t\t\tthis.hide();\n\t\t\t} else {\n\t\t\t\tlet filteredMessages: HoverPart[] = [];\n\t\t\t\tfor (let i = 0, len = this._messages.length; i < len; i++) {\n\t\t\t\t\tconst msg = this._messages[i];\n\t\t\t\t\tconst rng = msg.range;\n\t\t\t\t\tif (rng && rng.startColumn <= range.startColumn && rng.endColumn >= range.endColumn) {\n\t\t\t\t\t\tfilteredMessages.push(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (filteredMessages.length > 0) {\n\t\t\t\t\tif (hoverContentsEquals(filteredMessages, this._messages)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._renderMessages(range, filteredMessages);\n\t\t\t\t} else {\n\t\t\t\t\tthis.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._lastRange = range;\n\t\tthis._computer.setRange(range);\n\t\tthis._shouldFocus = focus;\n\t\tthis._hoverOperation.start(mode);\n\t}\n\n\thide(): void {\n\t\tthis._lastRange = null;\n\t\tthis._hoverOperation.cancel();\n\t\tsuper.hide();\n\t\tthis._isChangingDecorations = true;\n\t\tthis._highlightDecorations = this._editor.deltaDecorations(this._highlightDecorations, []);\n\t\tthis._isChangingDecorations = false;\n\t\tthis.renderDisposable.dispose();\n\t\tthis.renderDisposable = Disposable.None;\n\t\tthis._colorPicker = null;\n\t}\n\n\tisColorPickerVisible(): boolean {\n\t\tif (this._colorPicker) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _withResult(result: HoverPart[], complete: boolean): void {\n\t\tthis._messages = result;\n\n\t\tif (this._lastRange && this._messages.length > 0) {\n\t\t\tthis._renderMessages(this._lastRange, this._messages);\n\t\t} else if (complete) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(renderRange: Range, messages: HoverPart[]): void {\n\t\tthis.renderDisposable.dispose();\n\t\tthis._colorPicker = null;\n\n\t\t// update column from which to show\n\t\tlet renderColumn = Number.MAX_VALUE;\n\t\tlet highlightRange: Range | null = messages[0].range ? Range.lift(messages[0].range) : null;\n\t\tlet fragment = document.createDocumentFragment();\n\t\tlet isEmptyHoverContent = true;\n\n\t\tlet containColorPicker = false;\n\t\tlet markdownDisposeables: IDisposable[] = [];\n\t\tconst markerMessages: MarkerHover[] = [];\n\t\tmessages.forEach((msg) => {\n\t\t\tif (!msg.range) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trenderColumn = Math.min(renderColumn, msg.range.startColumn);\n\t\t\thighlightRange = highlightRange ? Range.plusRange(highlightRange, msg.range) : Range.lift(msg.range);\n\n\t\t\tif (msg instanceof ColorHover) {\n\t\t\t\tcontainColorPicker = true;\n\n\t\t\t\tconst { red, green, blue, alpha } = msg.color;\n\t\t\t\tconst rgba = new RGBA(red * 255, green * 255, blue * 255, alpha);\n\t\t\t\tconst color = new Color(rgba);\n\n\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst editorModel = this._editor.getModel();\n\t\t\t\tlet range = new Range(msg.range.startLineNumber, msg.range.startColumn, msg.range.endLineNumber, msg.range.endColumn);\n\t\t\t\tlet colorInfo = { range: msg.range, color: msg.color };\n\n\t\t\t\t// create blank olor picker model and widget first to ensure it's positioned correctly.\n\t\t\t\tconst model = new ColorPickerModel(color, [], 0);\n\t\t\t\tconst widget = new ColorPickerWidget(fragment, model, this._editor.getConfiguration().pixelRatio, this._themeService);\n\n\t\t\t\tgetColorPresentations(editorModel, colorInfo, msg.provider, CancellationToken.None).then(colorPresentations => {\n\t\t\t\t\tmodel.colorPresentations = colorPresentations || [];\n\t\t\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\t\t\t// gone...\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst originalText = this._editor.getModel().getValueInRange(msg.range);\n\t\t\t\t\tmodel.guessColorPresentation(color, originalText);\n\n\t\t\t\t\tconst updateEditorModel = () => {\n\t\t\t\t\t\tlet textEdits: IIdentifiedSingleEditOperation[];\n\t\t\t\t\t\tlet newRange: Range;\n\t\t\t\t\t\tif (model.presentation.textEdit) {\n\t\t\t\t\t\t\ttextEdits = [model.presentation.textEdit as IIdentifiedSingleEditOperation];\n\t\t\t\t\t\t\tnewRange = new Range(\n\t\t\t\t\t\t\t\tmodel.presentation.textEdit.range.startLineNumber,\n\t\t\t\t\t\t\t\tmodel.presentation.textEdit.range.startColumn,\n\t\t\t\t\t\t\t\tmodel.presentation.textEdit.range.endLineNumber,\n\t\t\t\t\t\t\t\tmodel.presentation.textEdit.range.endColumn\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tnewRange = newRange.setEndPosition(newRange.endLineNumber, newRange.startColumn + model.presentation.textEdit.text.length);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttextEdits = [{ identifier: null, range, text: model.presentation.label, forceMoveMarkers: false }];\n\t\t\t\t\t\t\tnewRange = range.setEndPosition(range.endLineNumber, range.startColumn + model.presentation.label.length);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\t\t\tthis._editor.executeEdits('colorpicker', textEdits);\n\n\t\t\t\t\t\tif (model.presentation.additionalTextEdits) {\n\t\t\t\t\t\t\ttextEdits = [...model.presentation.additionalTextEdits as IIdentifiedSingleEditOperation[]];\n\t\t\t\t\t\t\tthis._editor.executeEdits('colorpicker', textEdits);\n\t\t\t\t\t\t\tthis.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\t\t\trange = newRange;\n\t\t\t\t\t};\n\n\t\t\t\t\tconst updateColorPresentations = (color: Color) => {\n\t\t\t\t\t\treturn getColorPresentations(editorModel, {\n\t\t\t\t\t\t\trange: range,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\tred: color.rgba.r / 255,\n\t\t\t\t\t\t\t\tgreen: color.rgba.g / 255,\n\t\t\t\t\t\t\t\tblue: color.rgba.b / 255,\n\t\t\t\t\t\t\t\talpha: color.rgba.a\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, msg.provider, CancellationToken.None).then((colorPresentations) => {\n\t\t\t\t\t\t\tmodel.colorPresentations = colorPresentations || [];\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\n\t\t\t\t\tconst colorListener = model.onColorFlushed((color: Color) => {\n\t\t\t\t\t\tupdateColorPresentations(color).then(updateEditorModel);\n\t\t\t\t\t});\n\t\t\t\t\tconst colorChangeListener = model.onDidChangeColor(updateColorPresentations);\n\n\t\t\t\t\tthis._colorPicker = widget;\n\t\t\t\t\tthis.showAt(range.getStartPosition(), range, this._shouldFocus);\n\t\t\t\t\tthis.updateContents(fragment);\n\t\t\t\t\tthis._colorPicker.layout();\n\n\t\t\t\t\tthis.renderDisposable = combinedDisposable([colorListener, colorChangeListener, widget, ...markdownDisposeables]);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (msg instanceof MarkerHover) {\n\t\t\t\t\tmarkerMessages.push(msg);\n\t\t\t\t\tisEmptyHoverContent = false;\n\t\t\t\t} else {\n\t\t\t\t\tmsg.contents\n\t\t\t\t\t\t.filter(contents => !isEmptyMarkdownString(contents))\n\t\t\t\t\t\t.forEach(contents => {\n\t\t\t\t\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\t\t\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\t\t\t\t\tconst renderer = new MarkdownRenderer(this._editor, this._modeService, this._openerService);\n\t\t\t\t\t\t\tmarkdownDisposeables.push(renderer.onDidRenderCodeBlock(() => {\n\t\t\t\t\t\t\t\thoverContentsElement.className = 'hover-contents code-hover-contents';\n\t\t\t\t\t\t\t\tthis.onContentsChange();\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\tconst renderedContents = renderer.render(contents);\n\t\t\t\t\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\t\t\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t\t\t\t\t\tmarkdownDisposeables.push(renderedContents);\n\t\t\t\t\t\t\tisEmptyHoverContent = false;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (markerMessages.length) {\n\t\t\tmarkerMessages.forEach(msg => fragment.appendChild(this.renderMarkerHover(msg)));\n\t\t\tconst markerHoverForStatusbar = markerMessages.length === 1 ? markerMessages[0] : markerMessages.sort((a, b) => MarkerSeverity.compare(a.marker.severity, b.marker.severity))[0];\n\t\t\tfragment.appendChild(this.renderMarkerStatusbar(markerHoverForStatusbar));\n\t\t}\n\n\t\t// show\n\n\t\tif (!containColorPicker && !isEmptyHoverContent) {\n\t\t\tthis.showAt(new Position(renderRange.startLineNumber, renderColumn), highlightRange, this._shouldFocus);\n\t\t\tthis.updateContents(fragment);\n\t\t}\n\n\t\tthis._isChangingDecorations = true;\n\t\tthis._highlightDecorations = this._editor.deltaDecorations(this._highlightDecorations, highlightRange ? [{\n\t\t\trange: highlightRange,\n\t\t\toptions: ModesContentHoverWidget._DECORATION_OPTIONS\n\t\t}] : []);\n\t\tthis._isChangingDecorations = false;\n\t}\n\n\tprivate renderMarkerHover(markerHover: MarkerHover): 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\tconst detailsElement = dom.append(markerElement, $('span'));\n\t\t\tdetailsElement.style.opacity = '0.6';\n\t\t\tdetailsElement.style.paddingLeft = '6px';\n\t\t\tdetailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`;\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\ta.onclick = 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.with({ fragment: `${startLineNumber},${startColumn}` })).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(markerHover: MarkerHover): HTMLElement {\n\t\tconst hoverElement = $('div.hover-row.status-bar');\n\t\tconst disposables: IDisposable[] = [];\n\t\tconst actionsElement = dom.append(hoverElement, $('div.actions'));\n\t\tdisposables.push(this.renderAction(actionsElement, {\n\t\t\tlabel: nls.localize('quick fixes', \"Quick Fix...\"),\n\t\t\tcommandId: QuickFixAction.Id,\n\t\t\trun: async (target) => {\n\t\t\t\tconst codeActionsPromise = this.getCodeActions(markerHover.marker);\n\t\t\t\tdisposables.push(toDisposable(() => codeActionsPromise.cancel()));\n\t\t\t\tconst actions = await codeActionsPromise;\n\t\t\t\tconst elementPosition = dom.getDomNodePagePosition(target);\n\t\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\t\tgetAnchor: () => ({ x: elementPosition.left + 6, y: elementPosition.top + elementPosition.height + 6 }),\n\t\t\t\t\tgetActions: () => actions\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\t\tif (markerHover.marker.severity === MarkerSeverity.Error || markerHover.marker.severity === MarkerSeverity.Warning || markerHover.marker.severity === MarkerSeverity.Info) {\n\t\t\tdisposables.push(this.renderAction(actionsElement, {\n\t\t\t\tlabel: nls.localize('peek problem', \"Peek Problem\"),\n\t\t\t\tcommandId: NextMarkerAction.ID,\n\t\t\t\trun: () => {\n\t\t\t\t\tthis.hide();\n\t\t\t\t\tMarkerController.get(this._editor).show(markerHover.marker);\n\t\t\t\t\tthis._editor.focus();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\tthis.renderDisposable = combinedDisposable(disposables);\n\t\treturn hoverElement;\n\t}\n\n\tprivate getCodeActions(marker: IMarker): CancelablePromise<Action[]> {\n\t\treturn createCancelablePromise(async cancellationToken => {\n\t\t\tconst codeActions = await getCodeActions(this._editor.getModel()!, new Range(marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn), { type: 'manual', filter: { kind: CodeActionKind.QuickFix } }, cancellationToken);\n\t\t\tif (codeActions.actions.length) {\n\t\t\t\treturn codeActions.actions.map(codeAction => new Action(\n\t\t\t\t\tcodeAction.command ? codeAction.command.id : codeAction.title,\n\t\t\t\t\tcodeAction.title,\n\t\t\t\t\tundefined,\n\t\t\t\t\ttrue,\n\t\t\t\t\t() => applyCodeAction(codeAction, this._bulkEditService, this._commandService)));\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tnew Action('', nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"))\n\t\t\t];\n\t\t});\n\t}\n\n\tprivate renderAction(parent: HTMLElement, actionOptions: { label: string, iconClass?: string, run: (target: HTMLElement) => void, commandId: string }): IDisposable {\n\t\tconst actionContainer = dom.append(parent, $('div.action-container'));\n\t\tconst action = dom.append(actionContainer, $('a.action'));\n\t\tif (actionOptions.iconClass) {\n\t\t\tdom.append(action, $(`span.icon.${actionOptions.iconClass}`));\n\t\t}\n\t\tconst label = dom.append(action, $('span'));\n\t\tlabel.textContent = actionOptions.label;\n\t\tconst keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId);\n\t\tif (keybinding) {\n\t\t\tlabel.title = `${actionOptions.label} (${keybinding.getLabel()})`;\n\t\t}\n\t\treturn dom.addDisposableListener(actionContainer, dom.EventType.CLICK, e => {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t\tactionOptions.run(actionContainer);\n\t\t});\n\t}\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tclassName: 'hoverHighlight'\n\t});\n}\n\nfunction hoverContentsEquals(first: HoverPart[], second: HoverPart[]): boolean {\n\tif ((!first && second) || (first && !second) || first.length !== second.length) {\n\t\treturn false;\n\t}\n\tfor (let i = 0; i < first.length; i++) {\n\t\tconst firstElement = first[i];\n\t\tconst secondElement = second[i];\n\t\tif (firstElement instanceof MarkerHover && secondElement instanceof MarkerHover) {\n\t\t\treturn IMarkerData.makeKey(firstElement.marker) === IMarkerData.makeKey(secondElement.marker);\n\t\t}\n\t\tif (firstElement instanceof ColorHover || secondElement instanceof ColorHover) {\n\t\t\treturn false;\n\t\t}\n\t\tif (firstElement instanceof MarkerHover || secondElement instanceof MarkerHover) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!markedStringsEquals(firstElement.contents, secondElement.contents)) {\n\t\t\treturn false;\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 'vs/css!./hover';\nimport * as nls from 'vs/nls';\nimport { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { IEmptyContentData } from 'vs/editor/browser/controller/mouseTarget';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { IConfigurationChangedEvent } 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 { IModeService } from 'vs/editor/common/services/modeService';\nimport { HoverStartMode } from 'vs/editor/contrib/hover/hoverOperation';\nimport { ModesContentHoverWidget } from 'vs/editor/contrib/hover/modesContentHover';\nimport { ModesGlyphHoverWidget } from 'vs/editor/contrib/hover/modesGlyphHover';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { editorHoverBackground, editorHoverBorder, editorHoverHighlight, textCodeBlockBackground, textLinkForeground, editorHoverStatusBarBackground } from 'vs/platform/theme/common/colorRegistry';\nimport { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IContextMenuService } from 'vs/platform/contextview/browser/contextView';\nimport { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';\n\nexport class ModesHoverController implements IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.hover';\n\n\tprivate _toUnhook: IDisposable[];\n\tprivate readonly _didChangeConfigurationHandler: IDisposable;\n\n\tprivate _contentWidget: ModesContentHoverWidget;\n\tprivate _glyphWidget: ModesGlyphHoverWidget;\n\n\tget contentWidget(): ModesContentHoverWidget {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._createHoverWidget();\n\t\t}\n\t\treturn this._contentWidget;\n\t}\n\n\tget glyphWidget(): ModesGlyphHoverWidget {\n\t\tif (!this._glyphWidget) {\n\t\t\tthis._createHoverWidget();\n\t\t}\n\t\treturn this._glyphWidget;\n\t}\n\n\tprivate _isMouseDown: boolean;\n\tprivate _hoverClicked: boolean;\n\tprivate _isHoverEnabled: boolean;\n\tprivate _isHoverSticky: boolean;\n\n\tstatic get(editor: ICodeEditor): ModesHoverController {\n\t\treturn editor.getContribution<ModesHoverController>(ModesHoverController.ID);\n\t}\n\n\tconstructor(private readonly _editor: ICodeEditor,\n\t\t@IOpenerService private readonly _openerService: IOpenerService,\n\t\t@IModeService private readonly _modeService: IModeService,\n\t\t@IMarkerDecorationsService private readonly _markerDecorationsService: IMarkerDecorationsService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IBulkEditService private readonly _bulkEditService: IBulkEditService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@IThemeService private readonly _themeService: IThemeService\n\t) {\n\t\tthis._toUnhook = [];\n\n\t\tthis._isMouseDown = false;\n\t\tthis._hoverClicked = false;\n\n\t\tthis._hookEvents();\n\n\t\tthis._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => {\n\t\t\tif (e.contribInfo) {\n\t\t\t\tthis._hideWidgets();\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.getConfiguration().contribInfo.hover;\n\t\tthis._isHoverEnabled = hoverOpts.enabled;\n\t\tthis._isHoverSticky = hoverOpts.sticky;\n\t\tif (this._isHoverEnabled) {\n\t\t\tthis._toUnhook.push(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\t\tthis._toUnhook.push(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));\n\t\t\tthis._toUnhook.push(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\t\tthis._toUnhook.push(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\t\tthis._toUnhook.push(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\t} else {\n\t\t\tthis._toUnhook.push(this._editor.onMouseMove(hideWidgetsEventHandler));\n\t\t}\n\n\t\tthis._toUnhook.push(this._editor.onMouseLeave(hideWidgetsEventHandler));\n\t\tthis._toUnhook.push(this._editor.onDidChangeModel(hideWidgetsEventHandler));\n\t\tthis._toUnhook.push(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));\n\t}\n\n\tprivate _unhookEvents(): void {\n\t\tthis._toUnhook = dispose(this._toUnhook);\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tthis.contentWidget.onModelDecorationsChanged();\n\t\tthis.glyphWidget.onModelDecorationsChanged();\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 targetType = mouseEvent.target.type;\n\n\t\tif (targetType === MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === ModesContentHoverWidget.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 (targetType === MouseTargetType.OVERLAY_WIDGET && mouseEvent.target.detail === ModesGlyphHoverWidget.ID) {\n\t\t\t// mouse down on top of overlay hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (targetType !== MouseTargetType.OVERLAY_WIDGET && mouseEvent.target.detail !== ModesGlyphHoverWidget.ID) {\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\t// const this._editor.getConfiguration().contribInfo.hover.sticky;\n\t\tlet targetType = mouseEvent.target.type;\n\n\t\tif (this._isMouseDown && this._hoverClicked && this.contentWidget.isColorPickerVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isHoverSticky && targetType === MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === ModesContentHoverWidget.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 && targetType === MouseTargetType.OVERLAY_WIDGET && mouseEvent.target.detail === ModesGlyphHoverWidget.ID) {\n\t\t\t// mouse moved on top of overlay hover widget\n\t\t\treturn;\n\t\t}\n\n\t\tif (targetType === MouseTargetType.CONTENT_EMPTY) {\n\t\t\tconst epsilon = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth / 2;\n\t\t\tconst data = <IEmptyContentData>mouseEvent.target.detail;\n\t\t\tif (data && !data.isAfterLines && typeof data.horizontalDistanceToText === 'number' && data.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\ttargetType = MouseTargetType.CONTENT_TEXT;\n\t\t\t}\n\t\t}\n\n\t\tif (targetType === MouseTargetType.CONTENT_TEXT) {\n\t\t\tthis.glyphWidget.hide();\n\n\t\t\tif (this._isHoverEnabled && mouseEvent.target.range) {\n\t\t\t\tthis.contentWidget.startShowingAt(mouseEvent.target.range, HoverStartMode.Delayed, false);\n\t\t\t}\n\t\t} else if (targetType === MouseTargetType.GUTTER_GLYPH_MARGIN) {\n\t\t\tthis.contentWidget.hide();\n\n\t\t\tif (this._isHoverEnabled && mouseEvent.target.position) {\n\t\t\t\tthis.glyphWidget.startShowingAt(mouseEvent.target.position.lineNumber);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._hideWidgets();\n\t\t}\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._contentWidget || (this._isMouseDown && this._hoverClicked && this._contentWidget.isColorPickerVisible())) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._glyphWidget.hide();\n\t\tthis._contentWidget.hide();\n\t}\n\n\tprivate _createHoverWidget() {\n\t\tthis._contentWidget = new ModesContentHoverWidget(this._editor, this._markerDecorationsService, this._themeService, this._keybindingService, this._contextMenuService, this._bulkEditService, this._commandService, this._modeService, this._openerService);\n\t\tthis._glyphWidget = new ModesGlyphHoverWidget(this._editor, this._modeService, this._openerService);\n\t}\n\n\tpublic showContentHover(range: Range, mode: HoverStartMode, focus: boolean): void {\n\t\tthis.contentWidget.startShowingAt(range, mode, focus);\n\t}\n\n\tpublic getId(): string {\n\t\treturn ModesHoverController.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._unhookEvents();\n\t\tthis._didChangeConfigurationHandler.dispose();\n\n\t\tif (this._glyphWidget) {\n\t\t\tthis._glyphWidget.dispose();\n\t\t}\n\t\tif (this._contentWidget) {\n\t\t\tthis._contentWidget.dispose();\n\t\t}\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: null,\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I),\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.getConfiguration().accessibilitySupport === AccessibilitySupport.Enabled;\n\t\tcontroller.showContentHover(range, HoverStartMode.Immediate, focus);\n\t}\n}\n\nregisterEditorContribution(ModesHoverController);\nregisterEditorAction(ShowHoverAction);\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-editor-hover { background-color: ${hoverBackground}; }`);\n\t}\n\tconst hoverBorder = theme.getColor(editorHoverBorder);\n\tif (hoverBorder) {\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-hover { border: 1px solid ${hoverBorder}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`);\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-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-editor-hover a { color: ${link}; }`);\n\t}\n\tconst actionsBackground = theme.getColor(editorHoverStatusBarBackground);\n\tif (actionsBackground) {\n\t\tcollector.addRule(`.monaco-editor .monaco-editor-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-editor-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 * as nls from 'vs/nls';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ReferencesModel } from './referencesModel';\nimport { ReferenceWidget, LayoutData } from './referencesWidget';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Location } from 'vs/editor/common/modes';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { CancelablePromise } from 'vs/base/common/async';\n\nexport const ctxReferenceSearchVisible = new RawContextKey<boolean>('referenceSearchVisible', false);\n\nexport interface RequestOptions {\n\tgetMetaTitle(model: ReferencesModel): string;\n\tonGoto?: (reference: Location) => Promise<any>;\n}\n\nexport abstract class ReferencesController implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.referencesController';\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate _widget: ReferenceWidget | null;\n\tprivate _model: ReferencesModel | null;\n\tprivate _requestIdPool = 0;\n\tprivate _disposables: IDisposable[] = [];\n\tprivate _ignoreModelChangeEvent = false;\n\n\tprivate readonly _referenceSearchVisible: IContextKey<boolean>;\n\n\tpublic static get(editor: ICodeEditor): ReferencesController {\n\t\treturn editor.getContribution<ReferencesController>(ReferencesController.ID);\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly _defaultTreeKeyboardSupport: boolean,\n\t\teditor: 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\t\tthis._editor = editor;\n\t\tthis._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(contextKeyService);\n\t}\n\n\tpublic getId(): string {\n\t\treturn ReferencesController.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._referenceSearchVisible.reset();\n\t\tdispose(this._disposables);\n\t\tif (this._widget) {\n\t\t\tdispose(this._widget);\n\t\t\tthis._widget = null;\n\t\t}\n\t\tif (this._model) {\n\t\t\tdispose(this._model);\n\t\t\tthis._model = null;\n\t\t}\n\t}\n\n\tpublic toggleWidget(range: Range, modelPromise: CancelablePromise<ReferencesModel>, options: RequestOptions): 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._referenceSearchVisible.set(true);\n\n\t\t// close the widget on model/mode changes\n\t\tthis._disposables.push(this._editor.onDidChangeModelLanguage(() => { this.closeWidget(); }));\n\t\tthis._disposables.push(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.push(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);\n\t\t\t\tthis._widget = null;\n\t\t\t}\n\t\t\tthis.closeWidget();\n\t\t}));\n\n\t\tthis._disposables.push(this._widget.onDidSelectReference(event => {\n\t\t\tlet { element, kind } = event;\n\t\t\tswitch (kind) {\n\t\t\t\tcase 'open':\n\t\t\t\t\tif (event.source === 'editor'\n\t\t\t\t\t\t&& this._configurationService.getValue('editor.stablePeek')) {\n\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\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'side':\n\t\t\t\t\tif (element) {\n\t\t\t\t\t\tthis.openReference(element, kind === 'side');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'goto':\n\t\t\t\t\tif (element) {\n\t\t\t\t\t\tif (options.onGoto) {\n\t\t\t\t\t\t\toptions.onGoto(element);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._gotoReference(element);\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\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\treturn undefined;\n\t\t\t}\n\n\t\t\tif (this._model) {\n\t\t\t\tthis._model.dispose();\n\t\t\t}\n\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\t\t\t\t\t// set title\n\t\t\t\t\tthis._widget.setMetaTitle(options.getMetaTitle(this._model));\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);\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\tpublic async 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\tawait this._widget.setSelection(target);\n\t\tawait this._gotoReference(target);\n\t\tif (editorFocus) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tpublic closeWidget(): void {\n\t\tif (this._widget) {\n\t\t\tdispose(this._widget);\n\t\t\tthis._widget = null;\n\t\t}\n\t\tthis._referenceSearchVisible.reset();\n\t\tthis._disposables = dispose(this._disposables);\n\t\tif (this._model) {\n\t\t\tdispose(this._model);\n\t\t\tthis._model = null;\n\t\t}\n\t\tthis._editor.focus();\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 }\n\t\t}, this._editor).then(openedEditor => {\n\t\t\tthis._ignoreModelChangeEvent = false;\n\n\t\t\tif (!openedEditor || openedEditor !== this._editor) {\n\t\t\t\t// TODO@Alex TODO@Joh\n\t\t\t\t// when opening the current reference we might end up\n\t\t\t\t// in a different editor instance. that means we also have\n\t\t\t\t// a different instance of this reference search controller\n\t\t\t\t// and cannot hold onto the widget (which likely doesn't\n\t\t\t\t// exist). Instead of bailing out we should find the\n\t\t\t\t// 'sister' action and pass our current model on to it.\n\t\t\t\tthis.closeWidget();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this._widget) {\n\t\t\t\tthis._widget.show(range);\n\t\t\t\tthis._widget.focus();\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\tpublic openReference(ref: Location, sideBySide: 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 }\n\t\t}, this._editor, sideBySide);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { createCancelablePromise } from 'vs/base/common/async';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport * as platform from 'vs/base/common/platform';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport * as corePosition from 'vs/editor/common/core/position';\nimport { Range, IRange } from 'vs/editor/common/core/range';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { ITextModel, IWordAtPosition } from 'vs/editor/common/model';\nimport { LocationLink, Location, isLocationLink } from 'vs/editor/common/modes';\nimport { MessageController } from 'vs/editor/contrib/message/messageController';\nimport { PeekContext } from 'vs/editor/contrib/referenceSearch/peekViewWidget';\nimport { ReferencesController } from 'vs/editor/contrib/referenceSearch/referencesController';\nimport { ReferencesModel } from 'vs/editor/contrib/referenceSearch/referencesModel';\nimport * as nls from 'vs/nls';\nimport { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';\nimport { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IProgressService } from 'vs/platform/progress/common/progress';\nimport { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition, getDeclarationsAtPosition } from './goToDefinition';\nimport { CommandsRegistry } from 'vs/platform/commands/common/commands';\nimport { EditorStateCancellationTokenSource, CodeEditorStateFlag } from 'vs/editor/browser/core/editorState';\n\nexport class DefinitionActionConfig {\n\n\tconstructor(\n\t\tpublic readonly openToSide = false,\n\t\tpublic readonly openInPeek = false,\n\t\tpublic readonly filterCurrent = true,\n\t\tpublic readonly showMessage = true,\n\t) {\n\t\t//\n\t}\n}\n\nexport class DefinitionAction extends EditorAction {\n\n\tprivate readonly _configuration: DefinitionActionConfig;\n\n\tconstructor(configuration: DefinitionActionConfig, opts: IActionOptions) {\n\t\tsuper(opts);\n\t\tthis._configuration = configuration;\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor): 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(IProgressService);\n\n\t\tconst model = editor.getModel();\n\t\tconst pos = editor.getPosition();\n\n\t\tconst cts = new EditorStateCancellationTokenSource(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position);\n\n\t\tconst definitionPromise = this._getTargetLocationForPosition(model, pos, cts.token).then(async references => {\n\n\t\t\tif (cts.token.isCancellationRequested || model.isDisposed() || editor.getModel() !== model) {\n\t\t\t\t// new model, no more model\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// * remove falsy references\n\t\t\t// * find reference at the current pos\n\t\t\tlet idxOfCurrent = -1;\n\t\t\tconst result: LocationLink[] = [];\n\t\t\tfor (const reference of references) {\n\t\t\t\tif (!reference || !reference.range) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst newLen = result.push(reference);\n\t\t\t\tif (this._configuration.filterCurrent\n\t\t\t\t\t&& reference.uri.toString() === model.uri.toString()\n\t\t\t\t\t&& Range.containsPosition(reference.range, pos)\n\t\t\t\t\t&& idxOfCurrent === -1\n\t\t\t\t) {\n\t\t\t\t\tidxOfCurrent = newLen - 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (result.length === 0) {\n\t\t\t\t// no result -> show message\n\t\t\t\tif (this._configuration.showMessage) {\n\t\t\t\t\tconst info = model.getWordAtPosition(pos);\n\t\t\t\t\tMessageController.get(editor).showMessage(this._getNoResultFoundMessage(info), pos);\n\t\t\t\t}\n\t\t\t} else if (result.length === 1 && idxOfCurrent !== -1) {\n\t\t\t\t// only the position at which we are -> adjust selection\n\t\t\t\tlet [current] = result;\n\t\t\t\treturn this._openReference(editor, editorService, current, false).then(() => undefined);\n\n\t\t\t} else {\n\t\t\t\t// handle multile results\n\t\t\t\treturn this._onResult(editorService, editor, new ReferencesModel(result));\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(definitionPromise, 250);\n\t\treturn definitionPromise;\n\t}\n\n\tprotected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {\n\t\treturn getDefinitionsAtPosition(model, position, token);\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 _getMetaTitle(model: ReferencesModel): string {\n\t\treturn model.references.length > 1 ? nls.localize('meta.title', \" – {0} definitions\", model.references.length) : '';\n\t}\n\n\tprivate async _onResult(editorService: ICodeEditorService, editor: ICodeEditor, model: ReferencesModel): Promise<void> {\n\n\t\tconst msg = model.getAriaMessage();\n\t\talert(msg);\n\n\t\tconst { gotoLocation } = editor.getConfiguration().contribInfo;\n\t\tif (this._configuration.openInPeek || (gotoLocation.multiple === 'peek' && model.references.length > 1)) {\n\t\t\tthis._openInPeek(editorService, editor, model);\n\n\t\t} else if (editor.hasModel()) {\n\t\t\tconst next = model.firstReference();\n\t\t\tif (!next) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst targetEditor = await this._openReference(editor, editorService, next, this._configuration.openToSide);\n\t\t\tif (targetEditor && model.references.length > 1 && gotoLocation.multiple === 'gotoAndPeek') {\n\t\t\t\tthis._openInPeek(editorService, targetEditor, model);\n\t\t\t} else {\n\t\t\t\tmodel.dispose();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean): Promise<ICodeEditor | null> {\n\t\t// range is the target-selection-range when we have one\n\t\t// and the 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\n\t\treturn editorService.openCodeEditor({\n\t\t\tresource: reference.uri,\n\t\t\toptions: {\n\t\t\t\tselection: Range.collapseToStart(range),\n\t\t\t\trevealIfOpened: true,\n\t\t\t\trevealInCenterIfOutsideViewport: true\n\t\t\t}\n\t\t}, editor, sideBySide);\n\t}\n\n\tprivate _openInPeek(editorService: ICodeEditorService, target: ICodeEditor, model: ReferencesModel) {\n\t\tlet controller = ReferencesController.get(target);\n\t\tif (controller && target.hasModel()) {\n\t\t\tcontroller.toggleWidget(target.getSelection(), createCancelablePromise(_ => Promise.resolve(model)), {\n\t\t\t\tgetMetaTitle: (model) => {\n\t\t\t\t\treturn this._getMetaTitle(model);\n\t\t\t\t},\n\t\t\t\tonGoto: (reference) => {\n\t\t\t\t\tcontroller.closeWidget();\n\t\t\t\t\treturn this._openReference(target, editorService, reference, false);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tmodel.dispose();\n\t\t}\n\t}\n}\n\nconst goToDefinitionKb = platform.isWeb\n\t? KeyMod.CtrlCmd | KeyCode.F12\n\t: KeyCode.F12;\n\nexport class GoToDefinitionAction extends DefinitionAction {\n\n\tstatic readonly id = 'editor.action.revealDefinition';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(), {\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.isInEmbeddedEditor.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\tmenuOpts: {\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\nexport class OpenDefinitionToSideAction extends DefinitionAction {\n\n\tstatic readonly id = 'editor.action.revealDefinitionAside';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(true), {\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.isInEmbeddedEditor.toNegated()),\n\t\t\tkbOpts: {\n\t\t\t\tkbExpr: EditorContextKeys.editorTextFocus,\n\t\t\t\tprimary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, 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\nexport class PeekDefinitionAction extends DefinitionAction {\n\n\tstatic readonly id = 'editor.action.peekDefinition';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(undefined, true, false), {\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.isInEmbeddedEditor.toNegated()),\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\tmenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.2\n\t\t\t}\n\t\t});\n\t\tCommandsRegistry.registerCommandAlias('editor.action.previewDeclaration', PeekDefinitionAction.id);\n\t}\n}\n\nexport class DeclarationAction extends DefinitionAction {\n\n\tprotected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {\n\t\treturn getDeclarationsAtPosition(model, position, token);\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 _getMetaTitle(model: ReferencesModel): string {\n\t\treturn model.references.length > 1 ? nls.localize('decl.meta.title', \" – {0} declarations\", model.references.length) : '';\n\t}\n}\n\nexport class GoToDeclarationAction extends DeclarationAction {\n\n\tstatic readonly id = 'editor.action.revealDeclaration';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(), {\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.isInEmbeddedEditor.toNegated()),\n\t\t\tmenuOpts: {\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 _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 _getMetaTitle(model: ReferencesModel): string {\n\t\treturn model.references.length > 1 ? nls.localize('decl.meta.title', \" – {0} declarations\", model.references.length) : '';\n\t}\n}\n\nexport class PeekDeclarationAction extends DeclarationAction {\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(undefined, true, false), {\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.isInEmbeddedEditor.toNegated()),\n\t\t\tmenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.31\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class ImplementationAction extends DefinitionAction {\n\tprotected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {\n\t\treturn getImplementationsAtPosition(model, position, token);\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 _getMetaTitle(model: ReferencesModel): string {\n\t\treturn model.references.length > 1 ? nls.localize('meta.implementations.title', \" – {0} implementations\", model.references.length) : '';\n\t}\n}\n\nexport class GoToImplementationAction extends ImplementationAction {\n\n\tpublic static readonly ID = 'editor.action.goToImplementation';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(), {\n\t\t\tid: GoToImplementationAction.ID,\n\t\t\tlabel: nls.localize('actions.goToImplementation.label', \"Go to Implementation\"),\n\t\t\talias: 'Go to Implementation',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasImplementationProvider,\n\t\t\t\tEditorContextKeys.isInEmbeddedEditor.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});\n\t}\n}\n\nexport class PeekImplementationAction extends ImplementationAction {\n\n\tpublic static readonly ID = 'editor.action.peekImplementation';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(false, true, false), {\n\t\t\tid: PeekImplementationAction.ID,\n\t\t\tlabel: nls.localize('actions.peekImplementation.label', \"Peek Implementation\"),\n\t\t\talias: 'Peek Implementation',\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasImplementationProvider,\n\t\t\t\tEditorContextKeys.isInEmbeddedEditor.toNegated()),\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});\n\t}\n}\n\nexport class TypeDefinitionAction extends DefinitionAction {\n\tprotected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {\n\t\treturn getTypeDefinitionsAtPosition(model, position, token);\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 _getMetaTitle(model: ReferencesModel): string {\n\t\treturn model.references.length > 1 ? nls.localize('meta.typeDefinitions.title', \" – {0} type definitions\", model.references.length) : '';\n\t}\n}\n\nexport class GoToTypeDefinitionAction extends TypeDefinitionAction {\n\n\tpublic static readonly ID = 'editor.action.goToTypeDefinition';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(), {\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.isInEmbeddedEditor.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\tmenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.4\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport class PeekTypeDefinitionAction extends TypeDefinitionAction {\n\n\tpublic static readonly ID = 'editor.action.peekTypeDefinition';\n\n\tconstructor() {\n\t\tsuper(new DefinitionActionConfig(false, true, false), {\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\tEditorContextKeys.isInEmbeddedEditor.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\nregisterEditorAction(GoToDefinitionAction);\nregisterEditorAction(OpenDefinitionToSideAction);\nregisterEditorAction(PeekDefinitionAction);\nregisterEditorAction(GoToDeclarationAction);\nregisterEditorAction(PeekDeclarationAction);\nregisterEditorAction(GoToImplementationAction);\nregisterEditorAction(PeekImplementationAction);\nregisterEditorAction(GoToTypeDefinitionAction);\nregisterEditorAction(PeekTypeDefinitionAction);\n\n// Go to menu\nMenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {\n\tgroup: '4_symbol_nav',\n\tcommand: {\n\t\tid: 'editor.action.goToDeclaration',\n\t\ttitle: nls.localize({ key: 'miGotoDefinition', comment: ['&& denotes a mnemonic'] }, \"Go to &&Definition\")\n\t},\n\torder: 2\n});\n\nMenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {\n\tgroup: '4_symbol_nav',\n\tcommand: {\n\t\tid: 'editor.action.goToTypeDefinition',\n\t\ttitle: nls.localize({ key: 'miGotoTypeDefinition', comment: ['&& denotes a mnemonic'] }, \"Go to &&Type Definition\")\n\t},\n\torder: 3\n});\n\nMenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {\n\tgroup: '4_symbol_nav',\n\tcommand: {\n\t\tid: 'editor.action.goToImplementation',\n\t\ttitle: nls.localize({ key: 'miGotoImplementation', comment: ['&& denotes a mnemonic'] }, \"Go to &&Implementation\")\n\t},\n\torder: 4\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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!./goToDefinitionMouse';\nimport * as nls from 'vs/nls';\nimport { createCancelablePromise, CancelablePromise } 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 { IModeService } from 'vs/editor/common/services/modeService';\nimport { Range } from 'vs/editor/common/core/range';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { DefinitionProviderRegistry, LocationLink } from 'vs/editor/common/modes';\nimport { ICodeEditor, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser';\nimport { registerEditorContribution } from 'vs/editor/browser/editorExtensions';\nimport { getDefinitionsAtPosition } from './goToDefinition';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry';\nimport { EditorState, CodeEditorStateFlag } from 'vs/editor/browser/core/editorState';\nimport { DefinitionAction, DefinitionActionConfig } from './goToDefinitionCommands';\nimport { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'vs/editor/contrib/goToDefinition/clickLinkGesture';\nimport { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } from 'vs/editor/common/model';\nimport { Position } from 'vs/editor/common/core/position';\nimport { withNullAsUndefined } from 'vs/base/common/types';\n\nclass GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution {\n\n\tprivate static readonly ID = 'editor.contrib.gotodefinitionwithmouse';\n\tstatic MAX_SOURCE_PREVIEW_LINES = 8;\n\n\tprivate readonly editor: ICodeEditor;\n\tprivate toUnhook: IDisposable[];\n\tprivate decorations: string[];\n\tprivate currentWordUnderMouse: IWordAtPosition | null;\n\tprivate previousPromise: CancelablePromise<LocationLink[] | null> | null;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@ITextModelService private readonly textModelResolverService: ITextModelService,\n\t\t@IModeService private readonly modeService: IModeService\n\t) {\n\t\tthis.toUnhook = [];\n\t\tthis.decorations = [];\n\t\tthis.editor = editor;\n\t\tthis.previousPromise = null;\n\n\t\tlet linkGesture = new ClickLinkGesture(editor);\n\t\tthis.toUnhook.push(linkGesture);\n\n\t\tthis.toUnhook.push(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => {\n\t\t\tthis.startFindDefinition(mouseEvent, withNullAsUndefined(keyboardEvent));\n\t\t}));\n\n\t\tthis.toUnhook.push(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => {\n\t\t\tif (this.isEnabled(mouseEvent)) {\n\t\t\t\tthis.gotoDefinition(mouseEvent.target, mouseEvent.hasSideBySideModifier).then(() => {\n\t\t\t\t\tthis.removeDecorations();\n\t\t\t\t}, (error: Error) => {\n\t\t\t\t\tthis.removeDecorations();\n\t\t\t\t\tonUnexpectedError(error);\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis.toUnhook.push(linkGesture.onCancel(() => {\n\t\t\tthis.removeDecorations();\n\t\t\tthis.currentWordUnderMouse = null;\n\t\t}));\n\n\t}\n\n\tprivate startFindDefinition(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.decorations.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) {\n\t\t\tthis.currentWordUnderMouse = null;\n\t\t\tthis.removeDecorations();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find word at mouse position\n\t\tconst word = mouseEvent.target.position ? this.editor.getModel().getWordAtPosition(mouseEvent.target.position) : null;\n\t\tif (!word) {\n\t\t\tthis.currentWordUnderMouse = null;\n\t\t\tthis.removeDecorations();\n\t\t\treturn;\n\t\t}\n\t\tconst position = mouseEvent.target.position!;\n\n\t\t// Return early if word at position is still the same\n\t\tif (this.currentWordUnderMouse && this.currentWordUnderMouse.startColumn === word.startColumn && this.currentWordUnderMouse.endColumn === word.endColumn && this.currentWordUnderMouse.word === word.word) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.currentWordUnderMouse = 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(mouseEvent.target, token));\n\n\t\tthis.previousPromise.then(results => {\n\t\t\tif (!results || !results.length || !state.validate(this.editor)) {\n\t\t\t\tthis.removeDecorations();\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);\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 modeId = this.modeService.getModeIdByFilepathOrFirstLine(textEditorModel.uri.fsPath);\n\t\t\t\t\tthis.addDecoration(\n\t\t\t\t\t\twordRange,\n\t\t\t\t\t\tnew MarkdownString().appendCodeblock(modeId ? modeId : '', 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) {\n\t\tlet rangeToUse = this.getPreviewRangeBasedOnBrackets(textEditorModel, startLineNumber);\n\t\tconst numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber;\n\t\tif (numberOfLinesInRange >= GotoDefinitionWithMouseEditorContribution.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: Range) {\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 + GotoDefinitionWithMouseEditorContribution.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 + GotoDefinitionWithMouseEditorContribution.MAX_SOURCE_PREVIEW_LINES);\n\n\t\tconst brackets: IFoundBracket[] = [];\n\n\t\tlet ignoreFirstEmpty = true;\n\t\tlet currentBracket = textEditorModel.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 === currentBracket.open && 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.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\tinlineClassName: 'goto-definition-link',\n\t\t\t\thoverMessage\n\t\t\t}\n\t\t};\n\n\t\tthis.decorations = this.editor.deltaDecorations(this.decorations, [newDecorations]);\n\t}\n\n\tprivate removeDecorations(): void {\n\t\tif (this.decorations.length > 0) {\n\t\t\tthis.decorations = this.editor.deltaDecorations(this.decorations, []);\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\tDefinitionProviderRegistry.has(this.editor.getModel());\n\t}\n\n\tprivate findDefinition(target: IMouseTarget, 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(model, target.position!, token);\n\t}\n\n\tprivate gotoDefinition(target: IMouseTarget, sideBySide: boolean): Promise<any> {\n\t\tthis.editor.setPosition(target.position!);\n\t\tconst action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: '', label: '', id: '', precondition: null });\n\t\treturn this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor));\n\t}\n\n\tpublic getId(): string {\n\t\treturn GotoDefinitionWithMouseEditorContribution.ID;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.toUnhook = dispose(this.toUnhook);\n\t}\n}\n\nregisterEditorContribution(GotoDefinitionWithMouseEditorContribution);\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 nls from 'vs/nls';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { Position, IPosition } from 'vs/editor/common/core/position';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { registerEditorAction, ServicesAccessor, EditorAction, registerEditorContribution, registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions';\nimport { Location, ReferenceProviderRegistry } from 'vs/editor/common/modes';\nimport { Range } from 'vs/editor/common/core/range';\nimport { PeekContext, getOuterEditor } from './peekViewWidget';\nimport { ReferencesController, RequestOptions, ctxReferenceSearchVisible } from './referencesController';\nimport { ReferencesModel, OneReference } from './referencesModel';\nimport { createCancelablePromise } from 'vs/base/common/async';\nimport { onUnexpectedExternalError } from 'vs/base/common/errors';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget';\nimport { ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IListService } from 'vs/platform/list/browser/listService';\nimport { ctxReferenceWidgetSearchTreeFocused } from 'vs/editor/contrib/referenceSearch/referencesWidget';\nimport { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { CancellationToken } from 'vs/base/common/cancellation';\n\nexport const defaultReferenceSearchOptions: RequestOptions = {\n\tgetMetaTitle(model) {\n\t\treturn model.references.length > 1 ? nls.localize('meta.titleReference', \" – {0} references\", model.references.length) : '';\n\t}\n};\n\nexport class ReferenceController implements editorCommon.IEditorContribution {\n\n\tprivate static 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\tpublic dispose(): void {\n\t}\n\n\tpublic getId(): string {\n\t\treturn ReferenceController.ID;\n\t}\n}\n\nexport class ReferenceAction extends EditorAction {\n\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: 'editor.action.referenceSearch.trigger',\n\t\t\tlabel: nls.localize('references.action.label', \"Peek References\"),\n\t\t\talias: 'Find All References', // leave the alias?\n\t\t\tprecondition: ContextKeyExpr.and(\n\t\t\t\tEditorContextKeys.hasReferenceProvider,\n\t\t\t\tPeekContext.notInPeekEditor,\n\t\t\t\tEditorContextKeys.isInEmbeddedEditor.toNegated()),\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\tmenuOpts: {\n\t\t\t\tgroup: 'navigation',\n\t\t\t\torder: 1.5\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic run(_accessor: ServicesAccessor, editor: ICodeEditor): void {\n\t\tlet controller = ReferencesController.get(editor);\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\t\tif (editor.hasModel()) {\n\t\t\tconst range = editor.getSelection();\n\t\t\tconst model = editor.getModel();\n\t\t\tconst references = createCancelablePromise(token => provideReferences(model, range.getStartPosition(), token).then(references => new ReferencesModel(references)));\n\t\t\tcontroller.toggleWidget(range, references, defaultReferenceSearchOptions);\n\t\t}\n\t}\n}\n\nregisterEditorContribution(ReferenceController);\n\nregisterEditorAction(ReferenceAction);\n\nlet findReferencesCommand: ICommandHandler = (accessor: ServicesAccessor, resource: URI, position: IPosition) => {\n\tif (!(resource instanceof URI)) {\n\t\tthrow new Error('illegal argument, uri');\n\t}\n\tif (!position) {\n\t\tthrow new Error('illegal argument, position');\n\t}\n\n\tconst codeEditorService = accessor.get(ICodeEditorService);\n\treturn codeEditorService.openCodeEditor({ resource }, codeEditorService.getFocusedCodeEditor()).then(control => {\n\t\tif (!isCodeEditor(control) || !control.hasModel()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet controller = ReferencesController.get(control);\n\t\tif (!controller) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet references = createCancelablePromise(token => provideReferences(control.getModel(), Position.lift(position), token).then(references => new ReferencesModel(references)));\n\t\tlet range = new Range(position.lineNumber, position.column, position.lineNumber, position.column);\n\t\treturn Promise.resolve(controller.toggleWidget(range, references, defaultReferenceSearchOptions));\n\t});\n};\n\nlet showReferencesCommand: ICommandHandler = (accessor: ServicesAccessor, resource: URI, position: IPosition, references: Location[]) => {\n\tif (!(resource instanceof URI)) {\n\t\tthrow new Error('illegal argument, uri expected');\n\t}\n\n\tif (!references) {\n\t\tthrow new Error('missing references');\n\t}\n\n\tconst codeEditorService = accessor.get(ICodeEditorService);\n\treturn codeEditorService.openCodeEditor({ resource }, codeEditorService.getFocusedCodeEditor()).then(control => {\n\t\tif (!isCodeEditor(control)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet controller = ReferencesController.get(control);\n\t\tif (!controller) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn controller.toggleWidget(\n\t\t\tnew Range(position.lineNumber, position.column, position.lineNumber, position.column),\n\t\t\tcreateCancelablePromise(_ => Promise.resolve(new ReferencesModel(references))),\n\t\t\tdefaultReferenceSearchOptions\n\t\t);\n\t});\n};\n\n// register commands\n\nCommandsRegistry.registerCommand({\n\tid: 'editor.action.findReferences',\n\thandler: findReferencesCommand\n});\n\nCommandsRegistry.registerCommand({\n\tid: 'editor.action.showReferences',\n\thandler: showReferencesCommand,\n\tdescription: {\n\t\tdescription: 'Show references at a position in a file',\n\t\targs: [\n\t\t\t{ name: 'uri', description: 'The text document in which to show references', constraint: URI },\n\t\t\t{ name: 'position', description: 'The position at which to show', constraint: Position.isIPosition },\n\t\t\t{ name: 'locations', description: 'An array of locations.', constraint: Array },\n\t\t]\n\t}\n});\n\nfunction closeActiveReferenceSearch(accessor: ServicesAccessor, args: any) {\n\twithController(accessor, controller => controller.closeWidget());\n}\n\nfunction openReferenceToSide(accessor: ServicesAccessor, args: any) {\n\tconst listService = accessor.get(IListService);\n\n\tconst focus = listService.lastFocusedList && listService.lastFocusedList.getFocus();\n\tif (focus instanceof OneReference) {\n\t\twithController(accessor, controller => controller.openReference(focus, true));\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\n\tlet controller = ReferencesController.get(outerEditor);\n\tif (!controller) {\n\t\treturn;\n\t}\n\n\tfn(controller);\n}\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'goToNextReference',\n\tweight: KeybindingWeight.WorkbenchContrib + 50,\n\tprimary: KeyCode.F4,\n\twhen: ctxReferenceSearchVisible,\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: 'goToNextReferenceFromEmbeddedEditor',\n\tweight: KeybindingWeight.EditorContrib + 50,\n\tprimary: KeyCode.F4,\n\twhen: 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.WorkbenchContrib + 50,\n\tprimary: KeyMod.Shift | KeyCode.F4,\n\twhen: ctxReferenceSearchVisible,\n\thandler(accessor) {\n\t\twithController(accessor, controller => {\n\t\t\tcontroller.goToNextOrPreviousReference(false);\n\t\t});\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'goToPreviousReferenceFromEmbeddedEditor',\n\tweight: KeybindingWeight.EditorContrib + 50,\n\tprimary: KeyMod.Shift | KeyCode.F4,\n\twhen: PeekContext.inPeekEditor,\n\thandler(accessor) {\n\t\twithController(accessor, controller => {\n\t\t\tcontroller.goToNextOrPreviousReference(false);\n\t\t});\n\t}\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\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\thandler: closeActiveReferenceSearch\n});\n\nKeybindingsRegistry.registerCommandAndKeybindingRule({\n\tid: 'closeReferenceSearchEditor',\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\thandler: closeActiveReferenceSearch\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, ctxReferenceWidgetSearchTreeFocused),\n\thandler: openReferenceToSide\n});\n\nexport function provideReferences(model: ITextModel, position: Position, token: CancellationToken): Promise<Location[]> {\n\n\t// collect references from all providers\n\tconst promises = ReferenceProviderRegistry.ordered(model).map(provider => {\n\t\treturn Promise.resolve(provider.provideReferences(model, position, { includeDeclaration: true }, token)).then(result => {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\treturn <Location[]>result;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}, err => {\n\t\t\tonUnexpectedExternalError(err);\n\t\t});\n\t});\n\n\treturn Promise.all(promises).then(references => {\n\t\tlet result: Location[] = [];\n\t\tfor (let ref of references) {\n\t\t\tif (ref) {\n\t\t\t\tresult.push(...ref);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t});\n}\n\nregisterDefaultLanguageCommand('_executeReferenceProvider', (model, position) => provideReferences(model, position, CancellationToken.None));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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/referenceSearch/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(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 { URI } from 'vs/base/common/uri';\nimport * as resources from 'vs/base/common/resources';\nimport { createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { TernarySearchTree } from 'vs/base/common/map';\nimport { IStoredWorkspaceFolder } from 'vs/platform/workspaces/common/workspaces';\n\nexport const IWorkspaceContextService = createDecorator<IWorkspaceContextService>('contextService');\n\nexport interface IWorkspaceContextService {\n\t_serviceBrand: any;\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\t/**\n\t * Returns the folder for the given resource from the workspace.\n\t * Can be null if there is no workspace or the resource is not inside the workspace.\n\t */\n\tgetWorkspaceFolder(resource: URI): IWorkspaceFolder | null;\n}\n\nexport namespace IWorkspace {\n\texport function isIWorkspace(thing: any): thing is IWorkspace {\n\t\treturn thing && typeof thing === 'object'\n\t\t\t&& typeof (thing as IWorkspace).id === 'string'\n\t\t\t&& Array.isArray((thing as IWorkspace).folders);\n\t}\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 * the location of the workspace configuration\n\t */\n\treadonly configuration?: URI | null;\n}\n\nexport interface IWorkspaceFolderData {\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 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 namespace IWorkspaceFolder {\n\texport function isIWorkspaceFolder(thing: any): thing is IWorkspaceFolder {\n\t\treturn thing && typeof thing === 'object'\n\t\t\t&& URI.isUri((thing as IWorkspaceFolder).uri)\n\t\t\t&& typeof (thing as IWorkspaceFolder).name === 'string'\n\t\t\t&& typeof (thing as IWorkspaceFolder).toResource === 'function';\n\t}\n}\n\nexport interface IWorkspaceFolder extends IWorkspaceFolderData {\n\n\t/**\n\t * Given workspace folder relative path, returns the resource with the absolute path.\n\t */\n\ttoResource: (relativePath: string) => URI;\n}\n\nexport class Workspace implements IWorkspace {\n\n\tprivate _foldersMap: TernarySearchTree<WorkspaceFolder> = TernarySearchTree.forPaths<WorkspaceFolder>();\n\tprivate _folders: WorkspaceFolder[];\n\n\tconstructor(\n\t\tprivate _id: string,\n\t\tfolders: WorkspaceFolder[] = [],\n\t\tprivate _configuration: URI | null = null\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 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.toString()) || null;\n\t}\n\n\tprivate updateFoldersMap(): void {\n\t\tthis._foldersMap = TernarySearchTree.forPaths<WorkspaceFolder>();\n\t\tfor (const folder of this.folders) {\n\t\t\tthis._foldersMap.set(folder.uri.toString(), folder);\n\t\t}\n\t}\n\n\ttoJSON(): IWorkspace {\n\t\treturn { id: this.id, folders: this.folders, configuration: this.configuration };\n\t}\n}\n\nexport class WorkspaceFolder implements IWorkspaceFolder {\n\n\treadonly uri: URI;\n\tname: string;\n\tindex: number;\n\n\tconstructor(data: IWorkspaceFolderData,\n\t\treadonly raw?: IStoredWorkspaceFolder) {\n\t\tthis.uri = data.uri;\n\t\tthis.index = data.index;\n\t\tthis.name = data.name;\n\t}\n\n\ttoResource(relativePath: string): URI {\n\t\treturn resources.joinPath(this.uri, relativePath);\n\t}\n\n\ttoJSON(): IWorkspaceFolderData {\n\t\treturn { uri: this.uri, name: this.name, index: this.index };\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 * 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 { Keybinding, ResolvedKeybinding, SimpleKeybinding, createKeybinding } from 'vs/base/common/keyCodes';\nimport { IDisposable, IReference, ImmortalReference, combinedDisposable, toDisposable } 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 { ICodeEditor, IDiffEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { IBulkEditOptions, IBulkEditResult, IBulkEditService } from 'vs/editor/browser/services/bulkEditService';\nimport { isDiffEditorConfigurationKey, isEditorConfigurationKey } from 'vs/editor/common/config/commonEditorConfig';\nimport { EditOperation } 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 * as editorCommon from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { TextEdit, WorkspaceEdit, isResourceTextEdit } from 'vs/editor/common/modes';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { IResolvedTextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { ITextResourceConfigurationService, ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';\nimport { CommandsRegistry, ICommand, ICommandEvent, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands';\nimport { IConfigurationChangeEvent, IConfigurationOverrides, IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { Configuration, ConfigurationModel, DefaultConfigurationModel } from 'vs/platform/configuration/common/configurationModels';\nimport { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService';\nimport { IKeybindingEvent, 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 } from 'vs/platform/notification/common/notification';\nimport { IProgressService } from 'vs/platform/progress/common/progress';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { IWorkspace, IWorkspaceContextService, IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/workspace';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { SimpleServicesNLS } from 'vs/editor/common/standaloneStrings';\n\nexport class SimpleModel implements IResolvedTextEditorModel {\n\n\tprivate readonly model: ITextModel;\n\tprivate readonly _onDispose: Emitter<void>;\n\n\tconstructor(model: ITextModel) {\n\t\tthis.model = model;\n\t\tthis._onDispose = new Emitter<void>();\n\t}\n\n\tpublic get textEditorModel(): ITextModel {\n\t\treturn this.model;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._onDispose.fire();\n\t}\n}\n\nfunction withTypedEditor<T>(widget: editorCommon.IEditor, codeEditorCallback: (editor: ICodeEditor) => T, diffEditorCallback: (editor: IDiffEditor) => T): T {\n\tif (isCodeEditor(widget)) {\n\t\t// Single Editor\n\t\treturn codeEditorCallback(<ICodeEditor>widget);\n\t} else {\n\t\t// Diff Editor\n\t\treturn diffEditorCallback(<IDiffEditor>widget);\n\t}\n}\n\nexport class SimpleEditorModelResolverService implements ITextModelService {\n\tpublic _serviceBrand: any;\n\n\tprivate editor: editorCommon.IEditor;\n\n\tpublic setEditor(editor: editorCommon.IEditor): void {\n\t\tthis.editor = editor;\n\t}\n\n\tpublic createModelReference(resource: URI): Promise<IReference<IResolvedTextEditorModel>> {\n\t\tlet model: ITextModel | null = withTypedEditor(this.editor,\n\t\t\t(editor) => this.findModel(editor, resource),\n\t\t\t(diffEditor) => this.findModel(diffEditor.getOriginalEditor(), resource) || this.findModel(diffEditor.getModifiedEditor(), resource)\n\t\t);\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\tprivate findModel(editor: ICodeEditor, resource: URI): ITextModel | null {\n\t\tlet 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\nexport class SimpleProgressService implements IProgressService {\n\t_serviceBrand: any;\n\n\tshowWhile(promise: Promise<any>, delay?: number): Promise<void> {\n\t\treturn Promise.resolve(undefined);\n\t}\n}\n\nexport class SimpleDialogService implements IDialogService {\n\n\tpublic _serviceBrand: any;\n}\n\nexport class SimpleNotificationService implements INotificationService {\n\n\tpublic _serviceBrand: any;\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 SimpleNotificationService.NO_OP;\n\t}\n}\n\nexport class StandaloneCommandService implements ICommandService {\n\t_serviceBrand: any;\n\n\tprivate readonly _instantiationService: IInstantiationService;\n\tprivate readonly _dynamicCommands: { [id: string]: ICommand; };\n\n\tprivate readonly _onWillExecuteCommand = new Emitter<ICommandEvent>();\n\n\tconstructor(instantiationService: IInstantiationService) {\n\t\tthis._instantiationService = instantiationService;\n\t\tthis._dynamicCommands = Object.create(null);\n\t}\n\n\tpublic addCommand(command: ICommand): IDisposable {\n\t\tconst { id } = command;\n\t\tthis._dynamicCommands[id] = command;\n\t\treturn toDisposable(() => {\n\t\t\tdelete this._dynamicCommands[id];\n\t\t});\n\t}\n\n\tpublic executeCommand<T>(id: string, ...args: any[]): Promise<T> {\n\t\tconst command = (CommandsRegistry.getCommand(id) || this._dynamicCommands[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 });\n\t\t\tconst result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler, ...args]) as T;\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\n\tconstructor(\n\t\tcontextKeyService: IContextKeyService,\n\t\tcommandService: ICommandService,\n\t\ttelemetryService: ITelemetryService,\n\t\tnotificationService: INotificationService,\n\t\tdomNode: HTMLElement\n\t) {\n\t\tsuper(contextKeyService, commandService, telemetryService, notificationService);\n\n\t\tthis._cachedResolver = null;\n\t\tthis._dynamicKeybindings = [];\n\n\t\tthis._register(dom.addDisposableListener(domNode, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {\n\t\t\tlet keyEvent = new StandardKeyboardEvent(e);\n\t\t\tlet shouldPreventDefault = this._dispatch(keyEvent, keyEvent.target);\n\t\t\tif (shouldPreventDefault) {\n\t\t\t\tkeyEvent.preventDefault();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic addDynamicKeybinding(commandId: string, _keybinding: number, handler: ICommandHandler, when: ContextKeyExpr | undefined): IDisposable {\n\t\tconst keybinding = createKeybinding(_keybinding, OS);\n\t\tif (!keybinding) {\n\t\t\tthrow new Error(`Invalid keybinding`);\n\t\t}\n\n\t\tlet toDispose: IDisposable[] = [];\n\n\t\tthis._dynamicKeybindings.push({\n\t\t\tkeybinding: keybinding,\n\t\t\tcommand: commandId,\n\t\t\twhen: when,\n\t\t\tweight1: 1000,\n\t\t\tweight2: 0\n\t\t});\n\n\t\ttoDispose.push(toDisposable(() => {\n\t\t\tfor (let i = 0; i < this._dynamicKeybindings.length; i++) {\n\t\t\t\tlet kb = this._dynamicKeybindings[i];\n\t\t\t\tif (kb.command === commandId) {\n\t\t\t\t\tthis._dynamicKeybindings.splice(i, 1);\n\t\t\t\t\tthis.updateResolver({ source: KeybindingSource.Default });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tlet commandService = this._commandService;\n\t\tif (commandService instanceof StandaloneCommandService) {\n\t\t\ttoDispose.push(commandService.addCommand({\n\t\t\t\tid: commandId,\n\t\t\t\thandler: handler\n\t\t\t}));\n\t\t} else {\n\t\t\tthrow new Error('Unknown command service!');\n\t\t}\n\t\tthis.updateResolver({ source: KeybindingSource.Default });\n\n\t\treturn combinedDisposable(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);\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\tlet result: ResolvedKeybindingItem[] = [], resultLen = 0;\n\t\tfor (const item of items) {\n\t\t\tconst when = (item.when ? item.when.normalize() : 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(null, item.command, item.commandArgs, when, isDefault);\n\t\t\t} else {\n\t\t\t\tconst resolvedKeybindings = this.resolveKeybinding(keybinding);\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);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[] {\n\t\treturn [new USLayoutResolvedKeybinding(keybinding, OS)];\n\t}\n\n\tpublic resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding {\n\t\tlet 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\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 SimpleConfigurationService implements IConfigurationService {\n\n\t_serviceBrand: any;\n\n\tprivate _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\tprivate configuration(): Configuration {\n\t\treturn this._configuration;\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 updateValue(key: string, value: any, arg3?: any, arg4?: any): Promise<void> {\n\t\tthis.configuration().updateValue(key, value);\n\t\treturn Promise.resolve();\n\t}\n\n\tpublic inspect<C>(key: string, options: IConfigurationOverrides = {}): {\n\t\tdefault: C,\n\t\tuser: C,\n\t\tworkspace?: C,\n\t\tworkspaceFolder?: C\n\t\tvalue: C,\n\t} {\n\t\treturn this.configuration().inspect<C>(key, options, undefined);\n\t}\n}\n\nexport class SimpleResourceConfigurationService implements ITextResourceConfigurationService {\n\n\t_serviceBrand: any;\n\tprivate readonly _onDidChangeConfigurationEmitter = new Emitter();\n\n\tconstructor(private readonly configurationService: SimpleConfigurationService) {\n\t\tthis.configurationService.onDidChangeConfiguration((e) => {\n\t\t\tthis._onDidChangeConfigurationEmitter.fire(e);\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\nexport class SimpleResourcePropertiesService implements ITextResourcePropertiesService {\n\n\t_serviceBrand: any;\n\n\tconstructor(\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t}\n\n\tgetEOL(resource: URI): string {\n\t\tconst filesConfiguration = this.configurationService.getValue<{ eol: string }>('files');\n\t\tif (filesConfiguration && filesConfiguration.eol) {\n\t\t\tif (filesConfiguration.eol !== 'auto') {\n\t\t\t\treturn filesConfiguration.eol;\n\t\t\t}\n\t\t}\n\t\treturn (isLinux || isMacintosh) ? '\\n' : '\\r\\n';\n\t}\n}\n\nexport class StandaloneTelemetryService implements ITelemetryService {\n\t_serviceBrand: void;\n\n\tpublic publicLog(eventName: string, data?: any): Promise<void> {\n\t\treturn Promise.resolve(undefined);\n\t}\n}\n\nexport class SimpleWorkspaceContextService implements IWorkspaceContextService {\n\n\tpublic _serviceBrand: any;\n\n\tprivate static SCHEME = 'inmemory';\n\n\tprivate readonly workspace: IWorkspace;\n\n\tconstructor() {\n\t\tconst resource = URI.from({ scheme: SimpleWorkspaceContextService.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\tpublic getWorkspaceFolder(resource: URI): IWorkspaceFolder | null {\n\t\treturn resource && resource.scheme === SimpleWorkspaceContextService.SCHEME ? this.workspace.folders[0] : null;\n\t}\n}\n\nexport function applyConfigurationValues(configurationService: IConfigurationService, source: any, isDiffEditor: boolean): void {\n\tif (!source) {\n\t\treturn;\n\t}\n\tif (!(configurationService instanceof SimpleConfigurationService)) {\n\t\treturn;\n\t}\n\tObject.keys(source).forEach((key) => {\n\t\tif (isEditorConfigurationKey(key)) {\n\t\t\tconfigurationService.updateValue(`editor.${key}`, source[key]);\n\t\t}\n\t\tif (isDiffEditor && isDiffEditorConfigurationKey(key)) {\n\t\t\tconfigurationService.updateValue(`diffEditor.${key}`, source[key]);\n\t\t}\n\t});\n}\n\nexport class SimpleBulkEditService implements IBulkEditService {\n\t_serviceBrand: any;\n\n\tconstructor(private readonly _modelService: IModelService) {\n\t\t//\n\t}\n\n\tapply(workspaceEdit: WorkspaceEdit, options?: IBulkEditOptions): Promise<IBulkEditResult> {\n\n\t\tlet edits = new Map<ITextModel, TextEdit[]>();\n\n\t\tif (workspaceEdit.edits) {\n\t\t\tfor (let edit of workspaceEdit.edits) {\n\t\t\t\tif (!isResourceTextEdit(edit)) {\n\t\t\t\t\treturn Promise.reject(new Error('bad edit - only text edits are supported'));\n\t\t\t\t}\n\t\t\t\tlet model = this._modelService.getModel(edit.resource);\n\t\t\t\tif (!model) {\n\t\t\t\t\treturn Promise.reject(new Error('bad edit - model not found'));\n\t\t\t\t}\n\t\t\t\tlet array = edits.get(model);\n\t\t\t\tif (!array) {\n\t\t\t\t\tarray = [];\n\t\t\t\t}\n\t\t\t\tedits.set(model, array.concat(edit.edits));\n\t\t\t}\n\t\t}\n\n\t\tlet totalEdits = 0;\n\t\tlet totalFiles = 0;\n\t\tedits.forEach((edits, model) => {\n\t\t\tmodel.applyEdits(edits.map(edit => EditOperation.replaceMove(Range.lift(edit.range), edit.text)));\n\t\t\ttotalFiles += 1;\n\t\t\ttotalEdits += edits.length;\n\t\t});\n\n\t\treturn Promise.resolve({\n\t\t\tselection: undefined,\n\t\t\tariaSummary: strings.format(SimpleServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles)\n\t\t});\n\t}\n}\n\nexport class SimpleUriLabelService implements ILabelService {\n\t_serviceBrand: any;\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\nexport class SimpleLayoutService implements ILayoutService {\n\t_serviceBrand: any;\n\n\tpublic onLayout = Event.None;\n\n\tget container(): HTMLElement {\n\t\treturn this._container;\n\t}\n\n\tconstructor(private _container: HTMLElement) { }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 aria from 'vs/base/browser/ui/aria/aria';\nimport { Disposable, IDisposable, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';\nimport { ICodeEditor, IDiffEditor } 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/editorWorkerService';\nimport { StandaloneKeybindingService, applyConfigurationValues } from 'vs/editor/standalone/browser/simpleServices';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\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 { IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';\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 { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { StandaloneCodeEditorNLS } from 'vs/editor/common/standaloneStrings';\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): void | Promise<void>;\n}\n\n/**\n * The options to create an editor.\n */\nexport interface IEditorConstructionOptions extends IEditorOptions {\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 create automatically 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 create automatically 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 */\n\ttheme?: string;\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}\n\n/**\n * The options to create a diff editor.\n */\nexport interface IDiffEditorConstructionOptions extends IDiffEditorOptions {\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 */\n\ttheme?: string;\n}\n\nexport interface IStandaloneCodeEditor extends ICodeEditor {\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;\nfunction createAriaDomNode() {\n\tif (ariaDomNodeCreated) {\n\t\treturn;\n\t}\n\tariaDomNodeCreated = true;\n\taria.setARIAContainer(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;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\toptions: IEditorConstructionOptions,\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) {\n\t\toptions = options || {};\n\t\toptions.ariaLabel = options.ariaLabel || StandaloneCodeEditorNLS.editorViewAccessibleLabel;\n\t\toptions.ariaLabel = options.ariaLabel + ';' + (\n\t\t\tbrowser.isIE\n\t\t\t\t? StandaloneCodeEditorNLS.accessibilityHelpMessageIE\n\t\t\t\t: StandaloneCodeEditorNLS.accessibilityHelpMessage\n\t\t);\n\t\tsuper(domElement, options, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService);\n\n\t\tif (keybindingService instanceof StandaloneKeybindingService) {\n\t\t\tthis._standaloneKeybindingService = keybindingService;\n\t\t}\n\n\t\t// Create the ARIA dom node as soon as the first editor is instantiated\n\t\tcreateAriaDomNode();\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\tlet commandId = 'DYNAMIC_' + (++LAST_GENERATED_COMMAND_ID);\n\t\tlet 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 = (): Promise<void> => {\n\t\t\treturn Promise.resolve(_descriptor.run(this));\n\t\t};\n\n\n\t\tlet toDispose: IDisposable[] = [];\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.push(CommandsRegistry.registerCommand(uniqueId, run));\n\n\t\t// Register the context menu item\n\t\tif (contextMenuGroupId) {\n\t\t\tlet 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.push(MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem));\n\t\t}\n\n\t\t// Register the keybindings\n\t\tif (Array.isArray(keybindings)) {\n\t\t\ttoDispose = toDispose.concat(\n\t\t\t\tkeybindings.map((kb) => {\n\t\t\t\t\treturn this._standaloneKeybindingService.addDynamicKeybinding(uniqueId, kb, run, keybindingsWhen);\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\t// Finally, register an internal editor action\n\t\tlet 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.push(toDisposable(() => {\n\t\t\tdelete this._actions[id];\n\t\t}));\n\n\t\treturn combinedDisposable(toDispose);\n\t}\n}\n\nexport class StandaloneEditor extends StandaloneCodeEditor implements IStandaloneCodeEditor {\n\n\tprivate readonly _contextViewService: ContextViewService;\n\tprivate readonly _configurationService: IConfigurationService;\n\tprivate _ownsModel: boolean;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\toptions: IEditorConstructionOptions | undefined,\n\t\ttoDispose: IDisposable,\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@IContextViewService contextViewService: IContextViewService,\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) {\n\t\tapplyConfigurationValues(configurationService, options, false);\n\t\toptions = options || {};\n\t\tif (typeof options.theme === 'string') {\n\t\t\tthemeService.setTheme(options.theme);\n\t\t}\n\t\tlet _model: ITextModel | null | undefined = options.model;\n\t\tdelete options.model;\n\t\tsuper(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, themeService, notificationService, accessibilityService);\n\n\t\tthis._contextViewService = <ContextViewService>contextViewService;\n\t\tthis._configurationService = configurationService;\n\t\tthis._register(toDispose);\n\n\t\tlet model: ITextModel | null;\n\t\tif (typeof _model === 'undefined') {\n\t\t\tmodel = (<any>self).monaco.editor.createModel(options.value || '', options.language || 'text/plain');\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\tlet 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 dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic updateOptions(newOptions: IEditorOptions): void {\n\t\tapplyConfigurationValues(this._configurationService, newOptions, false);\n\t\tsuper.updateOptions(newOptions);\n\t}\n\n\t_attachModel(model: ITextModel | null): void {\n\t\tsuper._attachModel(model);\n\t\tif (this._modelData) {\n\t\t\tthis._contextViewService.setContainer(this._modelData.view.domNode.domNode);\n\t\t}\n\t}\n\n\t_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 _contextViewService: ContextViewService;\n\tprivate readonly _configurationService: IConfigurationService;\n\n\tconstructor(\n\t\tdomElement: HTMLElement,\n\t\toptions: IDiffEditorConstructionOptions | undefined,\n\t\ttoDispose: IDisposable,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IContextViewService contextViewService: IContextViewService,\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) {\n\t\tapplyConfigurationValues(configurationService, options, true);\n\t\toptions = options || {};\n\t\tif (typeof options.theme === 'string') {\n\t\t\toptions.theme = themeService.setTheme(options.theme);\n\t\t}\n\n\t\tsuper(domElement, options, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService);\n\n\t\tthis._contextViewService = <ContextViewService>contextViewService;\n\t\tthis._configurationService = configurationService;\n\n\t\tthis._register(toDispose);\n\n\t\tthis._contextViewService.setContainer(this._containerDomElement);\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic updateOptions(newOptions: IDiffEditorOptions): void {\n\t\tapplyConfigurationValues(this._configurationService, newOptions, true);\n\t\tsuper.updateOptions(newOptions);\n\t}\n\n\tprotected _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement, options: IEditorOptions): CodeEditorWidget {\n\t\treturn instantiationService.createInstance(StandaloneCodeEditor, container, options);\n\t}\n\n\tpublic getOriginalEditor(): IStandaloneCodeEditor {\n\t\treturn <StandaloneCodeEditor>super.getOriginalEditor();\n\t}\n\n\tpublic 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 * Copyright (c) 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 { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { EditorWorkerServiceImpl } from 'vs/editor/common/services/editorWorkerServiceImpl';\nimport { IModeService } from 'vs/editor/common/services/modeService';\nimport { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';\nimport { IModelService } from 'vs/editor/common/services/modelService';\nimport { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';\nimport { ITextResourceConfigurationService, ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';\nimport { SimpleBulkEditService, SimpleConfigurationService, SimpleDialogService, SimpleNotificationService, SimpleProgressService, SimpleResourceConfigurationService, SimpleResourcePropertiesService, SimpleUriLabelService, SimpleWorkspaceContextService, StandaloneCommandService, StandaloneKeybindingService, StandaloneTelemetryService, SimpleLayoutService } from 'vs/editor/standalone/browser/simpleServices';\nimport { StandaloneCodeEditorServiceImpl } from 'vs/editor/standalone/browser/standaloneCodeServiceImpl';\nimport { StandaloneThemeServiceImpl } from 'vs/editor/standalone/browser/standaloneThemeServiceImpl';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\nimport { IMenuService } from 'vs/platform/actions/common/actions';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService';\nimport { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';\nimport { IDialogService } from 'vs/platform/dialogs/common/dialogs';\nimport { IInstantiationService, ServiceIdentifier, createDecorator } from 'vs/platform/instantiation/common/instantiation';\nimport { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';\nimport { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { IListService, ListService } from 'vs/platform/list/browser/listService';\nimport { ILogService, NullLogService } from 'vs/platform/log/common/log';\nimport { MarkerService } from 'vs/platform/markers/common/markerService';\nimport { IMarkerService } from 'vs/platform/markers/common/markers';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IProgressService } from 'vs/platform/progress/common/progress';\nimport { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';\nimport { MenuService } from 'vs/platform/actions/common/menuService';\nimport { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService';\nimport { MarkerDecorationsService } from 'vs/editor/common/services/markerDecorationsServiceImpl';\nimport { ISuggestMemoryService, SuggestMemoryService } from 'vs/editor/contrib/suggest/suggestMemory';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { BrowserAccessibilityService } from 'vs/platform/accessibility/common/accessibilityService';\nimport { ILayoutService } from 'vs/platform/layout/browser/layoutService';\nimport { ICodeLensCache, CodeLensCache } from 'vs/editor/contrib/codelens/codeLensCache';\n\nexport interface IEditorOverrideServices {\n\t[index: string]: any;\n}\n\nexport module StaticServices {\n\n\tconst _serviceCollection = new ServiceCollection();\n\n\texport class LazyStaticService<T> {\n\t\tprivate readonly _serviceId: ServiceIdentifier<T>;\n\t\tprivate readonly _factory: (overrides?: IEditorOverrideServices) => T;\n\t\tprivate _value: T | null;\n\n\t\tpublic get id() { return this._serviceId; }\n\n\t\tconstructor(serviceId: ServiceIdentifier<T>, factory: (overrides?: IEditorOverrideServices) => T) {\n\t\t\tthis._serviceId = serviceId;\n\t\t\tthis._factory = factory;\n\t\t\tthis._value = null;\n\t\t}\n\n\t\tpublic get(overrides?: IEditorOverrideServices): T {\n\t\t\tif (!this._value) {\n\t\t\t\tif (overrides) {\n\t\t\t\t\tthis._value = overrides[this._serviceId.toString()];\n\t\t\t\t}\n\t\t\t\tif (!this._value) {\n\t\t\t\t\tthis._value = this._factory(overrides);\n\t\t\t\t}\n\t\t\t\tif (!this._value) {\n\t\t\t\t\tthrow new Error('Service ' + this._serviceId + ' is missing!');\n\t\t\t\t}\n\t\t\t\t_serviceCollection.set(this._serviceId, this._value);\n\t\t\t}\n\t\t\treturn this._value;\n\t\t}\n\t}\n\n\tlet _all: LazyStaticService<any>[] = [];\n\n\tfunction define<T>(serviceId: ServiceIdentifier<T>, factory: (overrides: IEditorOverrideServices) => T): LazyStaticService<T> {\n\t\tlet r = new LazyStaticService(serviceId, factory);\n\t\t_all.push(r);\n\t\treturn r;\n\t}\n\n\texport function init(overrides: IEditorOverrideServices): [ServiceCollection, IInstantiationService] {\n\t\t// Create a fresh service collection\n\t\tlet result = new ServiceCollection();\n\n\t\t// Initialize the service collection with the overrides\n\t\tfor (let serviceId in overrides) {\n\t\t\tif (overrides.hasOwnProperty(serviceId)) {\n\t\t\t\tresult.set(createDecorator(serviceId), overrides[serviceId]);\n\t\t\t}\n\t\t}\n\n\t\t// Make sure the same static services are present in all service collections\n\t\t_all.forEach(service => result.set(service.id, service.get(overrides)));\n\n\t\t// Ensure the collection gets the correct instantiation service\n\t\tlet instantiationService = new InstantiationService(result, true);\n\t\tresult.set(IInstantiationService, instantiationService);\n\n\t\treturn [result, instantiationService];\n\t}\n\n\texport const instantiationService = define<IInstantiationService>(IInstantiationService, () => new InstantiationService(_serviceCollection, true));\n\n\tconst configurationServiceImpl = new SimpleConfigurationService();\n\texport const configurationService = define(IConfigurationService, () => configurationServiceImpl);\n\n\texport const resourceConfigurationService = define(ITextResourceConfigurationService, () => new SimpleResourceConfigurationService(configurationServiceImpl));\n\n\texport const resourcePropertiesService = define(ITextResourcePropertiesService, () => new SimpleResourcePropertiesService(configurationServiceImpl));\n\n\texport const contextService = define(IWorkspaceContextService, () => new SimpleWorkspaceContextService());\n\n\texport const labelService = define(ILabelService, () => new SimpleUriLabelService());\n\n\texport const telemetryService = define(ITelemetryService, () => new StandaloneTelemetryService());\n\n\texport const dialogService = define(IDialogService, () => new SimpleDialogService());\n\n\texport const notificationService = define(INotificationService, () => new SimpleNotificationService());\n\n\texport const accessibilityService = define(IAccessibilityService, () => new BrowserAccessibilityService());\n\n\texport const markerService = define(IMarkerService, () => new MarkerService());\n\n\texport const modeService = define(IModeService, (o) => new ModeServiceImpl());\n\n\texport const modelService = define(IModelService, (o) => new ModelServiceImpl(configurationService.get(o), resourcePropertiesService.get(o)));\n\n\texport const markerDecorationsService = define(IMarkerDecorationsService, (o) => new MarkerDecorationsService(modelService.get(o), markerService.get(o)));\n\n\texport const standaloneThemeService = define(IStandaloneThemeService, () => new StandaloneThemeServiceImpl());\n\n\texport const codeEditorService = define(ICodeEditorService, (o) => new StandaloneCodeEditorServiceImpl(standaloneThemeService.get(o)));\n\n\texport const progressService = define(IProgressService, () => new SimpleProgressService());\n\n\texport const storageService = define(IStorageService, () => new InMemoryStorageService());\n\n\texport const logService = define(ILogService, () => new NullLogService());\n\n\texport const editorWorkerService = define(IEditorWorkerService, (o) => new EditorWorkerServiceImpl(modelService.get(o), resourceConfigurationService.get(o), logService.get(o)));\n\n\texport const suggestMemoryService = define(ISuggestMemoryService, (o) => new SuggestMemoryService(storageService.get(o), configurationService.get(o)));\n\n\texport const codeLensCacheService = define(ICodeLensCache, (o) => new CodeLensCache(storageService.get(o)));\n}\n\nexport class DynamicStandaloneServices extends Disposable {\n\n\tprivate readonly _serviceCollection: ServiceCollection;\n\tprivate readonly _instantiationService: IInstantiationService;\n\n\tconstructor(domElement: HTMLElement, overrides: IEditorOverrideServices) {\n\t\tsuper();\n\n\t\tconst [_serviceCollection, _instantiationService] = StaticServices.init(overrides);\n\t\tthis._serviceCollection = _serviceCollection;\n\t\tthis._instantiationService = _instantiationService;\n\n\t\tconst configurationService = this.get(IConfigurationService);\n\t\tconst notificationService = this.get(INotificationService);\n\t\tconst telemetryService = this.get(ITelemetryService);\n\t\tconst themeService = this.get(IThemeService);\n\n\t\tlet ensure = <T>(serviceId: ServiceIdentifier<T>, factory: () => T): T => {\n\t\t\tlet value: T | null = null;\n\t\t\tif (overrides) {\n\t\t\t\tvalue = overrides[serviceId.toString()];\n\t\t\t}\n\t\t\tif (!value) {\n\t\t\t\tvalue = factory();\n\t\t\t}\n\t\t\tthis._serviceCollection.set(serviceId, value);\n\t\t\treturn value;\n\t\t};\n\n\t\tlet contextKeyService = ensure(IContextKeyService, () => this._register(new ContextKeyService(configurationService)));\n\n\t\tensure(IListService, () => new ListService(contextKeyService));\n\n\t\tlet commandService = ensure(ICommandService, () => new StandaloneCommandService(this._instantiationService));\n\n\t\tlet keybindingService = ensure(IKeybindingService, () => this._register(new StandaloneKeybindingService(contextKeyService, commandService, telemetryService, notificationService, domElement)));\n\n\t\tlet layoutService = ensure(ILayoutService, () => new SimpleLayoutService(domElement));\n\n\t\tlet contextViewService = ensure(IContextViewService, () => this._register(new ContextViewService(layoutService)));\n\n\t\tensure(IContextMenuService, () => {\n\t\t\tconst contextMenuService = new ContextMenuService(telemetryService, notificationService, contextViewService, keybindingService, themeService);\n\t\t\tcontextMenuService.configure({ blockMouse: false }); // we do not want that in the standalone editor\n\n\t\t\treturn this._register(contextMenuService);\n\t\t});\n\n\t\tensure(IMenuService, () => new MenuService(commandService));\n\n\t\tensure(IBulkEditService, () => new SimpleBulkEditService(StaticServices.modelService.get(IModelService)));\n\t}\n\n\tpublic get<T>(serviceId: ServiceIdentifier<T>): T {\n\t\tlet r = <T>this._serviceCollection.get(serviceId);\n\t\tif (!r) {\n\t\t\tthrow new Error('Missing service ' + serviceId);\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic set<T>(serviceId: ServiceIdentifier<T>, instance: T): void {\n\t\tthis._serviceCollection.set(serviceId, instance);\n\t}\n\n\tpublic has<T>(serviceId: ServiceIdentifier<T>): boolean {\n\t\treturn this._serviceCollection.has(serviceId);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';\nimport { OpenerService } from 'vs/editor/browser/services/openerService';\nimport { DiffNavigator } from 'vs/editor/browser/widget/diffNavigator';\nimport * as editorOptions from 'vs/editor/common/config/editorOptions';\nimport { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';\nimport { Token } from 'vs/editor/common/core/token';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { FindMatch, ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';\nimport * as modes from 'vs/editor/common/modes';\nimport { NULL_STATE, nullTokenize } from 'vs/editor/common/modes/nullMode';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { ILanguageSelection } from 'vs/editor/common/services/modeService';\nimport { ITextModelService } from 'vs/editor/common/services/resolverService';\nimport { IWebWorkerOptions, MonacoWebWorker, createWebWorker as actualCreateWebWorker } from 'vs/editor/common/services/webWorker';\nimport * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';\nimport { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/standalone/browser/colorizer';\nimport { SimpleEditorModelResolverService } from 'vs/editor/standalone/browser/simpleServices';\nimport { IDiffEditorConstructionOptions, IEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneDiffEditor, StandaloneEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';\nimport { DynamicStandaloneServices, IEditorOverrideServices, StaticServices } from 'vs/editor/standalone/browser/standaloneServices';\nimport { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\nimport { ICommandService } from 'vs/platform/commands/common/commands';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IContextViewService } from 'vs/platform/contextview/browser/contextView';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { IMarker, IMarkerData } from 'vs/platform/markers/common/markers';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IOpenerService } from 'vs/platform/opener/common/opener';\nimport { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';\nimport { clearAllFontInfos } from 'vs/editor/browser/config/configuration';\n\ntype Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\n\nfunction withAllStandaloneServices<T extends editorCommon.IEditor>(domElement: HTMLElement, override: IEditorOverrideServices, callback: (services: DynamicStandaloneServices) => T): T {\n\tlet services = new DynamicStandaloneServices(domElement, override);\n\n\tlet simpleEditorModelResolverService: SimpleEditorModelResolverService | null = null;\n\tif (!services.has(ITextModelService)) {\n\t\tsimpleEditorModelResolverService = new SimpleEditorModelResolverService();\n\t\tservices.set(ITextModelService, simpleEditorModelResolverService);\n\t}\n\n\tif (!services.has(IOpenerService)) {\n\t\tservices.set(IOpenerService, new OpenerService(services.get(ICodeEditorService), services.get(ICommandService)));\n\t}\n\n\tlet result = callback(services);\n\n\tif (simpleEditorModelResolverService) {\n\t\tsimpleEditorModelResolverService.setEditor(result);\n\t}\n\n\treturn result;\n}\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?: IEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor {\n\treturn withAllStandaloneServices(domElement, override || {}, (services) => {\n\t\treturn new StandaloneEditor(\n\t\t\tdomElement,\n\t\t\toptions,\n\t\t\tservices,\n\t\t\tservices.get(IInstantiationService),\n\t\t\tservices.get(ICodeEditorService),\n\t\t\tservices.get(ICommandService),\n\t\t\tservices.get(IContextKeyService),\n\t\t\tservices.get(IKeybindingService),\n\t\t\tservices.get(IContextViewService),\n\t\t\tservices.get(IStandaloneThemeService),\n\t\t\tservices.get(INotificationService),\n\t\t\tservices.get(IConfigurationService),\n\t\t\tservices.get(IAccessibilityService)\n\t\t);\n\t});\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\treturn StaticServices.codeEditorService.get().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?: IDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor {\n\treturn withAllStandaloneServices(domElement, override || {}, (services) => {\n\t\treturn new StandaloneDiffEditor(\n\t\t\tdomElement,\n\t\t\toptions,\n\t\t\tservices,\n\t\t\tservices.get(IInstantiationService),\n\t\t\tservices.get(IContextKeyService),\n\t\t\tservices.get(IKeybindingService),\n\t\t\tservices.get(IContextViewService),\n\t\t\tservices.get(IEditorWorkerService),\n\t\t\tservices.get(ICodeEditorService),\n\t\t\tservices.get(IStandaloneThemeService),\n\t\t\tservices.get(INotificationService),\n\t\t\tservices.get(IConfigurationService),\n\t\t);\n\t});\n}\n\nexport interface IDiffNavigator {\n\tcanNavigate(): boolean;\n\tnext(): void;\n\tprevious(): void;\n\tdispose(): void;\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\nfunction doCreateModel(value: string, languageSelection: ILanguageSelection, uri?: URI): ITextModel {\n\treturn StaticServices.modelService.get().createModel(value, languageSelection, uri);\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\tvalue = value || '';\n\n\tif (!language) {\n\t\tlet path = uri ? uri.path : null;\n\n\t\tlet 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\n\t\treturn doCreateModel(value, StaticServices.modeService.get().createByFilepathOrFirstLine(path, firstLine), uri);\n\t}\n\treturn doCreateModel(value, StaticServices.modeService.get().create(language), uri);\n}\n\n/**\n * Change the language for a model.\n */\nexport function setModelLanguage(model: ITextModel, languageId: string): void {\n\tStaticServices.modelService.get().setMode(model, StaticServices.modeService.get().create(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\tStaticServices.markerService.get().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\treturn StaticServices.markerService.get().read(filter);\n}\n\n/**\n * Get the model that has `uri` if it exists.\n */\nexport function getModel(uri: URI): ITextModel | null {\n\treturn StaticServices.modelService.get().getModel(uri);\n}\n\n/**\n * Get all the created models.\n */\nexport function getModels(): ITextModel[] {\n\treturn StaticServices.modelService.get().getModels();\n}\n\n/**\n * Emitted when a model is created.\n * @event\n */\nexport function onDidCreateModel(listener: (model: ITextModel) => void): IDisposable {\n\treturn StaticServices.modelService.get().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\treturn StaticServices.modelService.get().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\treturn StaticServices.modelService.get().onModelModeChanged((e) => {\n\t\tlistener({\n\t\t\tmodel: e.model,\n\t\t\toldLanguage: e.oldModeId\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>(StaticServices.modelService.get(), 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\treturn Colorizer.colorizeElement(StaticServices.standaloneThemeService.get(), StaticServices.modeService.get(), domNode, options);\n}\n\n/**\n * Colorize `text` using language `languageId`.\n */\nexport function colorize(text: string, languageId: string, options: IColorizerOptions): Promise<string> {\n\treturn Colorizer.colorize(StaticServices.modeService.get(), 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\treturn Colorizer.colorizeModelLine(model, lineNumber, tabSize);\n}\n\n/**\n * @internal\n */\nfunction getSafeTokenizationSupport(language: string): Omit<modes.ITokenizationSupport, 'tokenize2'> {\n\tlet tokenizationSupport = modes.TokenizationRegistry.get(language);\n\tif (tokenizationSupport) {\n\t\treturn tokenizationSupport;\n\t}\n\treturn {\n\t\tgetInitialState: () => NULL_STATE,\n\t\ttokenize: (line: string, state: modes.IState, deltaOffset: number) => nullTokenize(language, line, state, deltaOffset)\n\t};\n}\n\n/**\n * Tokenize `text` using language `languageId`\n */\nexport function tokenize(text: string, languageId: string): Token[][] {\n\tlet modeService = StaticServices.modeService.get();\n\t// Needed in order to get the mode registered for subsequent look-ups\n\tmodeService.triggerMode(languageId);\n\n\tlet tokenizationSupport = getSafeTokenizationSupport(languageId);\n\tlet lines = text.split(/\\r\\n|\\r|\\n/);\n\tlet result: Token[][] = [];\n\tlet state = tokenizationSupport.getInitialState();\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tlet line = lines[i];\n\t\tlet tokenizationResult = tokenizationSupport.tokenize(line, state, 0);\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\tStaticServices.standaloneThemeService.get().defineTheme(themeName, themeData);\n}\n\n/**\n * Switches to a theme.\n */\nexport function setTheme(themeName: string): void {\n\tStaticServices.standaloneThemeService.get().setTheme(themeName);\n}\n\n/**\n * Clears all cached font measurements and triggers re-measurement.\n */\nexport function remeasureFonts(): void {\n\tclearAllFontInfos();\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\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\n\t\t// enums\n\t\tScrollbarVisibility: standaloneEnums.ScrollbarVisibility,\n\t\tWrappingIndent: standaloneEnums.WrappingIndent,\n\t\tOverviewRulerLane: standaloneEnums.OverviewRulerLane,\n\t\tEndOfLinePreference: standaloneEnums.EndOfLinePreference,\n\t\tDefaultEndOfLine: standaloneEnums.DefaultEndOfLine,\n\t\tEndOfLineSequence: standaloneEnums.EndOfLineSequence,\n\t\tTrackedRangeStickiness: standaloneEnums.TrackedRangeStickiness,\n\t\tCursorChangeReason: standaloneEnums.CursorChangeReason,\n\t\tMouseTargetType: standaloneEnums.MouseTargetType,\n\t\tTextEditorCursorStyle: standaloneEnums.TextEditorCursorStyle,\n\t\tTextEditorCursorBlinkingStyle: standaloneEnums.TextEditorCursorBlinkingStyle,\n\t\tContentWidgetPositionPreference: standaloneEnums.ContentWidgetPositionPreference,\n\t\tOverlayWidgetPositionPreference: standaloneEnums.OverlayWidgetPositionPreference,\n\t\tRenderMinimap: standaloneEnums.RenderMinimap,\n\t\tScrollType: standaloneEnums.ScrollType,\n\t\tRenderLineNumbersType: standaloneEnums.RenderLineNumbersType,\n\n\t\t// classes\n\t\tInternalEditorOptions: <any>editorOptions.InternalEditorOptions,\n\t\tBareFontInfo: <any>BareFontInfo,\n\t\tFontInfo: <any>FontInfo,\n\t\tTextModelResolvedOptions: <any>TextModelResolvedOptions,\n\t\tFindMatch: <any>FindMatch,\n\n\t\t// vars\n\t\tEditorType: editorCommon.EditorType\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 { IDisposable } from 'vs/base/common/lifecycle';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Token, TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token';\nimport * as model from 'vs/editor/common/model';\nimport * as modes from 'vs/editor/common/modes';\nimport { LanguageConfiguration } from 'vs/editor/common/modes/languageConfiguration';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { ModesRegistry } from 'vs/editor/common/modes/modesRegistry';\nimport { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService';\nimport * as standaloneEnums from 'vs/editor/common/standalone/standaloneEnums';\nimport { StaticServices } from 'vs/editor/standalone/browser/standaloneServices';\nimport { compile } from 'vs/editor/standalone/common/monarch/monarchCompile';\nimport { createTokenizationSupport } from 'vs/editor/standalone/common/monarch/monarchLexer';\nimport { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes';\nimport { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';\nimport { IMarkerData } from 'vs/platform/markers/common/markers';\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\tlet lid = StaticServices.modeService.get().getLanguageIdentifier(languageId);\n\treturn lid ? lid.id : 0;\n}\n\n/**\n * An event emitted when a language is first time needed (e.g. a model has it set).\n * @event\n */\nexport function onLanguage(languageId: string, callback: () => void): IDisposable {\n\tlet disposable = StaticServices.modeService.get().onDidCreateMode((mode) => {\n\t\tif (mode.getId() === 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\tlet languageIdentifier = StaticServices.modeService.get().getLanguageIdentifier(languageId);\n\tif (!languageIdentifier) {\n\t\tthrow new Error(`Cannot set configuration for unknown language ${languageId}`);\n\t}\n\treturn LanguageConfigurationRegistry.register(languageIdentifier, configuration);\n}\n\n/**\n * @internal\n */\nexport class EncodedTokenizationSupport2Adapter implements modes.ITokenizationSupport {\n\n\tprivate readonly _actual: EncodedTokensProvider;\n\n\tconstructor(actual: EncodedTokensProvider) {\n\t\tthis._actual = actual;\n\t}\n\n\tpublic getInitialState(): modes.IState {\n\t\treturn this._actual.getInitialState();\n\t}\n\n\tpublic tokenize(line: string, state: modes.IState, offsetDelta: number): TokenizationResult {\n\t\tthrow new Error('Not supported!');\n\t}\n\n\tpublic tokenize2(line: string, state: modes.IState): TokenizationResult2 {\n\t\tlet result = this._actual.tokenizeEncoded(line, state);\n\t\treturn new TokenizationResult2(result.tokens, result.endState);\n\t}\n}\n\n/**\n * @internal\n */\nexport class TokenizationSupport2Adapter implements modes.ITokenizationSupport {\n\n\tprivate readonly _standaloneThemeService: IStandaloneThemeService;\n\tprivate readonly _languageIdentifier: modes.LanguageIdentifier;\n\tprivate readonly _actual: TokensProvider;\n\n\tconstructor(standaloneThemeService: IStandaloneThemeService, languageIdentifier: modes.LanguageIdentifier, actual: TokensProvider) {\n\t\tthis._standaloneThemeService = standaloneThemeService;\n\t\tthis._languageIdentifier = languageIdentifier;\n\t\tthis._actual = actual;\n\t}\n\n\tpublic getInitialState(): modes.IState {\n\t\treturn this._actual.getInitialState();\n\t}\n\n\tprivate _toClassicTokens(tokens: IToken[], language: string, offsetDelta: number): Token[] {\n\t\tlet result: 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 Token(startIndex + offsetDelta, t.scopes, language);\n\n\t\t\tpreviousStartIndex = startIndex;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic tokenize(line: string, state: modes.IState, offsetDelta: number): TokenizationResult {\n\t\tlet actualResult = this._actual.tokenize(line, state);\n\t\tlet tokens = this._toClassicTokens(actualResult.tokens, this._languageIdentifier.language, offsetDelta);\n\n\t\tlet endState: modes.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 TokenizationResult(tokens, endState);\n\t}\n\n\tprivate _toBinaryTokens(tokens: IToken[], offsetDelta: number): Uint32Array {\n\t\tconst languageId = this._languageIdentifier.id;\n\t\tconst tokenTheme = this._standaloneThemeService.getTheme().tokenTheme;\n\n\t\tlet result: number[] = [], 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 + offsetDelta;\n\t\t\tresult[resultLen++] = metadata;\n\n\t\t\tpreviousStartIndex = startIndex;\n\t\t}\n\n\t\tlet 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 tokenize2(line: string, state: modes.IState, offsetDelta: number): TokenizationResult2 {\n\t\tlet actualResult = this._actual.tokenize(line, state);\n\t\tlet tokens = this._toBinaryTokens(actualResult.tokens, offsetDelta);\n\n\t\tlet endState: modes.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 TokenizationResult2(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: modes.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 FTTT LLLL LLLL\n\t * - -------------------------------------------\n\t * - L = EncodedLanguageId (8 bits): Use `getEncodedLanguageId` to get the encoded ID of a language.\n\t * - T = StandardTokenType (3 bits): Other = 0, Comment = 1, String = 2, RegEx = 4.\n\t * - F = FontStyle (3 bits): None = 0, Italic = 1, Bold = 2, Underline = 4.\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: modes.IState;\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(): modes.IState;\n\t/**\n\t * Tokenize a line given the state at the beginning of the line.\n\t */\n\ttokenize(line: string, state: modes.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(): modes.IState;\n\t/**\n\t * Tokenize a line given the state at the beginning of the line.\n\t */\n\ttokenizeEncoded(line: string, state: modes.IState): IEncodedLineTokens;\n}\n\nfunction isEncodedTokensProvider(provider: TokensProvider | EncodedTokensProvider): provider is EncodedTokensProvider {\n\treturn provider['tokenizeEncoded'];\n}\n\nfunction isThenable<T>(obj: any): obj is Thenable<T> {\n\tif (typeof obj.then === 'function') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Set the tokens provider for a language (manual implementation).\n */\nexport function setTokensProvider(languageId: string, provider: TokensProvider | EncodedTokensProvider | Thenable<TokensProvider | EncodedTokensProvider>): IDisposable {\n\tlet languageIdentifier = StaticServices.modeService.get().getLanguageIdentifier(languageId);\n\tif (!languageIdentifier) {\n\t\tthrow new Error(`Cannot set tokens provider for unknown language ${languageId}`);\n\t}\n\tconst create = (provider: TokensProvider | EncodedTokensProvider) => {\n\t\tif (isEncodedTokensProvider(provider)) {\n\t\t\treturn new EncodedTokenizationSupport2Adapter(provider);\n\t\t} else {\n\t\t\treturn new TokenizationSupport2Adapter(StaticServices.standaloneThemeService.get(), languageIdentifier!, provider);\n\t\t}\n\t};\n\tif (isThenable<TokensProvider | EncodedTokensProvider>(provider)) {\n\t\treturn modes.TokenizationRegistry.registerPromise(languageId, provider.then(provider => create(provider)));\n\t}\n\treturn modes.TokenizationRegistry.register(languageId, create(provider));\n}\n\n\n/**\n * Set the tokens provider for a language (monarch implementation).\n */\nexport function setMonarchTokensProvider(languageId: string, languageDef: IMonarchLanguage | Thenable<IMonarchLanguage>): IDisposable {\n\tconst create = (languageDef: IMonarchLanguage) => {\n\t\treturn createTokenizationSupport(StaticServices.modeService.get(), StaticServices.standaloneThemeService.get(), languageId, compile(languageId, languageDef));\n\t};\n\tif (isThenable<IMonarchLanguage>(languageDef)) {\n\t\treturn modes.TokenizationRegistry.registerPromise(languageId, languageDef.then(languageDef => create(languageDef)));\n\t}\n\treturn modes.TokenizationRegistry.register(languageId, create(languageDef));\n}\n\n/**\n * Register a reference provider (used by e.g. reference search).\n */\nexport function registerReferenceProvider(languageId: string, provider: modes.ReferenceProvider): IDisposable {\n\treturn modes.ReferenceProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a rename provider (used by e.g. rename symbol).\n */\nexport function registerRenameProvider(languageId: string, provider: modes.RenameProvider): IDisposable {\n\treturn modes.RenameProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a signature help provider (used by e.g. parameter hints).\n */\nexport function registerSignatureHelpProvider(languageId: string, provider: modes.SignatureHelpProvider): IDisposable {\n\treturn modes.SignatureHelpProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a hover provider (used by e.g. editor hover).\n */\nexport function registerHoverProvider(languageId: string, provider: modes.HoverProvider): IDisposable {\n\treturn modes.HoverProviderRegistry.register(languageId, {\n\t\tprovideHover: (model: model.ITextModel, position: Position, token: CancellationToken): Promise<modes.Hover | undefined> => {\n\t\t\tlet word = model.getWordAtPosition(position);\n\n\t\t\treturn Promise.resolve<modes.Hover | null | undefined>(provider.provideHover(model, position, token)).then((value): modes.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(languageId: string, provider: modes.DocumentSymbolProvider): IDisposable {\n\treturn modes.DocumentSymbolProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a document highlight provider (used by e.g. highlight occurrences).\n */\nexport function registerDocumentHighlightProvider(languageId: string, provider: modes.DocumentHighlightProvider): IDisposable {\n\treturn modes.DocumentHighlightProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a definition provider (used by e.g. go to definition).\n */\nexport function registerDefinitionProvider(languageId: string, provider: modes.DefinitionProvider): IDisposable {\n\treturn modes.DefinitionProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a implementation provider (used by e.g. go to implementation).\n */\nexport function registerImplementationProvider(languageId: string, provider: modes.ImplementationProvider): IDisposable {\n\treturn modes.ImplementationProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a type definition provider (used by e.g. go to type definition).\n */\nexport function registerTypeDefinitionProvider(languageId: string, provider: modes.TypeDefinitionProvider): IDisposable {\n\treturn modes.TypeDefinitionProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a code lens provider (used by e.g. inline code lenses).\n */\nexport function registerCodeLensProvider(languageId: string, provider: modes.CodeLensProvider): IDisposable {\n\treturn modes.CodeLensProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a code action provider (used by e.g. quick fix).\n */\nexport function registerCodeActionProvider(languageId: string, provider: CodeActionProvider): IDisposable {\n\treturn modes.CodeActionProviderRegistry.register(languageId, {\n\t\tprovideCodeActions: (model: model.ITextModel, range: Range, context: modes.CodeActionContext, token: CancellationToken): (modes.Command | modes.CodeAction)[] | Promise<(modes.Command | modes.CodeAction)[]> => {\n\t\t\tlet markers = StaticServices.markerService.get().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});\n}\n\n/**\n * Register a formatter that can handle only entire models.\n */\nexport function registerDocumentFormattingEditProvider(languageId: string, provider: modes.DocumentFormattingEditProvider): IDisposable {\n\treturn modes.DocumentFormattingEditProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a formatter that can handle a range inside a model.\n */\nexport function registerDocumentRangeFormattingEditProvider(languageId: string, provider: modes.DocumentRangeFormattingEditProvider): IDisposable {\n\treturn modes.DocumentRangeFormattingEditProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a formatter than can do formatting as the user types.\n */\nexport function registerOnTypeFormattingEditProvider(languageId: string, provider: modes.OnTypeFormattingEditProvider): IDisposable {\n\treturn modes.OnTypeFormattingEditProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a link provider that can find links in text.\n */\nexport function registerLinkProvider(languageId: string, provider: modes.LinkProvider): IDisposable {\n\treturn modes.LinkProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a completion item provider (use by e.g. suggestions).\n */\nexport function registerCompletionItemProvider(languageId: string, provider: modes.CompletionItemProvider): IDisposable {\n\treturn modes.CompletionProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a document color provider (used by Color Picker, Color Decorator).\n */\nexport function registerColorProvider(languageId: string, provider: modes.DocumentColorProvider): IDisposable {\n\treturn modes.ColorProviderRegistry.register(languageId, provider);\n}\n\n/**\n * Register a folding range provider\n */\nexport function registerFoldingRangeProvider(languageId: string, provider: modes.FoldingRangeProvider): IDisposable {\n\treturn modes.FoldingRangeProviderRegistry.register(languageId, 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): (modes.Command | modes.CodeAction)[] | Promise<(modes.Command | modes.CodeAction)[]>;\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\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\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\n\t\t// enums\n\t\tDocumentHighlightKind: standaloneEnums.DocumentHighlightKind,\n\t\tCompletionItemKind: standaloneEnums.CompletionItemKind,\n\t\tCompletionItemInsertTextRule: standaloneEnums.CompletionItemInsertTextRule,\n\t\tSymbolKind: standaloneEnums.SymbolKind,\n\t\tIndentAction: standaloneEnums.IndentAction,\n\t\tCompletionTriggerKind: standaloneEnums.CompletionTriggerKind,\n\t\tSignatureHelpTriggerKind: standaloneEnums.SignatureHelpTriggerKind,\n\n\t\t// classes\n\t\tFoldingRangeKind: modes.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 { EDITOR_DEFAULTS, WrappingIndent } from 'vs/editor/common/config/editorOptions';\nimport { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase';\nimport { createMonacoEditorAPI } from 'vs/editor/standalone/browser/standaloneEditor';\nimport { createMonacoLanguagesAPI } from 'vs/editor/standalone/browser/standaloneLanguages';\n\nconst global: any = self;\n\n// Set defaults for standalone editor\n(<any>EDITOR_DEFAULTS).wrappingIndent = WrappingIndent.None;\n(<any>EDITOR_DEFAULTS.viewInfo).glyphMargin = false;\n(<any>EDITOR_DEFAULTS).autoIndent = false;\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\nglobal.monaco = api;\n\nif (typeof global.require !== 'undefined' && typeof global.require.config === 'function') {\n\tglobal.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-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","\nimport { IWorkspace } from 'vs/platform/workspace/common/workspace';\nimport { URI } from 'vs/base/common/uri';\n\nexport const WORKSPACE_EXTENSION = 'code-workspace';\n\n/**\n * A single folder workspace identifier is just the path to the folder.\n */\nexport type ISingleFolderWorkspaceIdentifier = URI;\n\nexport interface IWorkspaceIdentifier {\n\tid: string;\n\tconfigPath: URI;\n}\n\nexport interface IRawFileWorkspaceFolder {\n}\n\nexport interface IRawUriWorkspaceFolder {\n}\n\nexport type IStoredWorkspaceFolder = IRawFileWorkspaceFolder | IRawUriWorkspaceFolder;\n\nexport function isSingleFolderWorkspaceIdentifier(obj: any): obj is ISingleFolderWorkspaceIdentifier {\n\treturn obj instanceof URI;\n}\n\nexport function toWorkspaceIdentifier(workspace: IWorkspace): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined {\n\tif (workspace.configuration) {\n\t\treturn {\n\t\t\tconfigPath: workspace.configuration,\n\t\t\tid: workspace.id\n\t\t};\n\t}\n\tif (workspace.folders.length === 1) {\n\t\treturn workspace.folders[0].uri;\n\t}\n\n\t// Empty workspace\n\treturn undefined;\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { basename, dirname } from 'vs/base/common/path';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { VariableResolver, Variable, Text } from 'vs/editor/contrib/snippet/snippetParser';\nimport { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';\nimport { getLeadingWhitespace, commonPrefixLength, isFalsyOrWhitespace, pad, endsWith } from 'vs/base/common/strings';\nimport { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';\nimport { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';\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) {\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\tif (value && this._selection.startLineNumber !== this._selection.endLineNumber && 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(marker.value.split(/\\r\\n|\\r|\\n/).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 _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 basename(this._model.uri.fsPath);\n\n\t\t} else if (name === 'TM_FILENAME_BASE') {\n\t\t\tconst name = 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\tconst dir = dirname(this._model.uri.fsPath);\n\t\t\treturn dir !== '.' ? dir : '';\n\n\t\t} else if (name === 'TM_FILEPATH') {\n\t\t\treturn this._model.uri.fsPath;\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nexport class ClipboardBasedVariableResolver implements VariableResolver {\n\n\tconstructor(\n\t\tprivate readonly _clipboardService: IClipboardService,\n\t\tprivate readonly _selectionIdx: number,\n\t\tprivate readonly _selectionCount: number\n\t) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\t\tif (variable.name !== 'CLIPBOARD' || !this._clipboardService) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst text = this._clipboardService.readText();\n\t\tif (!text) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lines = text.split(/\\r\\n|\\n|\\r/).filter(s => !isFalsyOrWhitespace(s));\n\t\tif (lines.length === this._selectionCount) {\n\t\t\treturn lines[this._selectionIdx];\n\t\t} else {\n\t\t\treturn text;\n\t\t}\n\t}\n}\nexport class CommentBasedVariableResolver implements VariableResolver {\n\tconstructor(\n\t\tprivate readonly _model: ITextModel\n\t) {\n\t\t//\n\t}\n\tresolve(variable: Variable): string | undefined {\n\t\tconst { name } = variable;\n\t\tconst language = this._model.getLanguageIdentifier();\n\t\tconst config = LanguageConfigurationRegistry.getComments(language.id);\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\tresolve(variable: Variable): string | undefined {\n\t\tconst { name } = variable;\n\n\t\tif (name === 'CURRENT_YEAR') {\n\t\t\treturn String(new Date().getFullYear());\n\t\t} else if (name === 'CURRENT_YEAR_SHORT') {\n\t\t\treturn String(new Date().getFullYear()).slice(-2);\n\t\t} else if (name === 'CURRENT_MONTH') {\n\t\t\treturn pad((new Date().getMonth().valueOf() + 1), 2);\n\t\t} else if (name === 'CURRENT_DATE') {\n\t\t\treturn pad(new Date().getDate().valueOf(), 2);\n\t\t} else if (name === 'CURRENT_HOUR') {\n\t\t\treturn pad(new Date().getHours().valueOf(), 2);\n\t\t} else if (name === 'CURRENT_MINUTE') {\n\t\t\treturn pad(new Date().getMinutes().valueOf(), 2);\n\t\t} else if (name === 'CURRENT_SECOND') {\n\t\t\treturn pad(new Date().getSeconds().valueOf(), 2);\n\t\t} else if (name === 'CURRENT_DAY_NAME') {\n\t\t\treturn TimeBasedVariableResolver.dayNames[new Date().getDay()];\n\t\t} else if (name === 'CURRENT_DAY_NAME_SHORT') {\n\t\t\treturn TimeBasedVariableResolver.dayNamesShort[new Date().getDay()];\n\t\t} else if (name === 'CURRENT_MONTH_NAME') {\n\t\t\treturn TimeBasedVariableResolver.monthNames[new Date().getMonth()];\n\t\t} else if (name === 'CURRENT_MONTH_NAME_SHORT') {\n\t\t\treturn TimeBasedVariableResolver.monthNamesShort[new Date().getMonth()];\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,\n\t) {\n\t\t//\n\t}\n\n\tresolve(variable: Variable): string | undefined {\n\t\tif (variable.name !== 'WORKSPACE_NAME' || !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 (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) {\n\t\t\treturn basename(workspaceIdentifier.path);\n\t\t}\n\n\t\tlet filename = basename(workspaceIdentifier.configPath.path);\n\t\tif (endsWith(filename, 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}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) 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 { 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 { EditOperation } 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 { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';\nimport { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';\nimport { optional } from 'vs/platform/instantiation/common/instantiation';\nimport { Choice, Placeholder, SnippetParser, Text, TextmateSnippet } from './snippetParser';\nimport { ClipboardBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, CommentBasedVariableResolver, WorkspaceBasedVariableResolver } from './snippetVariables';\nimport { registerThemingParticipant } from 'vs/platform/theme/common/themeService';\nimport * as colors from 'vs/platform/theme/common/colorRegistry';\n\nregisterThemingParticipant((theme, collector) => {\n\n\tfunction getColorGraceful(name: string) {\n\t\tconst color = theme.getColor(name);\n\t\treturn color ? color.toString() : 'transparent';\n\t}\n\n\tcollector.addRule(`.monaco-editor .snippet-placeholder { background-color: ${getColorGraceful(colors.snippetTabstopHighlightBackground)}; outline-color: ${getColorGraceful(colors.snippetTabstopHighlightBorder)}; }`);\n\tcollector.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${getColorGraceful(colors.snippetFinalTabstopHighlightBackground)}; outline-color: ${getColorGraceful(colors.snippetFinalTabstopHighlightBorder)}; }`);\n});\n\nexport class OneSnippet {\n\n\tprivate readonly _editor: IActiveCodeEditor;\n\tprivate readonly _snippet: TextmateSnippet;\n\tprivate readonly _offset: number;\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({ stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges, className: 'snippet-placeholder' }),\n\t\tinactive: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'snippet-placeholder' }),\n\t\tactiveFinal: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'finish-snippet-placeholder' }),\n\t\tinactiveFinal: ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'finish-snippet-placeholder' }),\n\t};\n\n\tconstructor(editor: IActiveCodeEditor, snippet: TextmateSnippet, offset: number) {\n\t\tthis._editor = editor;\n\t\tthis._snippet = snippet;\n\t\tthis._offset = offset;\n\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\tlet toRemove: string[] = [];\n\t\t\tthis._placeholderDecorations.forEach(handle => toRemove.push(handle));\n\t\t\tthis._editor.deltaDecorations(toRemove, []);\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: IIdentifiedSingleEditOperation[] = [];\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\n\t\t\t\t\toperations.push(EditOperation.replaceMove(range, placeholder.transform.resolve(currentValue)));\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 skipThisPlaceholder = false;\n\t\tif (fwd === true && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) {\n\t\t\tthis._placeholderGroupsIdx += 1;\n\t\t\tskipThisPlaceholder = true;\n\n\t\t} else if (fwd === false && this._placeholderGroupsIdx > 0) {\n\t\t\tthis._placeholderGroupsIdx -= 1;\n\t\t\tskipThisPlaceholder = 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\tskipThisPlaceholder = skipThisPlaceholder && (range.isEmpty() && placeholder.toString().length > 0);\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\tthis._placeholderDecorations.forEach((id, placeholder) => {\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 !skipThisPlaceholder ? newSelections : this.move(fwd);\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 class SnippetSession {\n\n\tstatic adjustWhitespace(model: ITextModel, position: IPosition, snippet: TextmateSnippet): void {\n\t\tconst line = model.getLineContent(position.lineNumber);\n\t\tconst lineLeadingWhitespace = getLeadingWhitespace(line, 0, position.column - 1);\n\n\t\tsnippet.walk(marker => {\n\t\t\tif (marker instanceof Text && !(marker.parent instanceof Choice)) {\n\t\t\t\t// adjust indentation of text markers, except for choise elements\n\t\t\t\t// which get adjusted when being selected\n\t\t\t\tconst lines = marker.value.split(/\\r\\n|\\r|\\n/);\n\t\t\t\tfor (let i = 1; i < lines.length; i++) {\n\t\t\t\t\tlet templateLeadingWhitespace = getLeadingWhitespace(lines[i]);\n\t\t\t\t\tlines[i] = model.normalizeIndentation(lineLeadingWhitespace + templateLeadingWhitespace) + lines[i].substr(templateLeadingWhitespace.length);\n\t\t\t\t}\n\t\t\t\tconst newValue = lines.join(model.getEOL());\n\t\t\t\tif (newValue !== marker.value) {\n\t\t\t\t\tmarker.parent.replace(marker, [new Text(newValue)]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\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): { 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 modelBasedVariableResolver = new ModelBasedVariableResolver(model);\n\t\tconst clipboardService = editor.invokeWithinContext(accessor => accessor.get(IClipboardService, optional));\n\t\tconst workspaceService = editor.invokeWithinContext(accessor => accessor.get(IWorkspaceContextService, optional));\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\tif (adjustWhitespace || (idx > 0 && firstLineFirstNonWhitespace !== model.getLineFirstNonWhitespaceColumn(selection.positionLineNumber))) {\n\t\t\t\tSnippetSession.adjustWhitespace(model, start, snippet);\n\t\t\t}\n\n\t\t\tsnippet.resolveVariables(new CompositeSnippetVariableResolver([\n\t\t\t\tmodelBasedVariableResolver,\n\t\t\t\tnew ClipboardBasedVariableResolver(clipboardService, idx, indexedSelections.length),\n\t\t\t\tnew SelectionBasedVariableResolver(model, selection),\n\t\t\t\tnew CommentBasedVariableResolver(model),\n\t\t\t\tnew TimeBasedVariableResolver,\n\t\t\t\tnew WorkspaceBasedVariableResolver(workspaceService),\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\tsnippets[idx] = new OneSnippet(editor, snippet, offset);\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 _overwriteBefore: number;\n\tprivate readonly _overwriteAfter: number;\n\tprivate readonly _adjustWhitespace: boolean;\n\tprivate _snippets: OneSnippet[] = [];\n\n\tconstructor(editor: IActiveCodeEditor, template: string, overwriteBefore: number = 0, overwriteAfter: number = 0, adjustWhitespace: boolean = true) {\n\t\tthis._editor = editor;\n\t\tthis._template = template;\n\t\tthis._overwriteBefore = overwriteBefore;\n\t\tthis._overwriteAfter = overwriteAfter;\n\t\tthis._adjustWhitespace = adjustWhitespace;\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\tconst model = this._editor.getModel();\n\n\t\t// make insert edit and start with first selections\n\t\tconst { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, this._template, this._overwriteBefore, this._overwriteAfter, false, this._adjustWhitespace);\n\t\tthis._snippets = snippets;\n\n\t\tconst selections = model.pushEditOperations(this._editor.getSelections(), 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.map(edit => Selection.fromPositions(edit.range.getEndPosition()));\n\t\t\t}\n\t\t})!;\n\t\tthis._editor.setSelections(selections);\n\t\tthis._editor.revealRange(selections[0]);\n\t}\n\n\tmerge(template: string, overwriteBefore: number = 0, overwriteAfter: number = 0, adjustWhitespace: boolean = true): 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, overwriteBefore, overwriteAfter, true, adjustWhitespace);\n\n\t\tthis._editor.setSelections(this._editor.getModel().pushEditOperations(this._editor.getSelections(), edits, undoEdits => {\n\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 undoEdits.map(edit => Selection.fromPositions(edit.range.getEndPosition()));\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\tpossibleSelections.forEach((ranges, index) => {\n\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\tallPossibleSelections.forEach((ranges, index) => {\n\n\t\t\tif (ranges.length !== selections.length) {\n\t\t\t\tallPossibleSelections.delete(index);\n\t\t\t\treturn;\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\treturn;\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 { dispose, IDisposable } from 'vs/base/common/lifecycle';\nimport { repeat } from 'vs/base/common/strings';\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/modes';\nimport { Choice } from 'vs/editor/contrib/snippet/snippetParser';\nimport { showSimpleSuggestions } from 'vs/editor/contrib/suggest/suggest';\nimport { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';\nimport { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { SnippetSession } from './snippetSession';\n\nexport class SnippetController2 implements IEditorContribution {\n\n\tstatic get(editor: ICodeEditor): SnippetController2 {\n\t\treturn editor.getContribution<SnippetController2>('snippetController2');\n\t}\n\n\tstatic InSnippetMode = new RawContextKey('inSnippetMode', false);\n\tstatic HasNextTabstop = new RawContextKey('hasNextTabstop', false);\n\tstatic HasPrevTabstop = new RawContextKey('hasPrevTabstop', false);\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: IDisposable[] = [];\n\tprivate _modelVersionId: number;\n\tprivate _currentChoice?: Choice;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\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\tdispose(this._session);\n\t}\n\n\tgetId(): string {\n\t\treturn 'snippetController2';\n\t}\n\n\tinsert(\n\t\ttemplate: string,\n\t\toverwriteBefore: number = 0, overwriteAfter: number = 0,\n\t\tundoStopBefore: boolean = true, undoStopAfter: boolean = true,\n\t\tadjustWhitespace: boolean = true,\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, overwriteBefore, overwriteAfter, undoStopBefore, undoStopAfter, adjustWhitespace);\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\toverwriteBefore: number = 0, overwriteAfter: number = 0,\n\t\tundoStopBefore: boolean = true, undoStopAfter: boolean = true,\n\t\tadjustWhitespace: boolean = true,\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 = dispose(this._snippetListener);\n\n\t\tif (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, overwriteBefore, overwriteAfter, adjustWhitespace);\n\t\t\tthis._session.insert();\n\t\t} else {\n\t\t\tthis._session.merge(template, overwriteBefore, overwriteAfter, adjustWhitespace);\n\t\t}\n\n\t\tif (undoStopAfter) {\n\t\t\tthis._editor.getModel().pushStackElement();\n\t\t}\n\n\t\tthis._updateState();\n\n\t\tthis._snippetListener = [\n\t\t\tthis._editor.onDidChangeModelContent(e => e.isFlush && this.cancel()),\n\t\t\tthis._editor.onDidChangeModel(() => this.cancel()),\n\t\t\tthis._editor.onDidChangeCursorSelection(() => this._updateState())\n\t\t];\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\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\tshowSimpleSuggestions(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: repeat('a', 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\tdispose(this._snippetListener);\n\t\tdispose(this._session);\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);\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 { isNonEmptyArray } from 'vs/base/common/arrays';\nimport { TimeoutTimer } from 'vs/base/common/async';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { Emitter, Event } from 'vs/base/common/event';\nimport { IDisposable, dispose } from 'vs/base/common/lifecycle';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Selection } from 'vs/editor/common/core/selection';\nimport { ITextModel, IWordAtPosition } from 'vs/editor/common/model';\nimport { CompletionItemProvider, StandardTokenType, CompletionContext, CompletionProviderRegistry, CompletionTriggerKind, CompletionItemKind, completionKindFromString } from 'vs/editor/common/modes';\nimport { CompletionModel } from './completionModel';\nimport { CompletionItem, getSuggestionComparator, provideSuggestionItems, getSnippetSuggestSupport, SnippetSortOrder, CompletionOptions } from './suggest';\nimport { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { WordDistance } from 'vs/editor/contrib/suggest/wordDistance';\n\nexport interface ICancelEvent {\n\treadonly retrigger: boolean;\n}\n\nexport interface ITriggerEvent {\n\treadonly auto: boolean;\n\treadonly shy: boolean;\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 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\nexport class SuggestModel implements IDisposable {\n\n\tprivate _toDispose: IDisposable[] = [];\n\tprivate _quickSuggestDelay: number;\n\tprivate _triggerCharacterListener: IDisposable;\n\tprivate readonly _triggerQuickSuggest = new TimeoutTimer();\n\tprivate readonly _triggerRefilter = 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;\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\tprivate readonly _editorWorker: IEditorWorkerService\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.push(this._editor.onDidChangeModel(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.push(this._editor.onDidChangeModelLanguage(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis.cancel();\n\t\t}));\n\t\tthis._toDispose.push(this._editor.onDidChangeConfiguration(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateQuickSuggest();\n\t\t}));\n\t\tthis._toDispose.push(CompletionProviderRegistry.onDidChange(() => {\n\t\t\tthis._updateTriggerCharacters();\n\t\t\tthis._updateActiveSuggestSession();\n\t\t}));\n\t\tthis._toDispose.push(this._editor.onDidChangeCursorSelection(e => {\n\t\t\tthis._onCursorChange(e);\n\t\t}));\n\n\t\tlet editorIsComposing = false;\n\t\tthis._toDispose.push(this._editor.onCompositionStart(() => {\n\t\t\teditorIsComposing = true;\n\t\t}));\n\t\tthis._toDispose.push(this._editor.onCompositionEnd(() => {\n\t\t\t// refilter when composition ends\n\t\t\teditorIsComposing = false;\n\t\t\tthis._refilterCompletionItems();\n\t\t}));\n\t\tthis._toDispose.push(this._editor.onDidChangeModelContent(() => {\n\t\t\t// only filter completions when the editor isn't\n\t\t\t// composing a character, e.g. ¨ + u makes ü but just\n\t\t\t// ¨ 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._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerCharacterListener, this._triggerQuickSuggest, this._triggerRefilter]);\n\t\tthis._toDispose = dispose(this._toDispose);\n\t\tdispose(this._completionModel);\n\t\tthis.cancel();\n\t}\n\n\t// --- handle configuration & precondition changes\n\n\tprivate _updateQuickSuggest(): void {\n\t\tthis._quickSuggestDelay = this._editor.getConfiguration().contribInfo.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\n\t\tdispose(this._triggerCharacterListener);\n\n\t\tif (this._editor.getConfiguration().readOnly\n\t\t\t|| !this._editor.hasModel()\n\t\t\t|| !this._editor.getConfiguration().contribInfo.suggestOnTriggerCharacters) {\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst supportsByTriggerCharacter: { [ch: string]: Set<CompletionItemProvider> } = Object.create(null);\n\t\tfor (const support of CompletionProviderRegistry.all(this._editor.getModel())) {\n\t\t\tfor (const ch of support.triggerCharacters || []) {\n\t\t\t\tlet set = supportsByTriggerCharacter[ch];\n\t\t\t\tif (!set) {\n\t\t\t\t\tset = supportsByTriggerCharacter[ch] = new Set();\n\t\t\t\t\tset.add(getSnippetSuggestSupport());\n\t\t\t\t}\n\t\t\t\tset.add(support);\n\t\t\t}\n\t\t}\n\n\t\tthis._triggerCharacterListener = this._editor.onDidType(text => {\n\t\t\tconst lastChar = text.charAt(text.length - 1);\n\t\t\tconst supports = supportsByTriggerCharacter[lastChar];\n\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 items: CompletionItem[] | undefined = this._completionModel ? this._completionModel.adopt(supports) : undefined;\n\t\t\t\tthis.trigger({ auto: true, shy: false, triggerCharacter: lastChar }, Boolean(this._completionModel), supports, items);\n\t\t\t}\n\t\t});\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._triggerRefilter.cancel();\n\t\t\tthis._triggerQuickSuggest.cancel();\n\t\t\tif (this._requestToken) {\n\t\t\t\tthis._requestToken.cancel();\n\t\t\t\tthis._requestToken = undefined;\n\t\t\t}\n\t\t\tthis._state = State.Idle;\n\t\t\tdispose(this._completionModel);\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\tprivate _updateActiveSuggestSession(): void {\n\t\tif (this._state !== State.Idle) {\n\t\t\tif (!this._editor.hasModel() || !CompletionProviderRegistry.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 model = this._editor.getModel();\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\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\tif (this._state !== State.Idle) {\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!CompletionProviderRegistry.has(model)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._state === State.Idle) {\n\n\t\t\tif (this._editor.getConfiguration().contribInfo.quickSuggestions === false) {\n\t\t\t\t// not enabled\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!prevSelection.containsRange(this._currentSelection) && !prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) {\n\t\t\t\t// cursor didn't move RIGHT\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this._editor.getConfiguration().contribInfo.suggest.snippetsPreventQuickSuggestions && SnippetController2.get(this._editor).isInSnippet()) {\n\t\t\t\t// no quick suggestion when in snippet mode\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.cancel();\n\n\t\t\tthis._triggerQuickSuggest.cancelAndSet(() => {\n\t\t\t\tif (!LineContext.shouldAutoTrigger(this._editor)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!this._editor.hasModel()) {\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 pos = this._editor.getPosition();\n\t\t\t\t// validate enabled now\n\t\t\t\tconst { quickSuggestions } = this._editor.getConfiguration().contribInfo;\n\t\t\t\tif (quickSuggestions === false) {\n\t\t\t\t\treturn;\n\t\t\t\t} else if (quickSuggestions === true) {\n\t\t\t\t\t// all good\n\t\t\t\t} else {\n\t\t\t\t\t// Check the type of the token that triggered this\n\t\t\t\t\tmodel.tokenizeIfCheap(pos.lineNumber);\n\t\t\t\t\tconst lineTokens = model.getLineTokens(pos.lineNumber);\n\t\t\t\t\tconst tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0)));\n\t\t\t\t\tconst inValidScope = quickSuggestions.other && tokenType === StandardTokenType.Other\n\t\t\t\t\t\t|| quickSuggestions.comments && tokenType === StandardTokenType.Comment\n\t\t\t\t\t\t|| quickSuggestions.strings && tokenType === StandardTokenType.String;\n\n\t\t\t\t\tif (!inValidScope) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// we made it till here -> trigger now\n\t\t\t\tthis.trigger({ auto: true, shy: false });\n\n\t\t\t}, this._quickSuggestDelay);\n\n\t\t}\n\t}\n\n\tprivate _refilterCompletionItems(): void {\n\t\tif (this._state === State.Idle) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\t// refine active suggestion\n\t\tthis._triggerRefilter.cancelAndSet(() => {\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}, 0);\n\t}\n\n\ttrigger(context: SuggestTriggerContext, retrigger: boolean = false, onlyFrom?: Set<CompletionItemProvider>, existingItems?: CompletionItem[]): 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 });\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;\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} else if (onlyFrom && onlyFrom.size > 0) {\n\t\t\tsuggestCtx = { triggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions };\n\t\t} else {\n\t\t\tsuggestCtx = { triggerKind: CompletionTriggerKind.Invoke };\n\t\t}\n\n\t\tthis._requestToken = new CancellationTokenSource();\n\n\t\t// kind filter and snippet sort rules\n\t\tconst { contribInfo } = this._editor.getConfiguration();\n\t\tlet itemKindFilter = new Set<CompletionItemKind>();\n\t\tlet snippetSortOrder = SnippetSortOrder.Inline;\n\t\tswitch (contribInfo.suggest.snippets) {\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\tcase 'none':\n\t\t\t\titemKindFilter.add(CompletionItemKind.Snippet);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// kind filter\n\t\tfor (const key in contribInfo.suggest.filteredTypes) {\n\t\t\tconst kind = completionKindFromString(key, true);\n\t\t\tif (typeof kind !== 'undefined' && contribInfo.suggest.filteredTypes[key] === false) {\n\t\t\t\titemKindFilter.add(kind);\n\t\t\t}\n\t\t}\n\n\t\tlet wordDistance = WordDistance.create(this._editorWorker, this._editor);\n\n\t\tlet items = provideSuggestionItems(\n\t\t\tmodel,\n\t\t\tthis._editor.getPosition(),\n\t\t\tnew CompletionOptions(snippetSortOrder, itemKindFilter, onlyFrom),\n\t\t\tsuggestCtx,\n\t\t\tthis._requestToken.token\n\t\t);\n\n\t\tPromise.all([items, wordDistance]).then(([items, wordDistance]) => {\n\n\t\t\tdispose(this._requestToken);\n\n\t\t\tif (this._state === State.Idle) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this._editor.hasModel()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst model = this._editor.getModel();\n\n\t\t\tif (isNonEmptyArray(existingItems)) {\n\t\t\t\tconst cmpFn = getSuggestionComparator(snippetSortOrder);\n\t\t\t\titems = items.concat(existingItems).sort(cmpFn);\n\t\t\t}\n\n\t\t\tconst ctx = new LineContext(model, this._editor.getPosition(), auto, context.shy);\n\t\t\tdispose(this._completionModel);\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.getConfiguration().contribInfo.suggest\n\t\t\t);\n\t\t\tthis._onNewContext(ctx);\n\n\t\t}).catch(onUnexpectedError);\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 (ctx.leadingWord.startColumn < this._context.leadingWord.startColumn) {\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.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 adopted = this._completionModel.adopt(incomplete);\n\t\t\tthis.trigger({ auto: this._state === State.Auto, shy: false }, true, incomplete, adopted);\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 { onUnexpectedError } from 'vs/base/common/errors';\nimport { KeyCode, KeyMod } from 'vs/base/common/keyCodes';\nimport { dispose, IDisposable } 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 { EditOperation } from 'vs/editor/common/core/editOperation';\nimport { Range } from 'vs/editor/common/core/range';\nimport { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';\nimport { EditorContextKeys } from 'vs/editor/common/editorContextKeys';\nimport { CompletionItemProvider, CompletionItemInsertTextRule } from 'vs/editor/common/modes';\nimport { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2';\nimport { SnippetParser } from 'vs/editor/contrib/snippet/snippetParser';\nimport { ISuggestMemoryService } from 'vs/editor/contrib/suggest/suggestMemory';\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 { Context as SuggestContext, CompletionItem } from './suggest';\nimport { SuggestAlternatives } from './suggestAlternatives';\nimport { State, SuggestModel } from './suggestModel';\nimport { ISelectedSuggestion, SuggestWidget } from './suggestWidget';\nimport { WordContextKey } from 'vs/editor/contrib/suggest/wordContextKey';\nimport { Event } from 'vs/base/common/event';\nimport { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';\nimport { IdleValue } from 'vs/base/common/async';\nimport { CharacterSet } from 'vs/editor/common/core/characterClassifier';\nimport { isObject } from 'vs/base/common/types';\n\nclass AcceptOnCharacterOracle {\n\n\tprivate _disposables: IDisposable[] = [];\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.push(widget.onDidShow(() => this._onItem(widget.getFocusedItem())));\n\t\tthis._disposables.push(widget.onDidFocus(this._onItem, this));\n\t\tthis._disposables.push(widget.onDidHide(this.reset, this));\n\n\t\tthis._disposables.push(editor.onWillType(text => {\n\t\t\tif (this._active) {\n\t\t\t\tconst ch = text.charCodeAt(text.length - 1);\n\t\t\t\tif (this._active.acceptCharacters.has(ch) && editor.getConfiguration().contribInfo.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\tthis.reset();\n\t\t\treturn;\n\t\t}\n\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\tdispose(this._disposables);\n\t}\n}\n\nexport class SuggestController implements IEditorContribution {\n\n\tprivate static readonly ID: string = 'editor.contrib.suggestController';\n\n\tpublic static get(editor: ICodeEditor): SuggestController {\n\t\treturn editor.getContribution<SuggestController>(SuggestController.ID);\n\t}\n\n\tprivate readonly _model: SuggestModel;\n\tprivate readonly _widget: IdleValue<SuggestWidget>;\n\tprivate readonly _alternatives: IdleValue<SuggestAlternatives>;\n\tprivate _toDispose: IDisposable[] = [];\n\n\tprivate readonly _sticky = false; // for development purposes only\n\n\tconstructor(\n\t\tprivate _editor: ICodeEditor,\n\t\t@IEditorWorkerService editorWorker: IEditorWorkerService,\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) {\n\t\tthis._model = new SuggestModel(this._editor, editorWorker);\n\n\t\tthis._widget = new IdleValue(() => {\n\n\t\t\tconst widget = this._instantiationService.createInstance(SuggestWidget, this._editor);\n\n\t\t\tthis._toDispose.push(widget);\n\t\t\tthis._toDispose.push(widget.onDidSelect(item => this._onDidSelectItem(item, false, true), this));\n\n\t\t\t// Wire up logic to accept a suggestion on certain characters\n\t\t\tconst autoAcceptOracle = new AcceptOnCharacterOracle(this._editor, widget, item => this._onDidSelectItem(item, false, true));\n\t\t\tthis._toDispose.push(\n\t\t\t\tautoAcceptOracle,\n\t\t\t\tthis._model.onDidSuggest(e => {\n\t\t\t\t\tif (e.completionModel.items.length === 0) {\n\t\t\t\t\t\tautoAcceptOracle.reset();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\n\t\t\t// Wire up makes text edit context key\n\t\t\tlet makesTextEdit = SuggestContext.MakesTextEdit.bindTo(this._contextKeyService);\n\t\t\tthis._toDispose.push(widget.onDidFocus(({ item }) => {\n\n\t\t\t\tconst position = this._editor.getPosition()!;\n\t\t\t\tconst startColumn = item.completion.range.startColumn;\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.getConfiguration().contribInfo.acceptSuggestionOnEnter === 'smart'\n\t\t\t\t\t&& this._model.state === State.Auto\n\t\t\t\t\t&& !item.completion.command\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\tmakesTextEdit.set(value);\n\t\t\t}));\n\t\t\tthis._toDispose.push({\n\t\t\t\tdispose() { makesTextEdit.reset(); }\n\t\t\t});\n\n\t\t\treturn widget;\n\t\t});\n\n\t\tthis._alternatives = new IdleValue(() => {\n\t\t\tlet res = new SuggestAlternatives(this._editor, this._contextKeyService);\n\t\t\tthis._toDispose.push(res);\n\t\t\treturn res;\n\t\t});\n\n\t\tthis._toDispose.push(_instantiationService.createInstance(WordContextKey, _editor));\n\n\t\tthis._toDispose.push(this._model.onDidTrigger(e => {\n\t\t\tthis._widget.getValue().showTriggered(e.auto, e.shy ? 250 : 50);\n\t\t}));\n\t\tthis._toDispose.push(this._model.onDidSuggest(e => {\n\t\t\tif (!e.shy) {\n\t\t\t\tlet index = this._memoryService.select(this._editor.getModel()!, this._editor.getPosition()!, e.completionModel.items);\n\t\t\t\tthis._widget.getValue().showSuggestions(e.completionModel, index, e.isFrozen, e.auto);\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.push(this._model.onDidCancel(e => {\n\t\t\tif (this._widget && !e.retrigger) {\n\t\t\t\tthis._widget.getValue().hideWidget();\n\t\t\t}\n\t\t}));\n\t\tthis._toDispose.push(this._editor.onDidBlurEditorWidget(() => {\n\t\t\tif (!this._sticky) {\n\t\t\t\tthis._model.cancel();\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.getConfiguration().contribInfo;\n\t\t\tacceptSuggestionsOnEnter.set(acceptSuggestionOnEnter === 'on' || acceptSuggestionOnEnter === 'smart');\n\t\t};\n\t\tthis._toDispose.push(this._editor.onDidChangeConfiguration((e) => updateFromConfig()));\n\t\tupdateFromConfig();\n\t}\n\n\n\tgetId(): string {\n\t\treturn SuggestController.ID;\n\t}\n\n\tdispose(): void {\n\t\tthis._toDispose = dispose(this._toDispose);\n\t\tthis._widget.dispose();\n\t\tif (this._model) {\n\t\t\tthis._model.dispose();\n\t\t}\n\t}\n\n\tprotected _onDidSelectItem(event: ISelectedSuggestion | undefined, keepAlternativeSuggestions: boolean, undoStops: boolean): void {\n\t\tif (!event || !event.item) {\n\t\t\tthis._alternatives.getValue().reset();\n\t\t\tthis._model.cancel();\n\t\t\treturn;\n\t\t}\n\t\tif (!this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst model = this._editor.getModel();\n\t\tconst modelVersionNow = model.getAlternativeVersionId();\n\t\tconst { completion: suggestion, position } = event.item;\n\t\tconst editorColumn = this._editor.getPosition().column;\n\t\tconst columnDelta = editorColumn - position.column;\n\n\t\t// pushing undo stops *before* additional text edits and\n\t\t// *after* the main edit\n\t\tif (undoStops) {\n\t\t\tthis._editor.pushUndoStop();\n\t\t}\n\n\t\tif (Array.isArray(suggestion.additionalTextEdits)) {\n\t\t\tthis._editor.executeEdits('suggestController.additionalTextEdits', suggestion.additionalTextEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text)));\n\t\t}\n\n\t\t// keep item in memory\n\t\tthis._memoryService.memorize(model, this._editor.getPosition(), event.item);\n\n\t\tlet { insertText } = suggestion;\n\t\tif (!(suggestion.insertTextRules! & CompletionItemInsertTextRule.InsertAsSnippet)) {\n\t\t\tinsertText = SnippetParser.escape(insertText);\n\t\t}\n\n\t\tconst overwriteBefore = position.column - suggestion.range.startColumn;\n\t\tconst overwriteAfter = suggestion.range.endColumn - position.column;\n\n\t\tSnippetController2.get(this._editor).insert(\n\t\t\tinsertText,\n\t\t\toverwriteBefore + columnDelta,\n\t\t\toverwriteAfter,\n\t\t\tfalse, false,\n\t\t\t!(suggestion.insertTextRules! & CompletionItemInsertTextRule.KeepWhitespace)\n\t\t);\n\n\t\tif (undoStops) {\n\t\t\tthis._editor.pushUndoStop();\n\t\t}\n\n\t\tif (!suggestion.command) {\n\t\t\t// done\n\t\t\tthis._model.cancel();\n\n\t\t} else if (suggestion.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\tthis._commandService.executeCommand(suggestion.command.id, ...(suggestion.command.arguments ? [...suggestion.command.arguments] : [])).catch(onUnexpectedError);\n\t\t\tthis._model.cancel();\n\t\t}\n\n\t\tif (keepAlternativeSuggestions) {\n\t\t\tthis._alternatives.getValue().set(event, next => {\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._onDidSelectItem(next, false, false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tthis._alertCompletionItem(event.item);\n\t}\n\n\tprivate _alertCompletionItem({ completion: suggestion }: CompletionItem): void {\n\t\tif (isNonEmptyArray(suggestion.additionalTextEdits)) {\n\t\t\tlet msg = nls.localize('arai.alert.snippet', \"Accepting '{0}' made {1} additional edits\", suggestion.label, suggestion.additionalTextEdits.length);\n\t\t\talert(msg);\n\t\t}\n\t}\n\n\ttriggerSuggest(onlyFrom?: Set<CompletionItemProvider>): void {\n\t\tif (this._editor.hasModel()) {\n\t\t\tthis._model.trigger({ auto: false, shy: false }, false, onlyFrom);\n\t\t\tthis._editor.revealLine(this._editor.getPosition().lineNumber, 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.completion.range.startColumn;\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._onDidSelectItem({ index, item, model: completionModel }, true, false);\n\n\t\t\t}, undefined, listener);\n\t\t});\n\n\t\tthis._model.trigger({ auto: false, shy: true });\n\t\tthis._editor.revealLine(positionNow.lineNumber, ScrollType.Smooth);\n\t\tthis._editor.focus();\n\t}\n\n\tacceptSelectedSuggestion(keepAlternativeSuggestions?: boolean): void {\n\t\tif (this._widget) {\n\t\t\tconst item = this._widget.getValue().getFocusedItem();\n\t\t\tthis._onDidSelectItem(item, !!keepAlternativeSuggestions, true);\n\t\t}\n\t}\n\n\tacceptNextSuggestion() {\n\t\tthis._alternatives.getValue().next();\n\t}\n\n\tacceptPrevSuggestion() {\n\t\tthis._alternatives.getValue().prev();\n\t}\n\n\tcancelSuggestWidget(): void {\n\t\tif (this._widget) {\n\t\t\tthis._model.cancel();\n\t\t\tthis._widget.getValue().hideWidget();\n\t\t}\n\t}\n\n\tselectNextSuggestion(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().selectNext();\n\t\t}\n\t}\n\n\tselectNextPageSuggestion(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().selectNextPage();\n\t\t}\n\t}\n\n\tselectLastSuggestion(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().selectLast();\n\t\t}\n\t}\n\n\tselectPrevSuggestion(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().selectPrevious();\n\t\t}\n\t}\n\n\tselectPrevPageSuggestion(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().selectPreviousPage();\n\t\t}\n\t}\n\n\tselectFirstSuggestion(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().selectFirst();\n\t\t}\n\t}\n\n\ttoggleSuggestionDetails(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().toggleDetails();\n\t\t}\n\t}\n\n\ttoggleSuggestionFocus(): void {\n\t\tif (this._widget) {\n\t\t\tthis._widget.getValue().toggleDetailsFocus();\n\t\t}\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\tmac: { primary: KeyMod.WinCtrl | 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 = SuggestController.get(editor);\n\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontroller.triggerSuggest();\n\t}\n}\n\nregisterEditorContribution(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 => x.acceptSelectedSuggestion(true),\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: 'acceptSelectedSuggestionOnEnter',\n\tprecondition: SuggestContext.Visible,\n\thandler: x => x.acceptSelectedSuggestion(false),\n\tkbOpts: {\n\t\tweight: weight,\n\t\tkbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, SuggestContext.AcceptSuggestionsOnEnter, SuggestContext.MakesTextEdit),\n\t\tprimary: KeyCode.Enter\n\t}\n}));\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.KEY_N] }\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.KEY_P] }\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\tmac: { primary: KeyMod.WinCtrl | KeyCode.Space }\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\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\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\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 * Copyright (c) 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/quickOpen/gotoLine';\nimport 'vs/editor/standalone/browser/quickOpen/quickCommand';\nimport 'vs/editor/standalone/browser/quickOpen/quickOutline';\nimport 'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch';\nimport 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast';\n\nexport * from 'vs/editor/editor.api';\n"]} |