monaco-editor-core 0.56.0-dev-20251125 → 0.56.0-dev-20251218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +34 -6
- package/esm/vs/base/browser/dom.js +1 -4
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +25 -11
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +15 -8
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/findinput/findInput.js +6 -1
- package/esm/vs/base/browser/ui/findinput/findInput.js.map +1 -1
- package/esm/vs/base/browser/ui/inputbox/inputBox.js +17 -1
- package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.css +1 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js +78 -6
- package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +11 -2
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +6 -0
- package/esm/vs/base/common/defaultAccount.js.map +1 -0
- package/esm/vs/base/common/equals.js +73 -24
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +14 -4
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keybindings.js +0 -8
- package/esm/vs/base/common/keybindings.js.map +1 -1
- package/esm/vs/base/common/lifecycle.js +2 -2
- package/esm/vs/base/common/lifecycle.js.map +1 -1
- package/esm/vs/base/common/marshallingIds.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +1 -1
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/product.js.map +1 -1
- package/esm/vs/base/common/strings.js +3 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
- package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/editorWorkerService.js +6 -2
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/view.js +11 -2
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +49 -47
- package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +410 -410
- package/esm/vs/editor/common/config/fontInfo.js +1 -1
- package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +69 -69
- package/esm/vs/editor/common/core/edits/edit.js +19 -0
- package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
- package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
- package/esm/vs/editor/common/core/edits/textEdit.js +0 -3
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
- package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
- package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
- package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
- package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
- package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
- package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
- package/esm/vs/editor/common/languages.js +58 -57
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/decorationProvider.js +21 -1
- package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/model/textModel.js +49 -30
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
- package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
- package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
- package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/textModelEditSource.js +2 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/textModelEvents.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +3 -3
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +71 -53
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +23 -10
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -10
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +50 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -70
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +59 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +152 -95
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +113 -54
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +317 -75
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +25 -27
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +19 -15
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
- package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
- package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +34 -3
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
- package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +11 -5
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/log/common/log.js +1 -1
- package/esm/vs/platform/log/common/log.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +6 -6
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +45 -7
- package/esm/vs/platform/quickinput/browser/quickInput.js +51 -15
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputBox.js +13 -1
- package/esm/vs/platform/quickinput/browser/quickInputBox.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +22 -12
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +17 -12
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +36 -8
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +3 -3
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +8 -4
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
- package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
- package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
- package/esm/vs/platform/window/common/window.js +1 -1
- package/esm/vs/platform/window/common/window.js.map +1 -1
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +34 -3
- package/package.json +2 -2
- package/version.txt +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
- package/esm/vs/platform/product/common/productService.js.map +0 -1
|
@@ -11,72 +11,72 @@ export var EditorContextKeys;
|
|
|
11
11
|
* A context key that is set when the editor's text has focus (cursor is blinking).
|
|
12
12
|
* Is false when focus is in simple editor widgets (repl input, scm commit input).
|
|
13
13
|
*/
|
|
14
|
-
EditorContextKeys.editorTextFocus = new RawContextKey('editorTextFocus', false, nls.localize(
|
|
14
|
+
EditorContextKeys.editorTextFocus = new RawContextKey('editorTextFocus', false, nls.localize(687, "Whether the editor text has focus (cursor is blinking)"));
|
|
15
15
|
/**
|
|
16
16
|
* A context key that is set when the editor's text or an editor's widget has focus.
|
|
17
17
|
*/
|
|
18
|
-
EditorContextKeys.focus = new RawContextKey('editorFocus', false, nls.localize(
|
|
18
|
+
EditorContextKeys.focus = new RawContextKey('editorFocus', false, nls.localize(688, "Whether the editor or an editor widget has focus (e.g. focus is in the find widget)"));
|
|
19
19
|
/**
|
|
20
20
|
* A context key that is set when any editor input has focus (regular editor, repl input...).
|
|
21
21
|
*/
|
|
22
|
-
EditorContextKeys.textInputFocus = new RawContextKey('textInputFocus', false, nls.localize(
|
|
23
|
-
EditorContextKeys.readOnly = new RawContextKey('editorReadonly', false, nls.localize(
|
|
24
|
-
EditorContextKeys.inDiffEditor = new RawContextKey('inDiffEditor', false, nls.localize(
|
|
25
|
-
EditorContextKeys.isEmbeddedDiffEditor = new RawContextKey('isEmbeddedDiffEditor', false, nls.localize(
|
|
26
|
-
EditorContextKeys.inMultiDiffEditor = new RawContextKey('inMultiDiffEditor', false, nls.localize(
|
|
27
|
-
EditorContextKeys.multiDiffEditorAllCollapsed = new RawContextKey('multiDiffEditorAllCollapsed', undefined, nls.localize(
|
|
28
|
-
EditorContextKeys.hasChanges = new RawContextKey('diffEditorHasChanges', false, nls.localize(
|
|
29
|
-
EditorContextKeys.comparingMovedCode = new RawContextKey('comparingMovedCode', false, nls.localize(
|
|
30
|
-
EditorContextKeys.accessibleDiffViewerVisible = new RawContextKey('accessibleDiffViewerVisible', false, nls.localize(
|
|
31
|
-
EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached = new RawContextKey('diffEditorRenderSideBySideInlineBreakpointReached', false, nls.localize(
|
|
32
|
-
EditorContextKeys.diffEditorInlineMode = new RawContextKey('diffEditorInlineMode', false, nls.localize(
|
|
33
|
-
EditorContextKeys.diffEditorOriginalWritable = new RawContextKey('diffEditorOriginalWritable', false, nls.localize(
|
|
34
|
-
EditorContextKeys.diffEditorModifiedWritable = new RawContextKey('diffEditorModifiedWritable', false, nls.localize(
|
|
35
|
-
EditorContextKeys.diffEditorOriginalUri = new RawContextKey('diffEditorOriginalUri', '', nls.localize(
|
|
36
|
-
EditorContextKeys.diffEditorModifiedUri = new RawContextKey('diffEditorModifiedUri', '', nls.localize(
|
|
37
|
-
EditorContextKeys.columnSelection = new RawContextKey('editorColumnSelection', false, nls.localize(
|
|
22
|
+
EditorContextKeys.textInputFocus = new RawContextKey('textInputFocus', false, nls.localize(689, "Whether an editor or a rich text input has focus (cursor is blinking)"));
|
|
23
|
+
EditorContextKeys.readOnly = new RawContextKey('editorReadonly', false, nls.localize(690, "Whether the editor is read-only"));
|
|
24
|
+
EditorContextKeys.inDiffEditor = new RawContextKey('inDiffEditor', false, nls.localize(691, "Whether the context is a diff editor"));
|
|
25
|
+
EditorContextKeys.isEmbeddedDiffEditor = new RawContextKey('isEmbeddedDiffEditor', false, nls.localize(692, "Whether the context is an embedded diff editor"));
|
|
26
|
+
EditorContextKeys.inMultiDiffEditor = new RawContextKey('inMultiDiffEditor', false, nls.localize(693, "Whether the context is a multi diff editor"));
|
|
27
|
+
EditorContextKeys.multiDiffEditorAllCollapsed = new RawContextKey('multiDiffEditorAllCollapsed', undefined, nls.localize(694, "Whether all files in multi diff editor are collapsed"));
|
|
28
|
+
EditorContextKeys.hasChanges = new RawContextKey('diffEditorHasChanges', false, nls.localize(695, "Whether the diff editor has changes"));
|
|
29
|
+
EditorContextKeys.comparingMovedCode = new RawContextKey('comparingMovedCode', false, nls.localize(696, "Whether a moved code block is selected for comparison"));
|
|
30
|
+
EditorContextKeys.accessibleDiffViewerVisible = new RawContextKey('accessibleDiffViewerVisible', false, nls.localize(697, "Whether the accessible diff viewer is visible"));
|
|
31
|
+
EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached = new RawContextKey('diffEditorRenderSideBySideInlineBreakpointReached', false, nls.localize(698, "Whether the diff editor render side by side inline breakpoint is reached"));
|
|
32
|
+
EditorContextKeys.diffEditorInlineMode = new RawContextKey('diffEditorInlineMode', false, nls.localize(699, "Whether inline mode is active"));
|
|
33
|
+
EditorContextKeys.diffEditorOriginalWritable = new RawContextKey('diffEditorOriginalWritable', false, nls.localize(700, "Whether modified is writable in the diff editor"));
|
|
34
|
+
EditorContextKeys.diffEditorModifiedWritable = new RawContextKey('diffEditorModifiedWritable', false, nls.localize(701, "Whether modified is writable in the diff editor"));
|
|
35
|
+
EditorContextKeys.diffEditorOriginalUri = new RawContextKey('diffEditorOriginalUri', '', nls.localize(702, "The uri of the original document"));
|
|
36
|
+
EditorContextKeys.diffEditorModifiedUri = new RawContextKey('diffEditorModifiedUri', '', nls.localize(703, "The uri of the modified document"));
|
|
37
|
+
EditorContextKeys.columnSelection = new RawContextKey('editorColumnSelection', false, nls.localize(704, "Whether `editor.columnSelection` is enabled"));
|
|
38
38
|
EditorContextKeys.writable = EditorContextKeys.readOnly.toNegated();
|
|
39
|
-
EditorContextKeys.hasNonEmptySelection = new RawContextKey('editorHasSelection', false, nls.localize(
|
|
39
|
+
EditorContextKeys.hasNonEmptySelection = new RawContextKey('editorHasSelection', false, nls.localize(705, "Whether the editor has text selected"));
|
|
40
40
|
EditorContextKeys.hasOnlyEmptySelection = EditorContextKeys.hasNonEmptySelection.toNegated();
|
|
41
|
-
EditorContextKeys.hasMultipleSelections = new RawContextKey('editorHasMultipleSelections', false, nls.localize(
|
|
41
|
+
EditorContextKeys.hasMultipleSelections = new RawContextKey('editorHasMultipleSelections', false, nls.localize(706, "Whether the editor has multiple selections"));
|
|
42
42
|
EditorContextKeys.hasSingleSelection = EditorContextKeys.hasMultipleSelections.toNegated();
|
|
43
|
-
EditorContextKeys.tabMovesFocus = new RawContextKey('editorTabMovesFocus', false, nls.localize(
|
|
43
|
+
EditorContextKeys.tabMovesFocus = new RawContextKey('editorTabMovesFocus', false, nls.localize(707, "Whether `Tab` will move focus out of the editor"));
|
|
44
44
|
EditorContextKeys.tabDoesNotMoveFocus = EditorContextKeys.tabMovesFocus.toNegated();
|
|
45
45
|
EditorContextKeys.isInEmbeddedEditor = new RawContextKey('isInEmbeddedEditor', false, true);
|
|
46
46
|
EditorContextKeys.canUndo = new RawContextKey('canUndo', false, true);
|
|
47
47
|
EditorContextKeys.canRedo = new RawContextKey('canRedo', false, true);
|
|
48
|
-
EditorContextKeys.hoverVisible = new RawContextKey('editorHoverVisible', false, nls.localize(
|
|
49
|
-
EditorContextKeys.hoverFocused = new RawContextKey('editorHoverFocused', false, nls.localize(
|
|
50
|
-
EditorContextKeys.stickyScrollFocused = new RawContextKey('stickyScrollFocused', false, nls.localize(
|
|
51
|
-
EditorContextKeys.stickyScrollVisible = new RawContextKey('stickyScrollVisible', false, nls.localize(
|
|
52
|
-
EditorContextKeys.standaloneColorPickerVisible = new RawContextKey('standaloneColorPickerVisible', false, nls.localize(
|
|
53
|
-
EditorContextKeys.standaloneColorPickerFocused = new RawContextKey('standaloneColorPickerFocused', false, nls.localize(
|
|
48
|
+
EditorContextKeys.hoverVisible = new RawContextKey('editorHoverVisible', false, nls.localize(708, "Whether the editor hover is visible"));
|
|
49
|
+
EditorContextKeys.hoverFocused = new RawContextKey('editorHoverFocused', false, nls.localize(709, "Whether the editor hover is focused"));
|
|
50
|
+
EditorContextKeys.stickyScrollFocused = new RawContextKey('stickyScrollFocused', false, nls.localize(710, "Whether the sticky scroll is focused"));
|
|
51
|
+
EditorContextKeys.stickyScrollVisible = new RawContextKey('stickyScrollVisible', false, nls.localize(711, "Whether the sticky scroll is visible"));
|
|
52
|
+
EditorContextKeys.standaloneColorPickerVisible = new RawContextKey('standaloneColorPickerVisible', false, nls.localize(712, "Whether the standalone color picker is visible"));
|
|
53
|
+
EditorContextKeys.standaloneColorPickerFocused = new RawContextKey('standaloneColorPickerFocused', false, nls.localize(713, "Whether the standalone color picker is focused"));
|
|
54
54
|
/**
|
|
55
55
|
* A context key that is set when an editor is part of a larger editor, like notebooks or
|
|
56
56
|
* (future) a diff editor
|
|
57
57
|
*/
|
|
58
|
-
EditorContextKeys.inCompositeEditor = new RawContextKey('inCompositeEditor', undefined, nls.localize(
|
|
58
|
+
EditorContextKeys.inCompositeEditor = new RawContextKey('inCompositeEditor', undefined, nls.localize(714, "Whether the editor is part of a larger editor (e.g. notebooks)"));
|
|
59
59
|
EditorContextKeys.notInCompositeEditor = EditorContextKeys.inCompositeEditor.toNegated();
|
|
60
60
|
// -- mode context keys
|
|
61
|
-
EditorContextKeys.languageId = new RawContextKey('editorLangId', '', nls.localize(
|
|
62
|
-
EditorContextKeys.hasCompletionItemProvider = new RawContextKey('editorHasCompletionItemProvider', false, nls.localize(
|
|
63
|
-
EditorContextKeys.hasCodeActionsProvider = new RawContextKey('editorHasCodeActionsProvider', false, nls.localize(
|
|
64
|
-
EditorContextKeys.hasCodeLensProvider = new RawContextKey('editorHasCodeLensProvider', false, nls.localize(
|
|
65
|
-
EditorContextKeys.hasDefinitionProvider = new RawContextKey('editorHasDefinitionProvider', false, nls.localize(
|
|
66
|
-
EditorContextKeys.hasDeclarationProvider = new RawContextKey('editorHasDeclarationProvider', false, nls.localize(
|
|
67
|
-
EditorContextKeys.hasImplementationProvider = new RawContextKey('editorHasImplementationProvider', false, nls.localize(
|
|
68
|
-
EditorContextKeys.hasTypeDefinitionProvider = new RawContextKey('editorHasTypeDefinitionProvider', false, nls.localize(
|
|
69
|
-
EditorContextKeys.hasHoverProvider = new RawContextKey('editorHasHoverProvider', false, nls.localize(
|
|
70
|
-
EditorContextKeys.hasDocumentHighlightProvider = new RawContextKey('editorHasDocumentHighlightProvider', false, nls.localize(
|
|
71
|
-
EditorContextKeys.hasDocumentSymbolProvider = new RawContextKey('editorHasDocumentSymbolProvider', false, nls.localize(
|
|
72
|
-
EditorContextKeys.hasReferenceProvider = new RawContextKey('editorHasReferenceProvider', false, nls.localize(
|
|
73
|
-
EditorContextKeys.hasRenameProvider = new RawContextKey('editorHasRenameProvider', false, nls.localize(
|
|
74
|
-
EditorContextKeys.hasSignatureHelpProvider = new RawContextKey('editorHasSignatureHelpProvider', false, nls.localize(
|
|
75
|
-
EditorContextKeys.hasInlayHintsProvider = new RawContextKey('editorHasInlayHintsProvider', false, nls.localize(
|
|
61
|
+
EditorContextKeys.languageId = new RawContextKey('editorLangId', '', nls.localize(715, "The language identifier of the editor"));
|
|
62
|
+
EditorContextKeys.hasCompletionItemProvider = new RawContextKey('editorHasCompletionItemProvider', false, nls.localize(716, "Whether the editor has a completion item provider"));
|
|
63
|
+
EditorContextKeys.hasCodeActionsProvider = new RawContextKey('editorHasCodeActionsProvider', false, nls.localize(717, "Whether the editor has a code actions provider"));
|
|
64
|
+
EditorContextKeys.hasCodeLensProvider = new RawContextKey('editorHasCodeLensProvider', false, nls.localize(718, "Whether the editor has a code lens provider"));
|
|
65
|
+
EditorContextKeys.hasDefinitionProvider = new RawContextKey('editorHasDefinitionProvider', false, nls.localize(719, "Whether the editor has a definition provider"));
|
|
66
|
+
EditorContextKeys.hasDeclarationProvider = new RawContextKey('editorHasDeclarationProvider', false, nls.localize(720, "Whether the editor has a declaration provider"));
|
|
67
|
+
EditorContextKeys.hasImplementationProvider = new RawContextKey('editorHasImplementationProvider', false, nls.localize(721, "Whether the editor has an implementation provider"));
|
|
68
|
+
EditorContextKeys.hasTypeDefinitionProvider = new RawContextKey('editorHasTypeDefinitionProvider', false, nls.localize(722, "Whether the editor has a type definition provider"));
|
|
69
|
+
EditorContextKeys.hasHoverProvider = new RawContextKey('editorHasHoverProvider', false, nls.localize(723, "Whether the editor has a hover provider"));
|
|
70
|
+
EditorContextKeys.hasDocumentHighlightProvider = new RawContextKey('editorHasDocumentHighlightProvider', false, nls.localize(724, "Whether the editor has a document highlight provider"));
|
|
71
|
+
EditorContextKeys.hasDocumentSymbolProvider = new RawContextKey('editorHasDocumentSymbolProvider', false, nls.localize(725, "Whether the editor has a document symbol provider"));
|
|
72
|
+
EditorContextKeys.hasReferenceProvider = new RawContextKey('editorHasReferenceProvider', false, nls.localize(726, "Whether the editor has a reference provider"));
|
|
73
|
+
EditorContextKeys.hasRenameProvider = new RawContextKey('editorHasRenameProvider', false, nls.localize(727, "Whether the editor has a rename provider"));
|
|
74
|
+
EditorContextKeys.hasSignatureHelpProvider = new RawContextKey('editorHasSignatureHelpProvider', false, nls.localize(728, "Whether the editor has a signature help provider"));
|
|
75
|
+
EditorContextKeys.hasInlayHintsProvider = new RawContextKey('editorHasInlayHintsProvider', false, nls.localize(729, "Whether the editor has an inline hints provider"));
|
|
76
76
|
// -- mode context keys: formatting
|
|
77
|
-
EditorContextKeys.hasDocumentFormattingProvider = new RawContextKey('editorHasDocumentFormattingProvider', false, nls.localize(
|
|
78
|
-
EditorContextKeys.hasDocumentSelectionFormattingProvider = new RawContextKey('editorHasDocumentSelectionFormattingProvider', false, nls.localize(
|
|
79
|
-
EditorContextKeys.hasMultipleDocumentFormattingProvider = new RawContextKey('editorHasMultipleDocumentFormattingProvider', false, nls.localize(
|
|
80
|
-
EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider = new RawContextKey('editorHasMultipleDocumentSelectionFormattingProvider', false, nls.localize(
|
|
77
|
+
EditorContextKeys.hasDocumentFormattingProvider = new RawContextKey('editorHasDocumentFormattingProvider', false, nls.localize(730, "Whether the editor has a document formatting provider"));
|
|
78
|
+
EditorContextKeys.hasDocumentSelectionFormattingProvider = new RawContextKey('editorHasDocumentSelectionFormattingProvider', false, nls.localize(731, "Whether the editor has a document selection formatting provider"));
|
|
79
|
+
EditorContextKeys.hasMultipleDocumentFormattingProvider = new RawContextKey('editorHasMultipleDocumentFormattingProvider', false, nls.localize(732, "Whether the editor has multiple document formatting providers"));
|
|
80
|
+
EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider = new RawContextKey('editorHasMultipleDocumentSelectionFormattingProvider', false, nls.localize(733, "Whether the editor has multiple document selection formatting providers"));
|
|
81
81
|
})(EditorContextKeys || (EditorContextKeys = {}));
|
|
82
82
|
//# sourceMappingURL=editorContextKeys.js.map
|
|
@@ -106,11 +106,11 @@ function computeColors(model) {
|
|
|
106
106
|
colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
|
|
107
107
|
}
|
|
108
108
|
else if (colorScheme === 'hsl') {
|
|
109
|
-
const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100
|
|
109
|
+
const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;
|
|
110
110
|
colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
|
|
111
111
|
}
|
|
112
112
|
else if (colorScheme === 'hsla') {
|
|
113
|
-
const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100
|
|
113
|
+
const regexParameters = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100(?:\.0+)?|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;
|
|
114
114
|
colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
|
|
115
115
|
}
|
|
116
116
|
else if (colorScheme === '#') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/defaultDocumentColorsComputer.ts","vs/editor/common/languages/defaultDocumentColorsComputer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAW5D,SAAS,mBAAmB,CAAC,aAAuC;IACnE,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,YAAY,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IAAI,gBAAgB,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC/B,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAmC;IAC/E,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAC9F,kBAAkB;QAClB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","file":"defaultDocumentColorsComputer.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(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 *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(model);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/defaultDocumentColorsComputer.ts","vs/editor/common/languages/defaultDocumentColorsComputer.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,KAAK,EAAE,IAAI,EA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,gBAAgB,GAAG,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,GAAG,eAAe,CAAC,CAAC;YAC7G,CAAC;YACD,IAAI,gBAAgB,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC/B,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAmC;IAC/E,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAC9F,kBAAkB;QAClB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","file":"defaultDocumentColorsComputer.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(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 *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nimport { IPosition } from '../core/position.js';\nimport { IRange } from '../core/range.js';\nimport { IColor, IColorInformation } from '../languages.js';\n\nexport interface IDocumentColorComputerTarget {\n\tgetValue(): string;\n\tpositionAt(offset: number): IPosition;\n\tfindMatches(regex: RegExp): RegExpMatchArray[];\n}\n\nfunction _parseCaptureGroups(captureGroups: IterableIterator<string>) {\n\tconst values = [];\n\tfor (const captureGroup of captureGroups) {\n\t\tconst parsedNumber = Number(captureGroup);\n\t\tif (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n\t\t\tvalues.push(parsedNumber);\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction _toIColor(r: number, g: number, b: number, a: number): IColor {\n\treturn {\n\t\tred: r / 255,\n\t\tblue: b / 255,\n\t\tgreen: g / 255,\n\t\talpha: a\n\t};\n}\n\nfunction _findRange(model: IDocumentColorComputerTarget, match: RegExpMatchArray): IRange | undefined {\n\tconst index = match.index;\n\tconst length = match[0].length;\n\tif (index === undefined) {\n\t\treturn;\n\t}\n\tconst startPosition = model.positionAt(index);\n\tconst range: IRange = {\n\t\tstartLineNumber: startPosition.lineNumber,\n\t\tstartColumn: startPosition.column,\n\t\tendLineNumber: startPosition.lineNumber,\n\t\tendColumn: startPosition.column + length\n\t};\n\treturn range;\n}\n\nfunction _findHexColorInformation(range: IRange | undefined, hexValue: string) {\n\tif (!range) {\n\t\treturn;\n\t}\n\tconst parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n\tif (!parsedHexColor) {\n\t\treturn;\n\t}\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n\t};\n}\n\nfunction _findRGBColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n\t};\n}\n\nfunction _findHSLColorInformation(range: IRange | undefined, matches: RegExpMatchArray[], isAlpha: boolean) {\n\tif (!range || matches.length !== 1) {\n\t\treturn;\n\t}\n\tconst match = matches[0];\n\tconst captureGroups = match.values();\n\tconst parsedRegex = _parseCaptureGroups(captureGroups);\n\tconst colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n\treturn {\n\t\trange: range,\n\t\tcolor: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n\t};\n}\n\nfunction _findMatches(model: IDocumentColorComputerTarget | string, regex: RegExp): RegExpMatchArray[] {\n\tif (typeof model === 'string') {\n\t\treturn [...model.matchAll(regex)];\n\t} else {\n\t\treturn model.findMatches(regex);\n\t}\n}\n\nfunction computeColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tconst result: IColorInformation[] = [];\n\t// Early validation for RGB and HSL\n\tconst initialValidationRegex = /\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['\"\\s])(#)([A-Fa-f0-9]{8})\\b/gm;\n\tconst initialValidationMatches = _findMatches(model, initialValidationRegex);\n\n\t// Potential colors have been found, validate the parameters\n\tif (initialValidationMatches.length > 0) {\n\t\tfor (const initialMatch of initialValidationMatches) {\n\t\t\tconst initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n\t\t\tconst colorScheme = initialCaptureGroups[1];\n\t\t\tconst colorParameters = initialCaptureGroups[2];\n\t\t\tif (!colorParameters) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet colorInformation;\n\t\t\tif (colorScheme === 'rgb') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'rgba') {\n\t\t\t\tconst regexParameters = /^\\(\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === 'hsl') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n\t\t\t} else if (colorScheme === 'hsla') {\n\t\t\t\tconst regexParameters = /^\\(\\s*((?:360(?:\\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\\.\\d+)?))\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(100(?:\\.0+)?|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*[\\s,]\\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\\s*\\)$/gm;\n\t\t\t\tcolorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n\t\t\t} else if (colorScheme === '#') {\n\t\t\t\tcolorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n\t\t\t}\n\t\t\tif (colorInformation) {\n\t\t\t\tresult.push(colorInformation);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model: IDocumentColorComputerTarget): IColorInformation[] {\n\tif (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn computeColors(model);\n}\n"]}
|
|
@@ -44,7 +44,7 @@ export const PLAINTEXT_EXTENSION = '.txt';
|
|
|
44
44
|
ModesRegistry.registerLanguage({
|
|
45
45
|
id: PLAINTEXT_LANGUAGE_ID,
|
|
46
46
|
extensions: [PLAINTEXT_EXTENSION],
|
|
47
|
-
aliases: [nls.localize(
|
|
47
|
+
aliases: [nls.localize(790, "Plain Text"), 'text'],
|
|
48
48
|
mimetypes: [Mimes.text]
|
|
49
49
|
});
|
|
50
50
|
Registry.as(ConfigurationExtensions.Configuration)
|
|
@@ -22,6 +22,6 @@ export function nullTokenizeEncoded(languageId, state) {
|
|
|
22
22
|
| (0 /* FontStyle.None */ << 11 /* MetadataConsts.FONT_STYLE_OFFSET */)
|
|
23
23
|
| (1 /* ColorId.DefaultForeground */ << 15 /* MetadataConsts.FOREGROUND_OFFSET */)
|
|
24
24
|
| (2 /* ColorId.DefaultBackground */ << 24 /* MetadataConsts.BACKGROUND_OFFSET */)) >>> 0;
|
|
25
|
-
return new EncodedTokenizationResult(tokens, state === null ? NullState : state);
|
|
25
|
+
return new EncodedTokenizationResult(tokens, [], state === null ? NullState : state);
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=nullTokenize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/nullTokenize.ts","vs/editor/common/languages/nullTokenize.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAU,MAAM,iBAAiB,CAAC;AAG/F,MAAM,CAAC,MAAM,SAAS,GAAW,IAAI;IAC7B,KAAK;QACX,OAAO,IAAI,CAAC;IACb,CAAC;IACM,MAAM,CAAC,KAAa;QAC1B,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IACzB,CAAC;CACD,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,UAAkB,EAAE,KAAa;IAC7D,OAAO,IAAI,kBAAkB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAsB,EAAE,KAAoB;IAC/E,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACd,MAAM,CAAC,CAAC,CAAC,GAAG,CACX,CAAC,UAAU,4CAAoC,CAAC;UAC9C,CAAC,2EAA2D,CAAC;UAC7D,CAAC,mEAAkD,CAAC;UACpD,CAAC,8EAA6D,CAAC;UAC/D,CAAC,8EAA6D,CAAC,CACjE,KAAK,CAAC,CAAC;IAER,OAAO,IAAI,yBAAyB,CAAC,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/nullTokenize.ts","vs/editor/common/languages/nullTokenize.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAU,MAAM,iBAAiB,CAAC;AAG/F,MAAM,CAAC,MAAM,SAAS,GAAW,IAAI;IAC7B,KAAK;QACX,OAAO,IAAI,CAAC;IACb,CAAC;IACM,MAAM,CAAC,KAAa;QAC1B,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IACzB,CAAC;CACD,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,UAAkB,EAAE,KAAa;IAC7D,OAAO,IAAI,kBAAkB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAsB,EAAE,KAAoB;IAC/E,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACd,MAAM,CAAC,CAAC,CAAC,GAAG,CACX,CAAC,UAAU,4CAAoC,CAAC;UAC9C,CAAC,2EAA2D,CAAC;UAC7D,CAAC,mEAAkD,CAAC;UACpD,CAAC,8EAA6D,CAAC;UAC/D,CAAC,8EAA6D,CAAC,CACjE,KAAK,CAAC,CAAC;IAER,OAAO,IAAI,yBAAyB,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC","file":"nullTokenize.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Token, TokenizationResult, EncodedTokenizationResult, IState } from '../languages.js';\nimport { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../encodedTokenAttributes.js';\n\nexport const NullState: IState = new class implements IState {\n\tpublic clone(): IState {\n\t\treturn this;\n\t}\n\tpublic equals(other: IState): boolean {\n\t\treturn (this === other);\n\t}\n};\n\nexport function nullTokenize(languageId: string, state: IState): TokenizationResult {\n\treturn new TokenizationResult([new Token(0, '', languageId)], state);\n}\n\nexport function nullTokenizeEncoded(languageId: LanguageId, state: IState | null): EncodedTokenizationResult {\n\tconst tokens = new Uint32Array(2);\n\ttokens[0] = 0;\n\ttokens[1] = (\n\t\t(languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t| (StandardTokenType.Other << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t| (FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t) >>> 0;\n\n\treturn new EncodedTokenizationResult(tokens, [], state === null ? NullState : state);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Token, TokenizationResult, EncodedTokenizationResult, IState } from '../languages.js';\nimport { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../encodedTokenAttributes.js';\n\nexport const NullState: IState = new class implements IState {\n\tpublic clone(): IState {\n\t\treturn this;\n\t}\n\tpublic equals(other: IState): boolean {\n\t\treturn (this === other);\n\t}\n};\n\nexport function nullTokenize(languageId: string, state: IState): TokenizationResult {\n\treturn new TokenizationResult([new Token(0, '', languageId)], state);\n}\n\nexport function nullTokenizeEncoded(languageId: LanguageId, state: IState | null): EncodedTokenizationResult {\n\tconst tokens = new Uint32Array(2);\n\ttokens[0] = 0;\n\ttokens[1] = (\n\t\t(languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t| (StandardTokenType.Other << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t| (FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)\n\t) >>> 0;\n\n\treturn new EncodedTokenizationResult(tokens, [], state === null ? NullState : state);\n}\n"]}
|
|
@@ -282,4 +282,7 @@ export function generateTokensCSSForColorMap(colorMap) {
|
|
|
282
282
|
rules.push('.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }');
|
|
283
283
|
return rules.join('\n');
|
|
284
284
|
}
|
|
285
|
+
export function classNameForFontTokenDecorations(fontFamily, fontSize) {
|
|
286
|
+
return `font-decoration-${fontFamily.toLowerCase()}-${fontSize.toLowerCase()}`;
|
|
287
|
+
}
|
|
285
288
|
//# sourceMappingURL=tokenization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/supports/tokenization.ts","vs/editor/common/languages/supports/tokenization.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAUzD,MAAM,OAAO,oBAAoB;IAahC,YACC,KAAa,EACb,KAAa,EACb,SAAiB,EACjB,UAAyB,EACzB,UAAyB;QAjB1B,0BAAqB,GAAS,SAAS,CAAC;QAmBvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAyB;IACxD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,SAAS,4BAA2B,CAAC;QACzC,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YACzC,SAAS,yBAAiB,CAAC;YAE3B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AAC;AACzB,CAAC","file":"tokenization.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Color } from '../../../../base/common/color.js';\nimport { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../../encodedTokenAttributes.js';\n\nexport interface ITokenThemeRule {\n\ttoken: string;\n\tforeground?: string;\n\tbackground?: string;\n\tfontStyle?: string;\n}\n\nexport class ParsedTokenThemeRule {\n\t_parsedThemeRuleBrand: void = undefined;\n\n\treadonly token: string;\n\treadonly index: number;\n\n\t/**\n\t * -1 if not set. An or mask of `FontStyle` otherwise.\n\t */\n\treadonly fontStyle: FontStyle;\n\treadonly foreground: string | null;\n\treadonly background: string | null;\n\n\tconstructor(\n\t\ttoken: string,\n\t\tindex: number,\n\t\tfontStyle: number,\n\t\tforeground: string | null,\n\t\tbackground: string | null,\n\t) {\n\t\tthis.token = token;\n\t\tthis.index = index;\n\t\tthis.fontStyle = fontStyle;\n\t\tthis.foreground = foreground;\n\t\tthis.background = background;\n\t}\n}\n\n/**\n * Parse a raw theme into rules.\n */\nexport function parseTokenTheme(source: ITokenThemeRule[]): ParsedTokenThemeRule[] {\n\tif (!source || !Array.isArray(source)) {\n\t\treturn [];\n\t}\n\tconst result: ParsedTokenThemeRule[] = [];\n\tlet resultLen = 0;\n\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\tconst entry = source[i];\n\n\t\tlet fontStyle: number = FontStyle.NotSet;\n\t\tif (typeof entry.fontStyle === 'string') {\n\t\t\tfontStyle = FontStyle.None;\n\n\t\t\tconst segments = entry.fontStyle.split(' ');\n\t\t\tfor (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n\t\t\t\tconst segment = segments[j];\n\t\t\t\tswitch (segment) {\n\t\t\t\t\tcase 'italic':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Italic;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bold':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Bold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'underline':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Underline;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strikethrough':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Strikethrough;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet foreground: string | null = null;\n\t\tif (typeof entry.foreground === 'string') {\n\t\t\tforeground = entry.foreground;\n\t\t}\n\n\t\tlet background: string | null = null;\n\t\tif (typeof entry.background === 'string') {\n\t\t\tbackground = entry.background;\n\t\t}\n\n\t\tresult[resultLen++] = new ParsedTokenThemeRule(\n\t\t\tentry.token || '',\n\t\t\ti,\n\t\t\tfontStyle,\n\t\t\tforeground,\n\t\t\tbackground\n\t\t);\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve rules (i.e. inheritance).\n */\nfunction resolveParsedTokenThemeRules(parsedThemeRules: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\n\t// Sort rules lexicographically, and then by index if necessary\n\tparsedThemeRules.sort((a, b) => {\n\t\tconst r = strcmp(a.token, b.token);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\t\treturn a.index - b.index;\n\t});\n\n\t// Determine defaults\n\tlet defaultFontStyle = FontStyle.None;\n\tlet defaultForeground = '000000';\n\tlet defaultBackground = 'ffffff';\n\twhile (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === '') {\n\t\tconst incomingDefaults = parsedThemeRules.shift()!;\n\t\tif (incomingDefaults.fontStyle !== FontStyle.NotSet) {\n\t\t\tdefaultFontStyle = incomingDefaults.fontStyle;\n\t\t}\n\t\tif (incomingDefaults.foreground !== null) {\n\t\t\tdefaultForeground = incomingDefaults.foreground;\n\t\t}\n\t\tif (incomingDefaults.background !== null) {\n\t\t\tdefaultBackground = incomingDefaults.background;\n\t\t}\n\t}\n\tconst colorMap = new ColorMap();\n\n\t// start with token colors from custom token themes\n\tfor (const color of customTokenColors) {\n\t\tcolorMap.getId(color);\n\t}\n\n\n\tconst foregroundColorId = colorMap.getId(defaultForeground);\n\tconst backgroundColorId = colorMap.getId(defaultBackground);\n\n\tconst defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId);\n\tconst root = new ThemeTrieElement(defaults);\n\tfor (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n\t\tconst rule = parsedThemeRules[i];\n\t\troot.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background));\n\t}\n\n\treturn new TokenTheme(colorMap, root);\n}\n\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\nexport class ColorMap {\n\n\tprivate _lastColorId: number;\n\tprivate readonly _id2color: Color[];\n\tprivate readonly _color2id: Map<string, ColorId>;\n\n\tconstructor() {\n\t\tthis._lastColorId = 0;\n\t\tthis._id2color = [];\n\t\tthis._color2id = new Map<string, ColorId>();\n\t}\n\n\tpublic getId(color: string | null): ColorId {\n\t\tif (color === null) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst match = color.match(colorRegExp);\n\t\tif (!match) {\n\t\t\tthrow new Error('Illegal value for token color: ' + color);\n\t\t}\n\t\tcolor = match[1].toUpperCase();\n\t\tlet value = this._color2id.get(color);\n\t\tif (value) {\n\t\t\treturn value;\n\t\t}\n\t\tvalue = ++this._lastColorId;\n\t\tthis._color2id.set(color, value);\n\t\tthis._id2color[value] = Color.fromHex('#' + color);\n\t\treturn value;\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._id2color.slice(0);\n\t}\n\n}\n\nexport class TokenTheme {\n\n\tpublic static createFromRawTokenTheme(source: ITokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors);\n\t}\n\n\tpublic static createFromParsedTokenTheme(source: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn resolveParsedTokenThemeRules(source, customTokenColors);\n\t}\n\n\tprivate readonly _colorMap: ColorMap;\n\tprivate readonly _root: ThemeTrieElement;\n\tprivate readonly _cache: Map<string, number>;\n\n\tconstructor(colorMap: ColorMap, root: ThemeTrieElement) {\n\t\tthis._colorMap = colorMap;\n\t\tthis._root = root;\n\t\tthis._cache = new Map<string, number>();\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._colorMap.getColorMap();\n\t}\n\n\tpublic _match(token: string): ThemeTrieElementRule {\n\t\treturn this._root.match(token);\n\t}\n\n\tpublic match(languageId: LanguageId, token: string): number {\n\t\t// The cache contains the metadata without the language bits set.\n\t\tlet result = this._cache.get(token);\n\t\tif (typeof result === 'undefined') {\n\t\t\tconst rule = this._match(token);\n\t\t\tconst standardToken = toStandardTokenType(token);\n\t\t\tresult = (\n\t\t\t\trule.metadata\n\t\t\t\t| (standardToken << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t\t) >>> 0;\n\t\t\tthis._cache.set(token, result);\n\t\t}\n\n\t\treturn (\n\t\t\tresult\n\t\t\t| (languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nconst STANDARD_TOKEN_TYPE_REGEXP = /\\b(comment|string|regex|regexp)\\b/;\nexport function toStandardTokenType(tokenType: string): StandardTokenType {\n\tconst m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP);\n\tif (!m) {\n\t\treturn StandardTokenType.Other;\n\t}\n\tswitch (m[1]) {\n\t\tcase 'comment':\n\t\t\treturn StandardTokenType.Comment;\n\t\tcase 'string':\n\t\t\treturn StandardTokenType.String;\n\t\tcase 'regex':\n\t\t\treturn StandardTokenType.RegEx;\n\t\tcase 'regexp':\n\t\t\treturn StandardTokenType.RegEx;\n\t}\n\tthrow new Error('Unexpected match for standard token type!');\n}\n\nexport function strcmp(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (a > b) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nexport class ThemeTrieElementRule {\n\t_themeTrieElementRuleBrand: void = undefined;\n\n\tprivate _fontStyle: FontStyle;\n\tprivate _foreground: ColorId;\n\tprivate _background: ColorId;\n\tpublic metadata: number;\n\n\tconstructor(fontStyle: FontStyle, foreground: ColorId, background: ColorId) {\n\t\tthis._fontStyle = fontStyle;\n\t\tthis._foreground = foreground;\n\t\tthis._background = background;\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n\n\tpublic clone(): ThemeTrieElementRule {\n\t\treturn new ThemeTrieElementRule(this._fontStyle, this._foreground, this._background);\n\t}\n\n\tpublic acceptOverwrite(fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (fontStyle !== FontStyle.NotSet) {\n\t\t\tthis._fontStyle = fontStyle;\n\t\t}\n\t\tif (foreground !== ColorId.None) {\n\t\t\tthis._foreground = foreground;\n\t\t}\n\t\tif (background !== ColorId.None) {\n\t\t\tthis._background = background;\n\t\t}\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nexport class ThemeTrieElement {\n\t_themeTrieElementBrand: void = undefined;\n\n\tprivate readonly _mainRule: ThemeTrieElementRule;\n\tprivate readonly _children: Map<string, ThemeTrieElement>;\n\n\tconstructor(mainRule: ThemeTrieElementRule) {\n\t\tthis._mainRule = mainRule;\n\t\tthis._children = new Map<string, ThemeTrieElement>();\n\t}\n\n\tpublic match(token: string): ThemeTrieElementRule {\n\t\tif (token === '') {\n\t\t\treturn this._mainRule;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tconst child = this._children.get(head);\n\t\tif (typeof child !== 'undefined') {\n\t\t\treturn child.match(tail);\n\t\t}\n\n\t\treturn this._mainRule;\n\t}\n\n\tpublic insert(token: string, fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (token === '') {\n\t\t\t// Merge into the main rule\n\t\t\tthis._mainRule.acceptOverwrite(fontStyle, foreground, background);\n\t\t\treturn;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tlet child = this._children.get(head);\n\t\tif (typeof child === 'undefined') {\n\t\t\tchild = new ThemeTrieElement(this._mainRule.clone());\n\t\t\tthis._children.set(head, child);\n\t\t}\n\n\t\tchild.insert(tail, fontStyle, foreground, background);\n\t}\n}\n\nexport function generateTokensCSSForColorMap(colorMap: readonly Color[]): string {\n\tconst rules: string[] = [];\n\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\tconst color = colorMap[i];\n\t\trules[i] = `.mtk${i} { color: ${color}; }`;\n\t}\n\trules.push('.mtki { font-style: italic; }');\n\trules.push('.mtkb { font-weight: bold; }');\n\trules.push('.mtku { text-decoration: underline; text-underline-position: under; }');\n\trules.push('.mtks { text-decoration: line-through; }');\n\trules.push('.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }');\n\treturn rules.join('\\n');\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Color } from '../../../../base/common/color.js';\nimport { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../../encodedTokenAttributes.js';\n\nexport interface ITokenThemeRule {\n\ttoken: string;\n\tforeground?: string;\n\tbackground?: string;\n\tfontStyle?: string;\n}\n\nexport class ParsedTokenThemeRule {\n\t_parsedThemeRuleBrand: void = undefined;\n\n\treadonly token: string;\n\treadonly index: number;\n\n\t/**\n\t * -1 if not set. An or mask of `FontStyle` otherwise.\n\t */\n\treadonly fontStyle: FontStyle;\n\treadonly foreground: string | null;\n\treadonly background: string | null;\n\n\tconstructor(\n\t\ttoken: string,\n\t\tindex: number,\n\t\tfontStyle: number,\n\t\tforeground: string | null,\n\t\tbackground: string | null,\n\t) {\n\t\tthis.token = token;\n\t\tthis.index = index;\n\t\tthis.fontStyle = fontStyle;\n\t\tthis.foreground = foreground;\n\t\tthis.background = background;\n\t}\n}\n\n/**\n * Parse a raw theme into rules.\n */\nexport function parseTokenTheme(source: ITokenThemeRule[]): ParsedTokenThemeRule[] {\n\tif (!source || !Array.isArray(source)) {\n\t\treturn [];\n\t}\n\tconst result: ParsedTokenThemeRule[] = [];\n\tlet resultLen = 0;\n\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\tconst entry = source[i];\n\n\t\tlet fontStyle: number = FontStyle.NotSet;\n\t\tif (typeof entry.fontStyle === 'string') {\n\t\t\tfontStyle = FontStyle.None;\n\n\t\t\tconst segments = entry.fontStyle.split(' ');\n\t\t\tfor (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n\t\t\t\tconst segment = segments[j];\n\t\t\t\tswitch (segment) {\n\t\t\t\t\tcase 'italic':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Italic;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bold':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Bold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'underline':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Underline;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strikethrough':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Strikethrough;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet foreground: string | null = null;\n\t\tif (typeof entry.foreground === 'string') {\n\t\t\tforeground = entry.foreground;\n\t\t}\n\n\t\tlet background: string | null = null;\n\t\tif (typeof entry.background === 'string') {\n\t\t\tbackground = entry.background;\n\t\t}\n\n\t\tresult[resultLen++] = new ParsedTokenThemeRule(\n\t\t\tentry.token || '',\n\t\t\ti,\n\t\t\tfontStyle,\n\t\t\tforeground,\n\t\t\tbackground\n\t\t);\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve rules (i.e. inheritance).\n */\nfunction resolveParsedTokenThemeRules(parsedThemeRules: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\n\t// Sort rules lexicographically, and then by index if necessary\n\tparsedThemeRules.sort((a, b) => {\n\t\tconst r = strcmp(a.token, b.token);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\t\treturn a.index - b.index;\n\t});\n\n\t// Determine defaults\n\tlet defaultFontStyle = FontStyle.None;\n\tlet defaultForeground = '000000';\n\tlet defaultBackground = 'ffffff';\n\twhile (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === '') {\n\t\tconst incomingDefaults = parsedThemeRules.shift()!;\n\t\tif (incomingDefaults.fontStyle !== FontStyle.NotSet) {\n\t\t\tdefaultFontStyle = incomingDefaults.fontStyle;\n\t\t}\n\t\tif (incomingDefaults.foreground !== null) {\n\t\t\tdefaultForeground = incomingDefaults.foreground;\n\t\t}\n\t\tif (incomingDefaults.background !== null) {\n\t\t\tdefaultBackground = incomingDefaults.background;\n\t\t}\n\t}\n\tconst colorMap = new ColorMap();\n\n\t// start with token colors from custom token themes\n\tfor (const color of customTokenColors) {\n\t\tcolorMap.getId(color);\n\t}\n\n\n\tconst foregroundColorId = colorMap.getId(defaultForeground);\n\tconst backgroundColorId = colorMap.getId(defaultBackground);\n\n\tconst defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId);\n\tconst root = new ThemeTrieElement(defaults);\n\tfor (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n\t\tconst rule = parsedThemeRules[i];\n\t\troot.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background));\n\t}\n\n\treturn new TokenTheme(colorMap, root);\n}\n\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\nexport class ColorMap {\n\n\tprivate _lastColorId: number;\n\tprivate readonly _id2color: Color[];\n\tprivate readonly _color2id: Map<string, ColorId>;\n\n\tconstructor() {\n\t\tthis._lastColorId = 0;\n\t\tthis._id2color = [];\n\t\tthis._color2id = new Map<string, ColorId>();\n\t}\n\n\tpublic getId(color: string | null): ColorId {\n\t\tif (color === null) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst match = color.match(colorRegExp);\n\t\tif (!match) {\n\t\t\tthrow new Error('Illegal value for token color: ' + color);\n\t\t}\n\t\tcolor = match[1].toUpperCase();\n\t\tlet value = this._color2id.get(color);\n\t\tif (value) {\n\t\t\treturn value;\n\t\t}\n\t\tvalue = ++this._lastColorId;\n\t\tthis._color2id.set(color, value);\n\t\tthis._id2color[value] = Color.fromHex('#' + color);\n\t\treturn value;\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._id2color.slice(0);\n\t}\n\n}\n\nexport class TokenTheme {\n\n\tpublic static createFromRawTokenTheme(source: ITokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors);\n\t}\n\n\tpublic static createFromParsedTokenTheme(source: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn resolveParsedTokenThemeRules(source, customTokenColors);\n\t}\n\n\tprivate readonly _colorMap: ColorMap;\n\tprivate readonly _root: ThemeTrieElement;\n\tprivate readonly _cache: Map<string, number>;\n\n\tconstructor(colorMap: ColorMap, root: ThemeTrieElement) {\n\t\tthis._colorMap = colorMap;\n\t\tthis._root = root;\n\t\tthis._cache = new Map<string, number>();\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._colorMap.getColorMap();\n\t}\n\n\tpublic _match(token: string): ThemeTrieElementRule {\n\t\treturn this._root.match(token);\n\t}\n\n\tpublic match(languageId: LanguageId, token: string): number {\n\t\t// The cache contains the metadata without the language bits set.\n\t\tlet result = this._cache.get(token);\n\t\tif (typeof result === 'undefined') {\n\t\t\tconst rule = this._match(token);\n\t\t\tconst standardToken = toStandardTokenType(token);\n\t\t\tresult = (\n\t\t\t\trule.metadata\n\t\t\t\t| (standardToken << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t\t) >>> 0;\n\t\t\tthis._cache.set(token, result);\n\t\t}\n\n\t\treturn (\n\t\t\tresult\n\t\t\t| (languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nconst STANDARD_TOKEN_TYPE_REGEXP = /\\b(comment|string|regex|regexp)\\b/;\nexport function toStandardTokenType(tokenType: string): StandardTokenType {\n\tconst m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP);\n\tif (!m) {\n\t\treturn StandardTokenType.Other;\n\t}\n\tswitch (m[1]) {\n\t\tcase 'comment':\n\t\t\treturn StandardTokenType.Comment;\n\t\tcase 'string':\n\t\t\treturn StandardTokenType.String;\n\t\tcase 'regex':\n\t\t\treturn StandardTokenType.RegEx;\n\t\tcase 'regexp':\n\t\t\treturn StandardTokenType.RegEx;\n\t}\n\tthrow new Error('Unexpected match for standard token type!');\n}\n\nexport function strcmp(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (a > b) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nexport class ThemeTrieElementRule {\n\t_themeTrieElementRuleBrand: void = undefined;\n\n\tprivate _fontStyle: FontStyle;\n\tprivate _foreground: ColorId;\n\tprivate _background: ColorId;\n\tpublic metadata: number;\n\n\tconstructor(fontStyle: FontStyle, foreground: ColorId, background: ColorId) {\n\t\tthis._fontStyle = fontStyle;\n\t\tthis._foreground = foreground;\n\t\tthis._background = background;\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n\n\tpublic clone(): ThemeTrieElementRule {\n\t\treturn new ThemeTrieElementRule(this._fontStyle, this._foreground, this._background);\n\t}\n\n\tpublic acceptOverwrite(fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (fontStyle !== FontStyle.NotSet) {\n\t\t\tthis._fontStyle = fontStyle;\n\t\t}\n\t\tif (foreground !== ColorId.None) {\n\t\t\tthis._foreground = foreground;\n\t\t}\n\t\tif (background !== ColorId.None) {\n\t\t\tthis._background = background;\n\t\t}\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nexport class ThemeTrieElement {\n\t_themeTrieElementBrand: void = undefined;\n\n\tprivate readonly _mainRule: ThemeTrieElementRule;\n\tprivate readonly _children: Map<string, ThemeTrieElement>;\n\n\tconstructor(mainRule: ThemeTrieElementRule) {\n\t\tthis._mainRule = mainRule;\n\t\tthis._children = new Map<string, ThemeTrieElement>();\n\t}\n\n\tpublic match(token: string): ThemeTrieElementRule {\n\t\tif (token === '') {\n\t\t\treturn this._mainRule;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tconst child = this._children.get(head);\n\t\tif (typeof child !== 'undefined') {\n\t\t\treturn child.match(tail);\n\t\t}\n\n\t\treturn this._mainRule;\n\t}\n\n\tpublic insert(token: string, fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (token === '') {\n\t\t\t// Merge into the main rule\n\t\t\tthis._mainRule.acceptOverwrite(fontStyle, foreground, background);\n\t\t\treturn;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tlet child = this._children.get(head);\n\t\tif (typeof child === 'undefined') {\n\t\t\tchild = new ThemeTrieElement(this._mainRule.clone());\n\t\t\tthis._children.set(head, child);\n\t\t}\n\n\t\tchild.insert(tail, fontStyle, foreground, background);\n\t}\n}\n\nexport function generateTokensCSSForColorMap(colorMap: readonly Color[]): string {\n\tconst rules: string[] = [];\n\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\tconst color = colorMap[i];\n\t\trules[i] = `.mtk${i} { color: ${color}; }`;\n\t}\n\trules.push('.mtki { font-style: italic; }');\n\trules.push('.mtkb { font-weight: bold; }');\n\trules.push('.mtku { text-decoration: underline; text-underline-position: under; }');\n\trules.push('.mtks { text-decoration: line-through; }');\n\trules.push('.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }');\n\treturn rules.join('\\n');\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/supports/tokenization.ts","vs/editor/common/languages/supports/tokenization.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAUzD,MAAM,OAAO,oBAAoB;IAahC,YACC,KAAa,EACb,KAAa,EACb,SAAiB,EACjB,UAAyB,EACzB,UAAyB;QAjB1B,0BAAqB,GAAS,SAAS,CAAC;QAmBvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAyB;IACxD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,SAAS,4BAA2B,CAAC;QACzC,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YACzC,SAAS,yBAAiB,CAAC;YAE3B,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,KAAK,IAAI,C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CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;AAChF,CAAC","file":"tokenization.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Color } from '../../../../base/common/color.js';\nimport { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../../encodedTokenAttributes.js';\n\nexport interface ITokenThemeRule {\n\ttoken: string;\n\tforeground?: string;\n\tbackground?: string;\n\tfontStyle?: string;\n}\n\nexport class ParsedTokenThemeRule {\n\t_parsedThemeRuleBrand: void = undefined;\n\n\treadonly token: string;\n\treadonly index: number;\n\n\t/**\n\t * -1 if not set. An or mask of `FontStyle` otherwise.\n\t */\n\treadonly fontStyle: FontStyle;\n\treadonly foreground: string | null;\n\treadonly background: string | null;\n\n\tconstructor(\n\t\ttoken: string,\n\t\tindex: number,\n\t\tfontStyle: number,\n\t\tforeground: string | null,\n\t\tbackground: string | null,\n\t) {\n\t\tthis.token = token;\n\t\tthis.index = index;\n\t\tthis.fontStyle = fontStyle;\n\t\tthis.foreground = foreground;\n\t\tthis.background = background;\n\t}\n}\n\n/**\n * Parse a raw theme into rules.\n */\nexport function parseTokenTheme(source: ITokenThemeRule[]): ParsedTokenThemeRule[] {\n\tif (!source || !Array.isArray(source)) {\n\t\treturn [];\n\t}\n\tconst result: ParsedTokenThemeRule[] = [];\n\tlet resultLen = 0;\n\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\tconst entry = source[i];\n\n\t\tlet fontStyle: number = FontStyle.NotSet;\n\t\tif (typeof entry.fontStyle === 'string') {\n\t\t\tfontStyle = FontStyle.None;\n\n\t\t\tconst segments = entry.fontStyle.split(' ');\n\t\t\tfor (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n\t\t\t\tconst segment = segments[j];\n\t\t\t\tswitch (segment) {\n\t\t\t\t\tcase 'italic':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Italic;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bold':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Bold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'underline':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Underline;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strikethrough':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Strikethrough;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet foreground: string | null = null;\n\t\tif (typeof entry.foreground === 'string') {\n\t\t\tforeground = entry.foreground;\n\t\t}\n\n\t\tlet background: string | null = null;\n\t\tif (typeof entry.background === 'string') {\n\t\t\tbackground = entry.background;\n\t\t}\n\n\t\tresult[resultLen++] = new ParsedTokenThemeRule(\n\t\t\tentry.token || '',\n\t\t\ti,\n\t\t\tfontStyle,\n\t\t\tforeground,\n\t\t\tbackground\n\t\t);\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve rules (i.e. inheritance).\n */\nfunction resolveParsedTokenThemeRules(parsedThemeRules: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\n\t// Sort rules lexicographically, and then by index if necessary\n\tparsedThemeRules.sort((a, b) => {\n\t\tconst r = strcmp(a.token, b.token);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\t\treturn a.index - b.index;\n\t});\n\n\t// Determine defaults\n\tlet defaultFontStyle = FontStyle.None;\n\tlet defaultForeground = '000000';\n\tlet defaultBackground = 'ffffff';\n\twhile (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === '') {\n\t\tconst incomingDefaults = parsedThemeRules.shift()!;\n\t\tif (incomingDefaults.fontStyle !== FontStyle.NotSet) {\n\t\t\tdefaultFontStyle = incomingDefaults.fontStyle;\n\t\t}\n\t\tif (incomingDefaults.foreground !== null) {\n\t\t\tdefaultForeground = incomingDefaults.foreground;\n\t\t}\n\t\tif (incomingDefaults.background !== null) {\n\t\t\tdefaultBackground = incomingDefaults.background;\n\t\t}\n\t}\n\tconst colorMap = new ColorMap();\n\n\t// start with token colors from custom token themes\n\tfor (const color of customTokenColors) {\n\t\tcolorMap.getId(color);\n\t}\n\n\n\tconst foregroundColorId = colorMap.getId(defaultForeground);\n\tconst backgroundColorId = colorMap.getId(defaultBackground);\n\n\tconst defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId);\n\tconst root = new ThemeTrieElement(defaults);\n\tfor (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n\t\tconst rule = parsedThemeRules[i];\n\t\troot.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background));\n\t}\n\n\treturn new TokenTheme(colorMap, root);\n}\n\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\nexport class ColorMap {\n\n\tprivate _lastColorId: number;\n\tprivate readonly _id2color: Color[];\n\tprivate readonly _color2id: Map<string, ColorId>;\n\n\tconstructor() {\n\t\tthis._lastColorId = 0;\n\t\tthis._id2color = [];\n\t\tthis._color2id = new Map<string, ColorId>();\n\t}\n\n\tpublic getId(color: string | null): ColorId {\n\t\tif (color === null) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst match = color.match(colorRegExp);\n\t\tif (!match) {\n\t\t\tthrow new Error('Illegal value for token color: ' + color);\n\t\t}\n\t\tcolor = match[1].toUpperCase();\n\t\tlet value = this._color2id.get(color);\n\t\tif (value) {\n\t\t\treturn value;\n\t\t}\n\t\tvalue = ++this._lastColorId;\n\t\tthis._color2id.set(color, value);\n\t\tthis._id2color[value] = Color.fromHex('#' + color);\n\t\treturn value;\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._id2color.slice(0);\n\t}\n\n}\n\nexport class TokenTheme {\n\n\tpublic static createFromRawTokenTheme(source: ITokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors);\n\t}\n\n\tpublic static createFromParsedTokenTheme(source: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn resolveParsedTokenThemeRules(source, customTokenColors);\n\t}\n\n\tprivate readonly _colorMap: ColorMap;\n\tprivate readonly _root: ThemeTrieElement;\n\tprivate readonly _cache: Map<string, number>;\n\n\tconstructor(colorMap: ColorMap, root: ThemeTrieElement) {\n\t\tthis._colorMap = colorMap;\n\t\tthis._root = root;\n\t\tthis._cache = new Map<string, number>();\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._colorMap.getColorMap();\n\t}\n\n\tpublic _match(token: string): ThemeTrieElementRule {\n\t\treturn this._root.match(token);\n\t}\n\n\tpublic match(languageId: LanguageId, token: string): number {\n\t\t// The cache contains the metadata without the language bits set.\n\t\tlet result = this._cache.get(token);\n\t\tif (typeof result === 'undefined') {\n\t\t\tconst rule = this._match(token);\n\t\t\tconst standardToken = toStandardTokenType(token);\n\t\t\tresult = (\n\t\t\t\trule.metadata\n\t\t\t\t| (standardToken << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t\t) >>> 0;\n\t\t\tthis._cache.set(token, result);\n\t\t}\n\n\t\treturn (\n\t\t\tresult\n\t\t\t| (languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nconst STANDARD_TOKEN_TYPE_REGEXP = /\\b(comment|string|regex|regexp)\\b/;\nexport function toStandardTokenType(tokenType: string): StandardTokenType {\n\tconst m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP);\n\tif (!m) {\n\t\treturn StandardTokenType.Other;\n\t}\n\tswitch (m[1]) {\n\t\tcase 'comment':\n\t\t\treturn StandardTokenType.Comment;\n\t\tcase 'string':\n\t\t\treturn StandardTokenType.String;\n\t\tcase 'regex':\n\t\t\treturn StandardTokenType.RegEx;\n\t\tcase 'regexp':\n\t\t\treturn StandardTokenType.RegEx;\n\t}\n\tthrow new Error('Unexpected match for standard token type!');\n}\n\nexport function strcmp(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (a > b) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nexport class ThemeTrieElementRule {\n\t_themeTrieElementRuleBrand: void = undefined;\n\n\tprivate _fontStyle: FontStyle;\n\tprivate _foreground: ColorId;\n\tprivate _background: ColorId;\n\tpublic metadata: number;\n\n\tconstructor(fontStyle: FontStyle, foreground: ColorId, background: ColorId) {\n\t\tthis._fontStyle = fontStyle;\n\t\tthis._foreground = foreground;\n\t\tthis._background = background;\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n\n\tpublic clone(): ThemeTrieElementRule {\n\t\treturn new ThemeTrieElementRule(this._fontStyle, this._foreground, this._background);\n\t}\n\n\tpublic acceptOverwrite(fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (fontStyle !== FontStyle.NotSet) {\n\t\t\tthis._fontStyle = fontStyle;\n\t\t}\n\t\tif (foreground !== ColorId.None) {\n\t\t\tthis._foreground = foreground;\n\t\t}\n\t\tif (background !== ColorId.None) {\n\t\t\tthis._background = background;\n\t\t}\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nexport class ThemeTrieElement {\n\t_themeTrieElementBrand: void = undefined;\n\n\tprivate readonly _mainRule: ThemeTrieElementRule;\n\tprivate readonly _children: Map<string, ThemeTrieElement>;\n\n\tconstructor(mainRule: ThemeTrieElementRule) {\n\t\tthis._mainRule = mainRule;\n\t\tthis._children = new Map<string, ThemeTrieElement>();\n\t}\n\n\tpublic match(token: string): ThemeTrieElementRule {\n\t\tif (token === '') {\n\t\t\treturn this._mainRule;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tconst child = this._children.get(head);\n\t\tif (typeof child !== 'undefined') {\n\t\t\treturn child.match(tail);\n\t\t}\n\n\t\treturn this._mainRule;\n\t}\n\n\tpublic insert(token: string, fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (token === '') {\n\t\t\t// Merge into the main rule\n\t\t\tthis._mainRule.acceptOverwrite(fontStyle, foreground, background);\n\t\t\treturn;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tlet child = this._children.get(head);\n\t\tif (typeof child === 'undefined') {\n\t\t\tchild = new ThemeTrieElement(this._mainRule.clone());\n\t\t\tthis._children.set(head, child);\n\t\t}\n\n\t\tchild.insert(tail, fontStyle, foreground, background);\n\t}\n}\n\nexport function generateTokensCSSForColorMap(colorMap: readonly Color[]): string {\n\tconst rules: string[] = [];\n\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\tconst color = colorMap[i];\n\t\trules[i] = `.mtk${i} { color: ${color}; }`;\n\t}\n\trules.push('.mtki { font-style: italic; }');\n\trules.push('.mtkb { font-weight: bold; }');\n\trules.push('.mtku { text-decoration: underline; text-underline-position: under; }');\n\trules.push('.mtks { text-decoration: line-through; }');\n\trules.push('.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }');\n\treturn rules.join('\\n');\n}\n\nexport function classNameForFontTokenDecorations(fontFamily: string, fontSize: string): string {\n\treturn `font-decoration-${fontFamily.toLowerCase()}-${fontSize.toLowerCase()}`;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Color } from '../../../../base/common/color.js';\nimport { LanguageId, FontStyle, ColorId, StandardTokenType, MetadataConsts } from '../../encodedTokenAttributes.js';\n\nexport interface ITokenThemeRule {\n\ttoken: string;\n\tforeground?: string;\n\tbackground?: string;\n\tfontStyle?: string;\n}\n\nexport class ParsedTokenThemeRule {\n\t_parsedThemeRuleBrand: void = undefined;\n\n\treadonly token: string;\n\treadonly index: number;\n\n\t/**\n\t * -1 if not set. An or mask of `FontStyle` otherwise.\n\t */\n\treadonly fontStyle: FontStyle;\n\treadonly foreground: string | null;\n\treadonly background: string | null;\n\n\tconstructor(\n\t\ttoken: string,\n\t\tindex: number,\n\t\tfontStyle: number,\n\t\tforeground: string | null,\n\t\tbackground: string | null,\n\t) {\n\t\tthis.token = token;\n\t\tthis.index = index;\n\t\tthis.fontStyle = fontStyle;\n\t\tthis.foreground = foreground;\n\t\tthis.background = background;\n\t}\n}\n\n/**\n * Parse a raw theme into rules.\n */\nexport function parseTokenTheme(source: ITokenThemeRule[]): ParsedTokenThemeRule[] {\n\tif (!source || !Array.isArray(source)) {\n\t\treturn [];\n\t}\n\tconst result: ParsedTokenThemeRule[] = [];\n\tlet resultLen = 0;\n\tfor (let i = 0, len = source.length; i < len; i++) {\n\t\tconst entry = source[i];\n\n\t\tlet fontStyle: number = FontStyle.NotSet;\n\t\tif (typeof entry.fontStyle === 'string') {\n\t\t\tfontStyle = FontStyle.None;\n\n\t\t\tconst segments = entry.fontStyle.split(' ');\n\t\t\tfor (let j = 0, lenJ = segments.length; j < lenJ; j++) {\n\t\t\t\tconst segment = segments[j];\n\t\t\t\tswitch (segment) {\n\t\t\t\t\tcase 'italic':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Italic;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bold':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Bold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'underline':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Underline;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strikethrough':\n\t\t\t\t\t\tfontStyle = fontStyle | FontStyle.Strikethrough;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet foreground: string | null = null;\n\t\tif (typeof entry.foreground === 'string') {\n\t\t\tforeground = entry.foreground;\n\t\t}\n\n\t\tlet background: string | null = null;\n\t\tif (typeof entry.background === 'string') {\n\t\t\tbackground = entry.background;\n\t\t}\n\n\t\tresult[resultLen++] = new ParsedTokenThemeRule(\n\t\t\tentry.token || '',\n\t\t\ti,\n\t\t\tfontStyle,\n\t\t\tforeground,\n\t\t\tbackground\n\t\t);\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve rules (i.e. inheritance).\n */\nfunction resolveParsedTokenThemeRules(parsedThemeRules: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\n\t// Sort rules lexicographically, and then by index if necessary\n\tparsedThemeRules.sort((a, b) => {\n\t\tconst r = strcmp(a.token, b.token);\n\t\tif (r !== 0) {\n\t\t\treturn r;\n\t\t}\n\t\treturn a.index - b.index;\n\t});\n\n\t// Determine defaults\n\tlet defaultFontStyle = FontStyle.None;\n\tlet defaultForeground = '000000';\n\tlet defaultBackground = 'ffffff';\n\twhile (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === '') {\n\t\tconst incomingDefaults = parsedThemeRules.shift()!;\n\t\tif (incomingDefaults.fontStyle !== FontStyle.NotSet) {\n\t\t\tdefaultFontStyle = incomingDefaults.fontStyle;\n\t\t}\n\t\tif (incomingDefaults.foreground !== null) {\n\t\t\tdefaultForeground = incomingDefaults.foreground;\n\t\t}\n\t\tif (incomingDefaults.background !== null) {\n\t\t\tdefaultBackground = incomingDefaults.background;\n\t\t}\n\t}\n\tconst colorMap = new ColorMap();\n\n\t// start with token colors from custom token themes\n\tfor (const color of customTokenColors) {\n\t\tcolorMap.getId(color);\n\t}\n\n\n\tconst foregroundColorId = colorMap.getId(defaultForeground);\n\tconst backgroundColorId = colorMap.getId(defaultBackground);\n\n\tconst defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId);\n\tconst root = new ThemeTrieElement(defaults);\n\tfor (let i = 0, len = parsedThemeRules.length; i < len; i++) {\n\t\tconst rule = parsedThemeRules[i];\n\t\troot.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background));\n\t}\n\n\treturn new TokenTheme(colorMap, root);\n}\n\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\nexport class ColorMap {\n\n\tprivate _lastColorId: number;\n\tprivate readonly _id2color: Color[];\n\tprivate readonly _color2id: Map<string, ColorId>;\n\n\tconstructor() {\n\t\tthis._lastColorId = 0;\n\t\tthis._id2color = [];\n\t\tthis._color2id = new Map<string, ColorId>();\n\t}\n\n\tpublic getId(color: string | null): ColorId {\n\t\tif (color === null) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst match = color.match(colorRegExp);\n\t\tif (!match) {\n\t\t\tthrow new Error('Illegal value for token color: ' + color);\n\t\t}\n\t\tcolor = match[1].toUpperCase();\n\t\tlet value = this._color2id.get(color);\n\t\tif (value) {\n\t\t\treturn value;\n\t\t}\n\t\tvalue = ++this._lastColorId;\n\t\tthis._color2id.set(color, value);\n\t\tthis._id2color[value] = Color.fromHex('#' + color);\n\t\treturn value;\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._id2color.slice(0);\n\t}\n\n}\n\nexport class TokenTheme {\n\n\tpublic static createFromRawTokenTheme(source: ITokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors);\n\t}\n\n\tpublic static createFromParsedTokenTheme(source: ParsedTokenThemeRule[], customTokenColors: string[]): TokenTheme {\n\t\treturn resolveParsedTokenThemeRules(source, customTokenColors);\n\t}\n\n\tprivate readonly _colorMap: ColorMap;\n\tprivate readonly _root: ThemeTrieElement;\n\tprivate readonly _cache: Map<string, number>;\n\n\tconstructor(colorMap: ColorMap, root: ThemeTrieElement) {\n\t\tthis._colorMap = colorMap;\n\t\tthis._root = root;\n\t\tthis._cache = new Map<string, number>();\n\t}\n\n\tpublic getColorMap(): Color[] {\n\t\treturn this._colorMap.getColorMap();\n\t}\n\n\tpublic _match(token: string): ThemeTrieElementRule {\n\t\treturn this._root.match(token);\n\t}\n\n\tpublic match(languageId: LanguageId, token: string): number {\n\t\t// The cache contains the metadata without the language bits set.\n\t\tlet result = this._cache.get(token);\n\t\tif (typeof result === 'undefined') {\n\t\t\tconst rule = this._match(token);\n\t\t\tconst standardToken = toStandardTokenType(token);\n\t\t\tresult = (\n\t\t\t\trule.metadata\n\t\t\t\t| (standardToken << MetadataConsts.TOKEN_TYPE_OFFSET)\n\t\t\t) >>> 0;\n\t\t\tthis._cache.set(token, result);\n\t\t}\n\n\t\treturn (\n\t\t\tresult\n\t\t\t| (languageId << MetadataConsts.LANGUAGEID_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nconst STANDARD_TOKEN_TYPE_REGEXP = /\\b(comment|string|regex|regexp)\\b/;\nexport function toStandardTokenType(tokenType: string): StandardTokenType {\n\tconst m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP);\n\tif (!m) {\n\t\treturn StandardTokenType.Other;\n\t}\n\tswitch (m[1]) {\n\t\tcase 'comment':\n\t\t\treturn StandardTokenType.Comment;\n\t\tcase 'string':\n\t\t\treturn StandardTokenType.String;\n\t\tcase 'regex':\n\t\t\treturn StandardTokenType.RegEx;\n\t\tcase 'regexp':\n\t\t\treturn StandardTokenType.RegEx;\n\t}\n\tthrow new Error('Unexpected match for standard token type!');\n}\n\nexport function strcmp(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (a > b) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nexport class ThemeTrieElementRule {\n\t_themeTrieElementRuleBrand: void = undefined;\n\n\tprivate _fontStyle: FontStyle;\n\tprivate _foreground: ColorId;\n\tprivate _background: ColorId;\n\tpublic metadata: number;\n\n\tconstructor(fontStyle: FontStyle, foreground: ColorId, background: ColorId) {\n\t\tthis._fontStyle = fontStyle;\n\t\tthis._foreground = foreground;\n\t\tthis._background = background;\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n\n\tpublic clone(): ThemeTrieElementRule {\n\t\treturn new ThemeTrieElementRule(this._fontStyle, this._foreground, this._background);\n\t}\n\n\tpublic acceptOverwrite(fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (fontStyle !== FontStyle.NotSet) {\n\t\t\tthis._fontStyle = fontStyle;\n\t\t}\n\t\tif (foreground !== ColorId.None) {\n\t\t\tthis._foreground = foreground;\n\t\t}\n\t\tif (background !== ColorId.None) {\n\t\t\tthis._background = background;\n\t\t}\n\t\tthis.metadata = (\n\t\t\t(this._fontStyle << MetadataConsts.FONT_STYLE_OFFSET)\n\t\t\t| (this._foreground << MetadataConsts.FOREGROUND_OFFSET)\n\t\t\t| (this._background << MetadataConsts.BACKGROUND_OFFSET)\n\t\t) >>> 0;\n\t}\n}\n\nexport class ThemeTrieElement {\n\t_themeTrieElementBrand: void = undefined;\n\n\tprivate readonly _mainRule: ThemeTrieElementRule;\n\tprivate readonly _children: Map<string, ThemeTrieElement>;\n\n\tconstructor(mainRule: ThemeTrieElementRule) {\n\t\tthis._mainRule = mainRule;\n\t\tthis._children = new Map<string, ThemeTrieElement>();\n\t}\n\n\tpublic match(token: string): ThemeTrieElementRule {\n\t\tif (token === '') {\n\t\t\treturn this._mainRule;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tconst child = this._children.get(head);\n\t\tif (typeof child !== 'undefined') {\n\t\t\treturn child.match(tail);\n\t\t}\n\n\t\treturn this._mainRule;\n\t}\n\n\tpublic insert(token: string, fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {\n\t\tif (token === '') {\n\t\t\t// Merge into the main rule\n\t\t\tthis._mainRule.acceptOverwrite(fontStyle, foreground, background);\n\t\t\treturn;\n\t\t}\n\n\t\tconst dotIndex = token.indexOf('.');\n\t\tlet head: string;\n\t\tlet tail: string;\n\t\tif (dotIndex === -1) {\n\t\t\thead = token;\n\t\t\ttail = '';\n\t\t} else {\n\t\t\thead = token.substring(0, dotIndex);\n\t\t\ttail = token.substring(dotIndex + 1);\n\t\t}\n\n\t\tlet child = this._children.get(head);\n\t\tif (typeof child === 'undefined') {\n\t\t\tchild = new ThemeTrieElement(this._mainRule.clone());\n\t\t\tthis._children.set(head, child);\n\t\t}\n\n\t\tchild.insert(tail, fontStyle, foreground, background);\n\t}\n}\n\nexport function generateTokensCSSForColorMap(colorMap: readonly Color[]): string {\n\tconst rules: string[] = [];\n\tfor (let i = 1, len = colorMap.length; i < len; i++) {\n\t\tconst color = colorMap[i];\n\t\trules[i] = `.mtk${i} { color: ${color}; }`;\n\t}\n\trules.push('.mtki { font-style: italic; }');\n\trules.push('.mtkb { font-weight: bold; }');\n\trules.push('.mtku { text-decoration: underline; text-underline-position: under; }');\n\trules.push('.mtks { text-decoration: line-through; }');\n\trules.push('.mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }');\n\treturn rules.join('\\n');\n}\n\nexport function classNameForFontTokenDecorations(fontFamily: string, fontSize: string): string {\n\treturn `font-decoration-${fontFamily.toLowerCase()}-${fontSize.toLowerCase()}`;\n}\n"]}
|