monaco-editor-core 0.56.0-dev-20260121 → 0.56.0-dev-20260123
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 +6 -2
- package/esm/vs/base/browser/markdownRenderer.js +0 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/tree/abstractTree.js +15 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/common/actions.js +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/errorMessage.js +6 -6
- package/esm/vs/base/common/keybindingLabels.js +20 -20
- package/esm/vs/base/common/network.js +0 -2
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +10 -4
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/policy.js +5 -5
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/esm/vs/editor/browser/coreCommands.js +3 -3
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorExtensions.js +9 -9
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +41 -0
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
- package/esm/vs/editor/browser/services/renameSymbolTrackerService.js +15 -0
- package/esm/vs/editor/browser/services/renameSymbolTrackerService.js.map +1 -0
- package/esm/vs/editor/browser/view.js +3 -0
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +14 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +7 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +8 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +2 -41
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +55 -55
- package/esm/vs/editor/common/config/editorOptions.js +410 -410
- package/esm/vs/editor/common/core/editorColorRegistry.js +70 -70
- package/esm/vs/editor/common/editorContextKeys.js +48 -48
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- 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 +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +44 -34
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +5 -4
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js.map +1 -1
- 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 +9 -9
- 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.css +5 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +2 -1
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js +54 -45
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.js.map +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/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 +7 -7
- 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/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +107 -18
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +2 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.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 +31 -31
- 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 +10 -10
- 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 +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- 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/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- 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 +3 -3
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +2 -1
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +2 -0
- package/esm/vs/editor/standalone/browser/standaloneServices.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 +34 -11
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +10 -0
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +2 -0
- 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/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/keybinding/common/abstractKeybindingService.js +5 -5
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- 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/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -18
- 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 +11 -11
- 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 +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
|
@@ -37,38 +37,38 @@ export const UILabelProvider = new ModifierLabelProvider({
|
|
|
37
37
|
metaKey: '⌘',
|
|
38
38
|
separator: '',
|
|
39
39
|
}, {
|
|
40
|
-
ctrlKey: nls.localize(
|
|
41
|
-
shiftKey: nls.localize(
|
|
42
|
-
altKey: nls.localize(
|
|
43
|
-
metaKey: nls.localize(
|
|
40
|
+
ctrlKey: nls.localize(37, "Ctrl"),
|
|
41
|
+
shiftKey: nls.localize(38, "Shift"),
|
|
42
|
+
altKey: nls.localize(39, "Alt"),
|
|
43
|
+
metaKey: nls.localize(40, "Windows"),
|
|
44
44
|
separator: '+',
|
|
45
45
|
}, {
|
|
46
|
-
ctrlKey: nls.localize(
|
|
47
|
-
shiftKey: nls.localize(
|
|
48
|
-
altKey: nls.localize(
|
|
49
|
-
metaKey: nls.localize(
|
|
46
|
+
ctrlKey: nls.localize(41, "Ctrl"),
|
|
47
|
+
shiftKey: nls.localize(42, "Shift"),
|
|
48
|
+
altKey: nls.localize(43, "Alt"),
|
|
49
|
+
metaKey: nls.localize(44, "Super"),
|
|
50
50
|
separator: '+',
|
|
51
51
|
});
|
|
52
52
|
/**
|
|
53
53
|
* A label provider that prints modifiers in a suitable format for ARIA.
|
|
54
54
|
*/
|
|
55
55
|
export const AriaLabelProvider = new ModifierLabelProvider({
|
|
56
|
-
ctrlKey: nls.localize(
|
|
57
|
-
shiftKey: nls.localize(
|
|
58
|
-
altKey: nls.localize(
|
|
59
|
-
metaKey: nls.localize(
|
|
56
|
+
ctrlKey: nls.localize(45, "Control"),
|
|
57
|
+
shiftKey: nls.localize(46, "Shift"),
|
|
58
|
+
altKey: nls.localize(47, "Option"),
|
|
59
|
+
metaKey: nls.localize(48, "Command"),
|
|
60
60
|
separator: '+',
|
|
61
61
|
}, {
|
|
62
|
-
ctrlKey: nls.localize(
|
|
63
|
-
shiftKey: nls.localize(
|
|
64
|
-
altKey: nls.localize(
|
|
65
|
-
metaKey: nls.localize(
|
|
62
|
+
ctrlKey: nls.localize(49, "Control"),
|
|
63
|
+
shiftKey: nls.localize(50, "Shift"),
|
|
64
|
+
altKey: nls.localize(51, "Alt"),
|
|
65
|
+
metaKey: nls.localize(52, "Windows"),
|
|
66
66
|
separator: '+',
|
|
67
67
|
}, {
|
|
68
|
-
ctrlKey: nls.localize(
|
|
69
|
-
shiftKey: nls.localize(
|
|
70
|
-
altKey: nls.localize(
|
|
71
|
-
metaKey: nls.localize(
|
|
68
|
+
ctrlKey: nls.localize(53, "Control"),
|
|
69
|
+
shiftKey: nls.localize(54, "Shift"),
|
|
70
|
+
altKey: nls.localize(55, "Alt"),
|
|
71
|
+
metaKey: nls.localize(56, "Super"),
|
|
72
72
|
separator: '+',
|
|
73
73
|
});
|
|
74
74
|
/**
|
|
@@ -62,8 +62,6 @@ export var Schemas;
|
|
|
62
62
|
Schemas.vscodeChatInput = 'chatSessionInput';
|
|
63
63
|
/** Scheme used for local chat session content */
|
|
64
64
|
Schemas.vscodeLocalChatSession = 'vscode-chat-session';
|
|
65
|
-
/** Scheme used for virtual chat prompt files with embedded content */
|
|
66
|
-
Schemas.vscodeChatPrompt = 'vscode-chat-prompt';
|
|
67
65
|
/**
|
|
68
66
|
* Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)
|
|
69
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/network.ts","vs/base/common/network.ts"],"names":[],"mappings":"AAAA;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AAY,CAAC;QAC3B,CAAC;aAAM,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;QACnD,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAde,uBAAmB,sBAclC,CAAA;IAED;;;OAGG;IACH,SAAgB,cAAc,CAAC,WAAqD,EAAE,IAAa,EAAE,IAAa;QACjH,IAAI,CAAE,UAAoE,CAAC,mBAAmB,EAAE,CAAC;YAChG,2CAA2C;YAC3C,OAAO;QACR,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACpD,IAAI,WAAW,YAAY,eAAe,EAAE,CAAC;YAC5C,WAAW,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACP,WAAW,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC;QACzC,CAAC;IACF,CAAC;IAXe,kBAAc,iBAW7B,CAAA;AACF,CAAC,EA/CgB,GAAG,KAAH,GAAG,QA+CnB","file":"network.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 * as errors from './errors.js';\nimport * as platform from './platform.js';\nimport { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';\nimport { URI } from './uri.js';\nimport * as paths from './path.js';\n\nexport namespace Schemas {\n\n\t/**\n\t * A schema that is used for models that exist in memory\n\t * only and that have no correspondence on a server or such.\n\t */\n\texport const inMemory = 'inmemory';\n\n\t/**\n\t * A schema that is used for setting files\n\t */\n\texport const vscode = 'vscode';\n\n\t/**\n\t * A schema that is used for internal private files\n\t */\n\texport const internal = 'private';\n\n\t/**\n\t * A walk-through document.\n\t */\n\texport const walkThrough = 'walkThrough';\n\n\t/**\n\t * An embedded code snippet.\n\t */\n\texport const walkThroughSnippet = 'walkThroughSnippet';\n\n\texport const http = 'http';\n\n\texport const https = 'https';\n\n\texport const file = 'file';\n\n\texport const mailto = 'mailto';\n\n\texport const untitled = 'untitled';\n\n\texport const data = 'data';\n\n\texport const command = 'command';\n\n\texport const vscodeRemote = 'vscode-remote';\n\n\texport const vscodeRemoteResource = 'vscode-remote-resource';\n\n\texport const vscodeManagedRemoteResource = 'vscode-managed-remote-resource';\n\n\texport const vscodeUserData = 'vscode-userdata';\n\n\texport const vscodeCustomEditor = 'vscode-custom-editor';\n\n\texport const vscodeNotebookCell = 'vscode-notebook-cell';\n\texport const vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';\n\texport const vscodeNotebookCellMetadataDiff = 'vscode-notebook-cell-metadata-diff';\n\texport const vscodeNotebookCellOutput = 'vscode-notebook-cell-output';\n\texport const vscodeNotebookCellOutputDiff = 'vscode-notebook-cell-output-diff';\n\texport const vscodeNotebookMetadata = 'vscode-notebook-metadata';\n\texport const vscodeInteractiveInput = 'vscode-interactive-input';\n\n\texport const vscodeSettings = 'vscode-settings';\n\n\texport const vscodeWorkspaceTrust = 'vscode-workspace-trust';\n\n\texport const vscodeTerminal = 'vscode-terminal';\n\n\t/** Scheme used for code blocks in chat. */\n\texport const vscodeChatCodeBlock = 'vscode-chat-code-block';\n\n\t/** Scheme used for LHS of code compare (aka diff) blocks in chat. */\n\texport const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';\n\n\t/** Scheme used for the chat input editor. */\n\texport const vscodeChatEditor = 'vscode-chat-editor';\n\n\t/** Scheme used for the chat input part */\n\texport const vscodeChatInput = 'chatSessionInput';\n\n\t/** Scheme used for local chat session content */\n\texport const vscodeLocalChatSession = 'vscode-chat-session';\n\n\t/** Scheme used for virtual chat prompt files with embedded content */\n\texport const vscodeChatPrompt = 'vscode-chat-prompt';\n\n\t/**\n\t * Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)\n\t */\n\texport const webviewPanel = 'webview-panel';\n\n\t/**\n\t * Scheme used for loading the wrapper html and script in webviews.\n\t */\n\texport const vscodeWebview = 'vscode-webview';\n\n\t/**\n\t * Scheme used for integrated browser tabs using WebContentsView.\n\t */\n\texport const vscodeBrowser = 'vscode-browser';\n\n\t/**\n\t * Scheme used for extension pages\n\t */\n\texport const extension = 'extension';\n\n\t/**\n\t * Scheme used as a replacement of `file` scheme to load\n\t * files with our custom protocol handler (desktop only).\n\t */\n\texport const vscodeFileResource = 'vscode-file';\n\n\t/**\n\t * Scheme used for temporary resources\n\t */\n\texport const tmp = 'tmp';\n\n\t/**\n\t * Scheme used vs live share\n\t */\n\texport const vsls = 'vsls';\n\n\t/**\n\t * Scheme used for the Source Control commit input's text document\n\t */\n\texport const vscodeSourceControl = 'vscode-scm';\n\n\t/**\n\t * Scheme used for input box for creating comments.\n\t */\n\texport const commentsInput = 'comment';\n\n\t/**\n\t * Scheme used for special rendering of settings in the release notes\n\t */\n\texport const codeSetting = 'code-setting';\n\n\t/**\n\t * Scheme used for output panel resources\n\t */\n\texport const outputChannel = 'output';\n\n\t/**\n\t * Scheme used for the accessible view\n\t */\n\texport const accessibleView = 'accessible-view';\n\n\t/**\n\t * Used for snapshots of chat edits\n\t */\n\texport const chatEditingSnapshotScheme = 'chat-editing-snapshot-text-model';\n\texport const chatEditingModel = 'chat-editing-text-model';\n\n\t/**\n\t * Used for rendering multidiffs in copilot agent sessions\n\t */\n\texport const copilotPr = 'copilot-pr';\n}\n\nexport function matchesScheme(target: URI | string, scheme: string): boolean {\n\tif (URI.isUri(target)) {\n\t\treturn equalsIgnoreCase(target.scheme, scheme);\n\t} else {\n\t\treturn startsWithIgnoreCase(target, scheme + ':');\n\t}\n}\n\nexport function matchesSomeScheme(target: URI | string, ...schemes: string[]): boolean {\n\treturn schemes.some(scheme => matchesScheme(target, scheme));\n}\nexport const connectionTokenQueryName = 'tkn';\n\nclass RemoteAuthoritiesImpl {\n\tprivate readonly _hosts: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate readonly _ports: { [authority: string]: number | undefined } = Object.create(null);\n\tprivate readonly _connectionTokens: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate _preferredWebSchema: 'http' | 'https' = 'http';\n\tprivate _delegate: ((uri: URI) => URI) | null = null;\n\tprivate _serverRootPath: string = '/';\n\n\tsetPreferredWebSchema(schema: 'http' | 'https') {\n\t\tthis._preferredWebSchema = schema;\n\t}\n\n\tprivate get _remoteResourcesPath(): string {\n\t\treturn paths.posix.join(this._serverRootPath, Schemas.vscodeRemoteResource);\n\t}\n\n\trewrite(uri: URI): URI {\n\t\tif (this._delegate) {\n\t\t\ttry {\n\t\t\t\treturn this._delegate(uri);\n\t\t\t} catch (err) {\n\t\t\t\terrors.onUnexpectedError(err);\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t}\n\t\tconst authority = uri.authority;\n\t\tlet host = this._hosts[authority];\n\t\tif (host && host.indexOf(':') !== -1 && host.indexOf('[') === -1) {\n\t\t\thost = `[${host}]`;\n\t\t}\n\t\tconst port = this._ports[authority];\n\t\tconst connectionToken = this._connectionTokens[authority];\n\t\tlet query = `path=${encodeURIComponent(uri.path)}`;\n\t\tif (typeof connectionToken === 'string') {\n\t\t\tquery += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;\n\t\t}\n\t\treturn URI.from({\n\t\t\tscheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,\n\t\t\tauthority: `${host}:${port}`,\n\t\t\tpath: this._remoteResourcesPath,\n\t\t\tquery\n\t\t});\n\t}\n}\n\nexport const RemoteAuthorities = new RemoteAuthoritiesImpl();\n\n/**\n * A string pointing to a path inside the app. It should not begin with ./ or ../\n */\nexport type AppResourcePath = (\n\t`a${string}` | `b${string}` | `c${string}` | `d${string}` | `e${string}` | `f${string}`\n\t| `g${string}` | `h${string}` | `i${string}` | `j${string}` | `k${string}` | `l${string}`\n\t| `m${string}` | `n${string}` | `o${string}` | `p${string}` | `q${string}` | `r${string}`\n\t| `s${string}` | `t${string}` | `u${string}` | `v${string}` | `w${string}` | `x${string}`\n\t| `y${string}` | `z${string}`\n);\n\nexport const VSCODE_AUTHORITY = 'vscode-app';\n\nclass FileAccessImpl {\n\n\tprivate static readonly FALLBACK_AUTHORITY = VSCODE_AUTHORITY;\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\tasBrowserUri(resourcePath: AppResourcePath | ''): URI {\n\t\tconst uri = this.toUri(resourcePath);\n\t\treturn this.uriToBrowserUri(uri);\n\t}\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\turiToBrowserUri(uri: URI): URI {\n\t\t// Handle remote URIs via `RemoteAuthorities`\n\t\tif (uri.scheme === Schemas.vscodeRemote) {\n\t\t\treturn RemoteAuthorities.rewrite(uri);\n\t\t}\n\n\t\t// Convert to `vscode-file` resource..\n\t\tif (\n\t\t\t// ...only ever for `file` resources\n\t\t\turi.scheme === Schemas.file &&\n\t\t\t(\n\t\t\t\t// ...and we run in native environments\n\t\t\t\tplatform.isNative ||\n\t\t\t\t// ...or web worker extensions on desktop\n\t\t\t\t(platform.webWorkerOrigin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)\n\t\t\t)\n\t\t) {\n\t\t\treturn uri.with({\n\t\t\t\tscheme: Schemas.vscodeFileResource,\n\t\t\t\t// We need to provide an authority here so that it can serve\n\t\t\t\t// as origin for network and loading matters in chromium.\n\t\t\t\t// If the URI is not coming with an authority already, we\n\t\t\t\t// add our own\n\t\t\t\tauthority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY,\n\t\t\t\tquery: null,\n\t\t\t\tfragment: null\n\t\t\t});\n\t\t}\n\n\t\treturn uri;\n\t}\n\n\tprivate toUri(uriOrModule: URI | string): URI {\n\t\tif (URI.isUri(uriOrModule)) {\n\t\t\treturn uriOrModule;\n\t\t}\n\n\t\tif (globalThis._VSCODE_FILE_ROOT) {\n\t\t\tconst rootUriOrPath = globalThis._VSCODE_FILE_ROOT;\n\n\t\t\t// File URL (with scheme)\n\t\t\tif (/^\\w[\\w\\d+.-]*:\\/\\//.test(rootUriOrPath)) {\n\t\t\t\treturn URI.joinPath(URI.parse(rootUriOrPath, true), uriOrModule);\n\t\t\t}\n\n\t\t\t// File Path (no scheme)\n\t\t\tconst modulePath = paths.join(rootUriOrPath, uriOrModule);\n\t\t\treturn URI.file(modulePath);\n\t\t}\n\n\t\tthrow new Error('Cannot determine URI for module id!');\n\t}\n}\n\nexport const FileAccess = new FileAccessImpl();\n\nexport const CacheControlheaders: Record<string, string> = Object.freeze({\n\t'Cache-Control': 'no-cache, no-store'\n});\n\nexport const DocumentPolicyheaders: Record<string, string> = Object.freeze({\n\t'Document-Policy': 'include-js-call-stacks-in-crash-reports'\n});\n\nexport namespace COI {\n\n\tconst coiHeaders = new Map<'3' | '2' | '1' | string, Record<string, string>>([\n\t\t['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],\n\t\t['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t\t['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t]);\n\n\texport const CoopAndCoep = Object.freeze(coiHeaders.get('3'));\n\n\tconst coiSearchParamName = 'vscode-coi';\n\n\t/**\n\t * Extract desired headers from `vscode-coi` invocation\n\t */\n\texport function getHeadersFromQuery(url: string | URI | URL): Record<string, string> | undefined {\n\t\tlet params: URLSearchParams | undefined;\n\t\tif (typeof url === 'string') {\n\t\t\tparams = new URL(url).searchParams;\n\t\t} else if (url instanceof URL) {\n\t\t\tparams = url.searchParams;\n\t\t} else if (URI.isUri(url)) {\n\t\t\tparams = new URL(url.toString(true)).searchParams;\n\t\t}\n\t\tconst value = params?.get(coiSearchParamName);\n\t\tif (!value) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn coiHeaders.get(value);\n\t}\n\n\t/**\n\t * Add the `vscode-coi` query attribute based on wanting `COOP` and `COEP`. Will be a noop when `crossOriginIsolated`\n\t * isn't enabled the current context\n\t */\n\texport function addSearchParam(urlOrSearch: URLSearchParams | Record<string, string>, coop: boolean, coep: boolean): void {\n\t\tif (!(globalThis as typeof globalThis & { crossOriginIsolated?: boolean }).crossOriginIsolated) {\n\t\t\t// depends on the current context being COI\n\t\t\treturn;\n\t\t}\n\t\tconst value = coop && coep ? '3' : coep ? '2' : '1';\n\t\tif (urlOrSearch instanceof URLSearchParams) {\n\t\t\turlOrSearch.set(coiSearchParamName, value);\n\t\t} else {\n\t\t\turlOrSearch[coiSearchParamName] = value;\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as errors from './errors.js';\nimport * as platform from './platform.js';\nimport { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';\nimport { URI } from './uri.js';\nimport * as paths from './path.js';\n\nexport namespace Schemas {\n\n\t/**\n\t * A schema that is used for models that exist in memory\n\t * only and that have no correspondence on a server or such.\n\t */\n\texport const inMemory = 'inmemory';\n\n\t/**\n\t * A schema that is used for setting files\n\t */\n\texport const vscode = 'vscode';\n\n\t/**\n\t * A schema that is used for internal private files\n\t */\n\texport const internal = 'private';\n\n\t/**\n\t * A walk-through document.\n\t */\n\texport const walkThrough = 'walkThrough';\n\n\t/**\n\t * An embedded code snippet.\n\t */\n\texport const walkThroughSnippet = 'walkThroughSnippet';\n\n\texport const http = 'http';\n\n\texport const https = 'https';\n\n\texport const file = 'file';\n\n\texport const mailto = 'mailto';\n\n\texport const untitled = 'untitled';\n\n\texport const data = 'data';\n\n\texport const command = 'command';\n\n\texport const vscodeRemote = 'vscode-remote';\n\n\texport const vscodeRemoteResource = 'vscode-remote-resource';\n\n\texport const vscodeManagedRemoteResource = 'vscode-managed-remote-resource';\n\n\texport const vscodeUserData = 'vscode-userdata';\n\n\texport const vscodeCustomEditor = 'vscode-custom-editor';\n\n\texport const vscodeNotebookCell = 'vscode-notebook-cell';\n\texport const vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';\n\texport const vscodeNotebookCellMetadataDiff = 'vscode-notebook-cell-metadata-diff';\n\texport const vscodeNotebookCellOutput = 'vscode-notebook-cell-output';\n\texport const vscodeNotebookCellOutputDiff = 'vscode-notebook-cell-output-diff';\n\texport const vscodeNotebookMetadata = 'vscode-notebook-metadata';\n\texport const vscodeInteractiveInput = 'vscode-interactive-input';\n\n\texport const vscodeSettings = 'vscode-settings';\n\n\texport const vscodeWorkspaceTrust = 'vscode-workspace-trust';\n\n\texport const vscodeTerminal = 'vscode-terminal';\n\n\t/** Scheme used for code blocks in chat. */\n\texport const vscodeChatCodeBlock = 'vscode-chat-code-block';\n\n\t/** Scheme used for LHS of code compare (aka diff) blocks in chat. */\n\texport const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';\n\n\t/** Scheme used for the chat input editor. */\n\texport const vscodeChatEditor = 'vscode-chat-editor';\n\n\t/** Scheme used for the chat input part */\n\texport const vscodeChatInput = 'chatSessionInput';\n\n\t/** Scheme used for local chat session content */\n\texport const vscodeLocalChatSession = 'vscode-chat-session';\n\n\t/** Scheme used for virtual chat prompt files with embedded content */\n\texport const vscodeChatPrompt = 'vscode-chat-prompt';\n\n\t/**\n\t * Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)\n\t */\n\texport const webviewPanel = 'webview-panel';\n\n\t/**\n\t * Scheme used for loading the wrapper html and script in webviews.\n\t */\n\texport const vscodeWebview = 'vscode-webview';\n\n\t/**\n\t * Scheme used for integrated browser tabs using WebContentsView.\n\t */\n\texport const vscodeBrowser = 'vscode-browser';\n\n\t/**\n\t * Scheme used for extension pages\n\t */\n\texport const extension = 'extension';\n\n\t/**\n\t * Scheme used as a replacement of `file` scheme to load\n\t * files with our custom protocol handler (desktop only).\n\t */\n\texport const vscodeFileResource = 'vscode-file';\n\n\t/**\n\t * Scheme used for temporary resources\n\t */\n\texport const tmp = 'tmp';\n\n\t/**\n\t * Scheme used vs live share\n\t */\n\texport const vsls = 'vsls';\n\n\t/**\n\t * Scheme used for the Source Control commit input's text document\n\t */\n\texport const vscodeSourceControl = 'vscode-scm';\n\n\t/**\n\t * Scheme used for input box for creating comments.\n\t */\n\texport const commentsInput = 'comment';\n\n\t/**\n\t * Scheme used for special rendering of settings in the release notes\n\t */\n\texport const codeSetting = 'code-setting';\n\n\t/**\n\t * Scheme used for output panel resources\n\t */\n\texport const outputChannel = 'output';\n\n\t/**\n\t * Scheme used for the accessible view\n\t */\n\texport const accessibleView = 'accessible-view';\n\n\t/**\n\t * Used for snapshots of chat edits\n\t */\n\texport const chatEditingSnapshotScheme = 'chat-editing-snapshot-text-model';\n\texport const chatEditingModel = 'chat-editing-text-model';\n\n\t/**\n\t * Used for rendering multidiffs in copilot agent sessions\n\t */\n\texport const copilotPr = 'copilot-pr';\n}\n\nexport function matchesScheme(target: URI | string, scheme: string): boolean {\n\tif (URI.isUri(target)) {\n\t\treturn equalsIgnoreCase(target.scheme, scheme);\n\t} else {\n\t\treturn startsWithIgnoreCase(target, scheme + ':');\n\t}\n}\n\nexport function matchesSomeScheme(target: URI | string, ...schemes: string[]): boolean {\n\treturn schemes.some(scheme => matchesScheme(target, scheme));\n}\nexport const connectionTokenQueryName = 'tkn';\n\nclass RemoteAuthoritiesImpl {\n\tprivate readonly _hosts: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate readonly _ports: { [authority: string]: number | undefined } = Object.create(null);\n\tprivate readonly _connectionTokens: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate _preferredWebSchema: 'http' | 'https' = 'http';\n\tprivate _delegate: ((uri: URI) => URI) | null = null;\n\tprivate _serverRootPath: string = '/';\n\n\tsetPreferredWebSchema(schema: 'http' | 'https') {\n\t\tthis._preferredWebSchema = schema;\n\t}\n\n\tprivate get _remoteResourcesPath(): string {\n\t\treturn paths.posix.join(this._serverRootPath, Schemas.vscodeRemoteResource);\n\t}\n\n\trewrite(uri: URI): URI {\n\t\tif (this._delegate) {\n\t\t\ttry {\n\t\t\t\treturn this._delegate(uri);\n\t\t\t} catch (err) {\n\t\t\t\terrors.onUnexpectedError(err);\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t}\n\t\tconst authority = uri.authority;\n\t\tlet host = this._hosts[authority];\n\t\tif (host && host.indexOf(':') !== -1 && host.indexOf('[') === -1) {\n\t\t\thost = `[${host}]`;\n\t\t}\n\t\tconst port = this._ports[authority];\n\t\tconst connectionToken = this._connectionTokens[authority];\n\t\tlet query = `path=${encodeURIComponent(uri.path)}`;\n\t\tif (typeof connectionToken === 'string') {\n\t\t\tquery += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;\n\t\t}\n\t\treturn URI.from({\n\t\t\tscheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,\n\t\t\tauthority: `${host}:${port}`,\n\t\t\tpath: this._remoteResourcesPath,\n\t\t\tquery\n\t\t});\n\t}\n}\n\nexport const RemoteAuthorities = new RemoteAuthoritiesImpl();\n\n/**\n * A string pointing to a path inside the app. It should not begin with ./ or ../\n */\nexport type AppResourcePath = (\n\t`a${string}` | `b${string}` | `c${string}` | `d${string}` | `e${string}` | `f${string}`\n\t| `g${string}` | `h${string}` | `i${string}` | `j${string}` | `k${string}` | `l${string}`\n\t| `m${string}` | `n${string}` | `o${string}` | `p${string}` | `q${string}` | `r${string}`\n\t| `s${string}` | `t${string}` | `u${string}` | `v${string}` | `w${string}` | `x${string}`\n\t| `y${string}` | `z${string}`\n);\n\nexport const VSCODE_AUTHORITY = 'vscode-app';\n\nclass FileAccessImpl {\n\n\tprivate static readonly FALLBACK_AUTHORITY = VSCODE_AUTHORITY;\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\tasBrowserUri(resourcePath: AppResourcePath | ''): URI {\n\t\tconst uri = this.toUri(resourcePath);\n\t\treturn this.uriToBrowserUri(uri);\n\t}\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\turiToBrowserUri(uri: URI): URI {\n\t\t// Handle remote URIs via `RemoteAuthorities`\n\t\tif (uri.scheme === Schemas.vscodeRemote) {\n\t\t\treturn RemoteAuthorities.rewrite(uri);\n\t\t}\n\n\t\t// Convert to `vscode-file` resource..\n\t\tif (\n\t\t\t// ...only ever for `file` resources\n\t\t\turi.scheme === Schemas.file &&\n\t\t\t(\n\t\t\t\t// ...and we run in native environments\n\t\t\t\tplatform.isNative ||\n\t\t\t\t// ...or web worker extensions on desktop\n\t\t\t\t(platform.webWorkerOrigin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)\n\t\t\t)\n\t\t) {\n\t\t\treturn uri.with({\n\t\t\t\tscheme: Schemas.vscodeFileResource,\n\t\t\t\t// We need to provide an authority here so that it can serve\n\t\t\t\t// as origin for network and loading matters in chromium.\n\t\t\t\t// If the URI is not coming with an authority already, we\n\t\t\t\t// add our own\n\t\t\t\tauthority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY,\n\t\t\t\tquery: null,\n\t\t\t\tfragment: null\n\t\t\t});\n\t\t}\n\n\t\treturn uri;\n\t}\n\n\tprivate toUri(uriOrModule: URI | string): URI {\n\t\tif (URI.isUri(uriOrModule)) {\n\t\t\treturn uriOrModule;\n\t\t}\n\n\t\tif (globalThis._VSCODE_FILE_ROOT) {\n\t\t\tconst rootUriOrPath = globalThis._VSCODE_FILE_ROOT;\n\n\t\t\t// File URL (with scheme)\n\t\t\tif (/^\\w[\\w\\d+.-]*:\\/\\//.test(rootUriOrPath)) {\n\t\t\t\treturn URI.joinPath(URI.parse(rootUriOrPath, true), uriOrModule);\n\t\t\t}\n\n\t\t\t// File Path (no scheme)\n\t\t\tconst modulePath = paths.join(rootUriOrPath, uriOrModule);\n\t\t\treturn URI.file(modulePath);\n\t\t}\n\n\t\tthrow new Error('Cannot determine URI for module id!');\n\t}\n}\n\nexport const FileAccess = new FileAccessImpl();\n\nexport const CacheControlheaders: Record<string, string> = Object.freeze({\n\t'Cache-Control': 'no-cache, no-store'\n});\n\nexport const DocumentPolicyheaders: Record<string, string> = Object.freeze({\n\t'Document-Policy': 'include-js-call-stacks-in-crash-reports'\n});\n\nexport namespace COI {\n\n\tconst coiHeaders = new Map<'3' | '2' | '1' | string, Record<string, string>>([\n\t\t['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],\n\t\t['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t\t['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t]);\n\n\texport const CoopAndCoep = Object.freeze(coiHeaders.get('3'));\n\n\tconst coiSearchParamName = 'vscode-coi';\n\n\t/**\n\t * Extract desired headers from `vscode-coi` invocation\n\t */\n\texport function getHeadersFromQuery(url: string | URI | URL): Record<string, string> | undefined {\n\t\tlet params: URLSearchParams | undefined;\n\t\tif (typeof url === 'string') {\n\t\t\tparams = new URL(url).searchParams;\n\t\t} else if (url instanceof URL) {\n\t\t\tparams = url.searchParams;\n\t\t} else if (URI.isUri(url)) {\n\t\t\tparams = new URL(url.toString(true)).searchParams;\n\t\t}\n\t\tconst value = params?.get(coiSearchParamName);\n\t\tif (!value) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn coiHeaders.get(value);\n\t}\n\n\t/**\n\t * Add the `vscode-coi` query attribute based on wanting `COOP` and `COEP`. Will be a noop when `crossOriginIsolated`\n\t * isn't enabled the current context\n\t */\n\texport function addSearchParam(urlOrSearch: URLSearchParams | Record<string, string>, coop: boolean, coep: boolean): void {\n\t\tif (!(globalThis as typeof globalThis & { crossOriginIsolated?: boolean }).crossOriginIsolated) {\n\t\t\t// depends on the current context being COI\n\t\t\treturn;\n\t\t}\n\t\tconst value = coop && coep ? '3' : coep ? '2' : '1';\n\t\tif (urlOrSearch instanceof URLSearchParams) {\n\t\t\turlOrSearch.set(coiSearchParamName, value);\n\t\t} else {\n\t\t\turlOrSearch[coiSearchParamName] = value;\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/network.ts","vs/base/common/network.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,WAAW,CAAC;AAEnC,MAAM,KAAW,OAAO,CAwJvB;AAxJD,WAAiB,OAAO;IAEvB;;;OAGG;IACU,gBAAQ,GAAG,UAAU,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C;IAde,uBAAmB,sBAclC,CAAA;IAED;;;OAGG;IACH,SAAgB,cAAc,CAAC,WAAqD,EAAE,IAAa,EAAE,IAAa;QACjH,IAAI,CAAE,UAAoE,CAAC,mBAAmB,EAAE,CAAC;YAChG,2CAA2C;YAC3C,OAAO;QACR,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACpD,IAAI,WAAW,YAAY,eAAe,EAAE,CAAC;YAC5C,WAAW,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACP,WAAW,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC;QACzC,CAAC;IACF,CAAC;IAXe,kBAAc,iBAW7B,CAAA;AACF,CAAC,EA/CgB,GAAG,KAAH,GAAG,QA+CnB","file":"network.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 * as errors from './errors.js';\nimport * as platform from './platform.js';\nimport { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';\nimport { URI } from './uri.js';\nimport * as paths from './path.js';\n\nexport namespace Schemas {\n\n\t/**\n\t * A schema that is used for models that exist in memory\n\t * only and that have no correspondence on a server or such.\n\t */\n\texport const inMemory = 'inmemory';\n\n\t/**\n\t * A schema that is used for setting files\n\t */\n\texport const vscode = 'vscode';\n\n\t/**\n\t * A schema that is used for internal private files\n\t */\n\texport const internal = 'private';\n\n\t/**\n\t * A walk-through document.\n\t */\n\texport const walkThrough = 'walkThrough';\n\n\t/**\n\t * An embedded code snippet.\n\t */\n\texport const walkThroughSnippet = 'walkThroughSnippet';\n\n\texport const http = 'http';\n\n\texport const https = 'https';\n\n\texport const file = 'file';\n\n\texport const mailto = 'mailto';\n\n\texport const untitled = 'untitled';\n\n\texport const data = 'data';\n\n\texport const command = 'command';\n\n\texport const vscodeRemote = 'vscode-remote';\n\n\texport const vscodeRemoteResource = 'vscode-remote-resource';\n\n\texport const vscodeManagedRemoteResource = 'vscode-managed-remote-resource';\n\n\texport const vscodeUserData = 'vscode-userdata';\n\n\texport const vscodeCustomEditor = 'vscode-custom-editor';\n\n\texport const vscodeNotebookCell = 'vscode-notebook-cell';\n\texport const vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';\n\texport const vscodeNotebookCellMetadataDiff = 'vscode-notebook-cell-metadata-diff';\n\texport const vscodeNotebookCellOutput = 'vscode-notebook-cell-output';\n\texport const vscodeNotebookCellOutputDiff = 'vscode-notebook-cell-output-diff';\n\texport const vscodeNotebookMetadata = 'vscode-notebook-metadata';\n\texport const vscodeInteractiveInput = 'vscode-interactive-input';\n\n\texport const vscodeSettings = 'vscode-settings';\n\n\texport const vscodeWorkspaceTrust = 'vscode-workspace-trust';\n\n\texport const vscodeTerminal = 'vscode-terminal';\n\n\t/** Scheme used for code blocks in chat. */\n\texport const vscodeChatCodeBlock = 'vscode-chat-code-block';\n\n\t/** Scheme used for LHS of code compare (aka diff) blocks in chat. */\n\texport const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';\n\n\t/** Scheme used for the chat input editor. */\n\texport const vscodeChatEditor = 'vscode-chat-editor';\n\n\t/** Scheme used for the chat input part */\n\texport const vscodeChatInput = 'chatSessionInput';\n\n\t/** Scheme used for local chat session content */\n\texport const vscodeLocalChatSession = 'vscode-chat-session';\n\n\t/**\n\t * Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)\n\t */\n\texport const webviewPanel = 'webview-panel';\n\n\t/**\n\t * Scheme used for loading the wrapper html and script in webviews.\n\t */\n\texport const vscodeWebview = 'vscode-webview';\n\n\t/**\n\t * Scheme used for integrated browser tabs using WebContentsView.\n\t */\n\texport const vscodeBrowser = 'vscode-browser';\n\n\t/**\n\t * Scheme used for extension pages\n\t */\n\texport const extension = 'extension';\n\n\t/**\n\t * Scheme used as a replacement of `file` scheme to load\n\t * files with our custom protocol handler (desktop only).\n\t */\n\texport const vscodeFileResource = 'vscode-file';\n\n\t/**\n\t * Scheme used for temporary resources\n\t */\n\texport const tmp = 'tmp';\n\n\t/**\n\t * Scheme used vs live share\n\t */\n\texport const vsls = 'vsls';\n\n\t/**\n\t * Scheme used for the Source Control commit input's text document\n\t */\n\texport const vscodeSourceControl = 'vscode-scm';\n\n\t/**\n\t * Scheme used for input box for creating comments.\n\t */\n\texport const commentsInput = 'comment';\n\n\t/**\n\t * Scheme used for special rendering of settings in the release notes\n\t */\n\texport const codeSetting = 'code-setting';\n\n\t/**\n\t * Scheme used for output panel resources\n\t */\n\texport const outputChannel = 'output';\n\n\t/**\n\t * Scheme used for the accessible view\n\t */\n\texport const accessibleView = 'accessible-view';\n\n\t/**\n\t * Used for snapshots of chat edits\n\t */\n\texport const chatEditingSnapshotScheme = 'chat-editing-snapshot-text-model';\n\texport const chatEditingModel = 'chat-editing-text-model';\n\n\t/**\n\t * Used for rendering multidiffs in copilot agent sessions\n\t */\n\texport const copilotPr = 'copilot-pr';\n}\n\nexport function matchesScheme(target: URI | string, scheme: string): boolean {\n\tif (URI.isUri(target)) {\n\t\treturn equalsIgnoreCase(target.scheme, scheme);\n\t} else {\n\t\treturn startsWithIgnoreCase(target, scheme + ':');\n\t}\n}\n\nexport function matchesSomeScheme(target: URI | string, ...schemes: string[]): boolean {\n\treturn schemes.some(scheme => matchesScheme(target, scheme));\n}\nexport const connectionTokenQueryName = 'tkn';\n\nclass RemoteAuthoritiesImpl {\n\tprivate readonly _hosts: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate readonly _ports: { [authority: string]: number | undefined } = Object.create(null);\n\tprivate readonly _connectionTokens: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate _preferredWebSchema: 'http' | 'https' = 'http';\n\tprivate _delegate: ((uri: URI) => URI) | null = null;\n\tprivate _serverRootPath: string = '/';\n\n\tsetPreferredWebSchema(schema: 'http' | 'https') {\n\t\tthis._preferredWebSchema = schema;\n\t}\n\n\tprivate get _remoteResourcesPath(): string {\n\t\treturn paths.posix.join(this._serverRootPath, Schemas.vscodeRemoteResource);\n\t}\n\n\trewrite(uri: URI): URI {\n\t\tif (this._delegate) {\n\t\t\ttry {\n\t\t\t\treturn this._delegate(uri);\n\t\t\t} catch (err) {\n\t\t\t\terrors.onUnexpectedError(err);\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t}\n\t\tconst authority = uri.authority;\n\t\tlet host = this._hosts[authority];\n\t\tif (host && host.indexOf(':') !== -1 && host.indexOf('[') === -1) {\n\t\t\thost = `[${host}]`;\n\t\t}\n\t\tconst port = this._ports[authority];\n\t\tconst connectionToken = this._connectionTokens[authority];\n\t\tlet query = `path=${encodeURIComponent(uri.path)}`;\n\t\tif (typeof connectionToken === 'string') {\n\t\t\tquery += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;\n\t\t}\n\t\treturn URI.from({\n\t\t\tscheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,\n\t\t\tauthority: `${host}:${port}`,\n\t\t\tpath: this._remoteResourcesPath,\n\t\t\tquery\n\t\t});\n\t}\n}\n\nexport const RemoteAuthorities = new RemoteAuthoritiesImpl();\n\n/**\n * A string pointing to a path inside the app. It should not begin with ./ or ../\n */\nexport type AppResourcePath = (\n\t`a${string}` | `b${string}` | `c${string}` | `d${string}` | `e${string}` | `f${string}`\n\t| `g${string}` | `h${string}` | `i${string}` | `j${string}` | `k${string}` | `l${string}`\n\t| `m${string}` | `n${string}` | `o${string}` | `p${string}` | `q${string}` | `r${string}`\n\t| `s${string}` | `t${string}` | `u${string}` | `v${string}` | `w${string}` | `x${string}`\n\t| `y${string}` | `z${string}`\n);\n\nexport const VSCODE_AUTHORITY = 'vscode-app';\n\nclass FileAccessImpl {\n\n\tprivate static readonly FALLBACK_AUTHORITY = VSCODE_AUTHORITY;\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\tasBrowserUri(resourcePath: AppResourcePath | ''): URI {\n\t\tconst uri = this.toUri(resourcePath);\n\t\treturn this.uriToBrowserUri(uri);\n\t}\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\turiToBrowserUri(uri: URI): URI {\n\t\t// Handle remote URIs via `RemoteAuthorities`\n\t\tif (uri.scheme === Schemas.vscodeRemote) {\n\t\t\treturn RemoteAuthorities.rewrite(uri);\n\t\t}\n\n\t\t// Convert to `vscode-file` resource..\n\t\tif (\n\t\t\t// ...only ever for `file` resources\n\t\t\turi.scheme === Schemas.file &&\n\t\t\t(\n\t\t\t\t// ...and we run in native environments\n\t\t\t\tplatform.isNative ||\n\t\t\t\t// ...or web worker extensions on desktop\n\t\t\t\t(platform.webWorkerOrigin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)\n\t\t\t)\n\t\t) {\n\t\t\treturn uri.with({\n\t\t\t\tscheme: Schemas.vscodeFileResource,\n\t\t\t\t// We need to provide an authority here so that it can serve\n\t\t\t\t// as origin for network and loading matters in chromium.\n\t\t\t\t// If the URI is not coming with an authority already, we\n\t\t\t\t// add our own\n\t\t\t\tauthority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY,\n\t\t\t\tquery: null,\n\t\t\t\tfragment: null\n\t\t\t});\n\t\t}\n\n\t\treturn uri;\n\t}\n\n\tprivate toUri(uriOrModule: URI | string): URI {\n\t\tif (URI.isUri(uriOrModule)) {\n\t\t\treturn uriOrModule;\n\t\t}\n\n\t\tif (globalThis._VSCODE_FILE_ROOT) {\n\t\t\tconst rootUriOrPath = globalThis._VSCODE_FILE_ROOT;\n\n\t\t\t// File URL (with scheme)\n\t\t\tif (/^\\w[\\w\\d+.-]*:\\/\\//.test(rootUriOrPath)) {\n\t\t\t\treturn URI.joinPath(URI.parse(rootUriOrPath, true), uriOrModule);\n\t\t\t}\n\n\t\t\t// File Path (no scheme)\n\t\t\tconst modulePath = paths.join(rootUriOrPath, uriOrModule);\n\t\t\treturn URI.file(modulePath);\n\t\t}\n\n\t\tthrow new Error('Cannot determine URI for module id!');\n\t}\n}\n\nexport const FileAccess = new FileAccessImpl();\n\nexport const CacheControlheaders: Record<string, string> = Object.freeze({\n\t'Cache-Control': 'no-cache, no-store'\n});\n\nexport const DocumentPolicyheaders: Record<string, string> = Object.freeze({\n\t'Document-Policy': 'include-js-call-stacks-in-crash-reports'\n});\n\nexport namespace COI {\n\n\tconst coiHeaders = new Map<'3' | '2' | '1' | string, Record<string, string>>([\n\t\t['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],\n\t\t['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t\t['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t]);\n\n\texport const CoopAndCoep = Object.freeze(coiHeaders.get('3'));\n\n\tconst coiSearchParamName = 'vscode-coi';\n\n\t/**\n\t * Extract desired headers from `vscode-coi` invocation\n\t */\n\texport function getHeadersFromQuery(url: string | URI | URL): Record<string, string> | undefined {\n\t\tlet params: URLSearchParams | undefined;\n\t\tif (typeof url === 'string') {\n\t\t\tparams = new URL(url).searchParams;\n\t\t} else if (url instanceof URL) {\n\t\t\tparams = url.searchParams;\n\t\t} else if (URI.isUri(url)) {\n\t\t\tparams = new URL(url.toString(true)).searchParams;\n\t\t}\n\t\tconst value = params?.get(coiSearchParamName);\n\t\tif (!value) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn coiHeaders.get(value);\n\t}\n\n\t/**\n\t * Add the `vscode-coi` query attribute based on wanting `COOP` and `COEP`. Will be a noop when `crossOriginIsolated`\n\t * isn't enabled the current context\n\t */\n\texport function addSearchParam(urlOrSearch: URLSearchParams | Record<string, string>, coop: boolean, coep: boolean): void {\n\t\tif (!(globalThis as typeof globalThis & { crossOriginIsolated?: boolean }).crossOriginIsolated) {\n\t\t\t// depends on the current context being COI\n\t\t\treturn;\n\t\t}\n\t\tconst value = coop && coep ? '3' : coep ? '2' : '1';\n\t\tif (urlOrSearch instanceof URLSearchParams) {\n\t\t\turlOrSearch.set(coiSearchParamName, value);\n\t\t} else {\n\t\t\turlOrSearch[coiSearchParamName] = value;\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as errors from './errors.js';\nimport * as platform from './platform.js';\nimport { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';\nimport { URI } from './uri.js';\nimport * as paths from './path.js';\n\nexport namespace Schemas {\n\n\t/**\n\t * A schema that is used for models that exist in memory\n\t * only and that have no correspondence on a server or such.\n\t */\n\texport const inMemory = 'inmemory';\n\n\t/**\n\t * A schema that is used for setting files\n\t */\n\texport const vscode = 'vscode';\n\n\t/**\n\t * A schema that is used for internal private files\n\t */\n\texport const internal = 'private';\n\n\t/**\n\t * A walk-through document.\n\t */\n\texport const walkThrough = 'walkThrough';\n\n\t/**\n\t * An embedded code snippet.\n\t */\n\texport const walkThroughSnippet = 'walkThroughSnippet';\n\n\texport const http = 'http';\n\n\texport const https = 'https';\n\n\texport const file = 'file';\n\n\texport const mailto = 'mailto';\n\n\texport const untitled = 'untitled';\n\n\texport const data = 'data';\n\n\texport const command = 'command';\n\n\texport const vscodeRemote = 'vscode-remote';\n\n\texport const vscodeRemoteResource = 'vscode-remote-resource';\n\n\texport const vscodeManagedRemoteResource = 'vscode-managed-remote-resource';\n\n\texport const vscodeUserData = 'vscode-userdata';\n\n\texport const vscodeCustomEditor = 'vscode-custom-editor';\n\n\texport const vscodeNotebookCell = 'vscode-notebook-cell';\n\texport const vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';\n\texport const vscodeNotebookCellMetadataDiff = 'vscode-notebook-cell-metadata-diff';\n\texport const vscodeNotebookCellOutput = 'vscode-notebook-cell-output';\n\texport const vscodeNotebookCellOutputDiff = 'vscode-notebook-cell-output-diff';\n\texport const vscodeNotebookMetadata = 'vscode-notebook-metadata';\n\texport const vscodeInteractiveInput = 'vscode-interactive-input';\n\n\texport const vscodeSettings = 'vscode-settings';\n\n\texport const vscodeWorkspaceTrust = 'vscode-workspace-trust';\n\n\texport const vscodeTerminal = 'vscode-terminal';\n\n\t/** Scheme used for code blocks in chat. */\n\texport const vscodeChatCodeBlock = 'vscode-chat-code-block';\n\n\t/** Scheme used for LHS of code compare (aka diff) blocks in chat. */\n\texport const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';\n\n\t/** Scheme used for the chat input editor. */\n\texport const vscodeChatEditor = 'vscode-chat-editor';\n\n\t/** Scheme used for the chat input part */\n\texport const vscodeChatInput = 'chatSessionInput';\n\n\t/** Scheme used for local chat session content */\n\texport const vscodeLocalChatSession = 'vscode-chat-session';\n\n\t/**\n\t * Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)\n\t */\n\texport const webviewPanel = 'webview-panel';\n\n\t/**\n\t * Scheme used for loading the wrapper html and script in webviews.\n\t */\n\texport const vscodeWebview = 'vscode-webview';\n\n\t/**\n\t * Scheme used for integrated browser tabs using WebContentsView.\n\t */\n\texport const vscodeBrowser = 'vscode-browser';\n\n\t/**\n\t * Scheme used for extension pages\n\t */\n\texport const extension = 'extension';\n\n\t/**\n\t * Scheme used as a replacement of `file` scheme to load\n\t * files with our custom protocol handler (desktop only).\n\t */\n\texport const vscodeFileResource = 'vscode-file';\n\n\t/**\n\t * Scheme used for temporary resources\n\t */\n\texport const tmp = 'tmp';\n\n\t/**\n\t * Scheme used vs live share\n\t */\n\texport const vsls = 'vsls';\n\n\t/**\n\t * Scheme used for the Source Control commit input's text document\n\t */\n\texport const vscodeSourceControl = 'vscode-scm';\n\n\t/**\n\t * Scheme used for input box for creating comments.\n\t */\n\texport const commentsInput = 'comment';\n\n\t/**\n\t * Scheme used for special rendering of settings in the release notes\n\t */\n\texport const codeSetting = 'code-setting';\n\n\t/**\n\t * Scheme used for output panel resources\n\t */\n\texport const outputChannel = 'output';\n\n\t/**\n\t * Scheme used for the accessible view\n\t */\n\texport const accessibleView = 'accessible-view';\n\n\t/**\n\t * Used for snapshots of chat edits\n\t */\n\texport const chatEditingSnapshotScheme = 'chat-editing-snapshot-text-model';\n\texport const chatEditingModel = 'chat-editing-text-model';\n\n\t/**\n\t * Used for rendering multidiffs in copilot agent sessions\n\t */\n\texport const copilotPr = 'copilot-pr';\n}\n\nexport function matchesScheme(target: URI | string, scheme: string): boolean {\n\tif (URI.isUri(target)) {\n\t\treturn equalsIgnoreCase(target.scheme, scheme);\n\t} else {\n\t\treturn startsWithIgnoreCase(target, scheme + ':');\n\t}\n}\n\nexport function matchesSomeScheme(target: URI | string, ...schemes: string[]): boolean {\n\treturn schemes.some(scheme => matchesScheme(target, scheme));\n}\nexport const connectionTokenQueryName = 'tkn';\n\nclass RemoteAuthoritiesImpl {\n\tprivate readonly _hosts: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate readonly _ports: { [authority: string]: number | undefined } = Object.create(null);\n\tprivate readonly _connectionTokens: { [authority: string]: string | undefined } = Object.create(null);\n\tprivate _preferredWebSchema: 'http' | 'https' = 'http';\n\tprivate _delegate: ((uri: URI) => URI) | null = null;\n\tprivate _serverRootPath: string = '/';\n\n\tsetPreferredWebSchema(schema: 'http' | 'https') {\n\t\tthis._preferredWebSchema = schema;\n\t}\n\n\tprivate get _remoteResourcesPath(): string {\n\t\treturn paths.posix.join(this._serverRootPath, Schemas.vscodeRemoteResource);\n\t}\n\n\trewrite(uri: URI): URI {\n\t\tif (this._delegate) {\n\t\t\ttry {\n\t\t\t\treturn this._delegate(uri);\n\t\t\t} catch (err) {\n\t\t\t\terrors.onUnexpectedError(err);\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t}\n\t\tconst authority = uri.authority;\n\t\tlet host = this._hosts[authority];\n\t\tif (host && host.indexOf(':') !== -1 && host.indexOf('[') === -1) {\n\t\t\thost = `[${host}]`;\n\t\t}\n\t\tconst port = this._ports[authority];\n\t\tconst connectionToken = this._connectionTokens[authority];\n\t\tlet query = `path=${encodeURIComponent(uri.path)}`;\n\t\tif (typeof connectionToken === 'string') {\n\t\t\tquery += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;\n\t\t}\n\t\treturn URI.from({\n\t\t\tscheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,\n\t\t\tauthority: `${host}:${port}`,\n\t\t\tpath: this._remoteResourcesPath,\n\t\t\tquery\n\t\t});\n\t}\n}\n\nexport const RemoteAuthorities = new RemoteAuthoritiesImpl();\n\n/**\n * A string pointing to a path inside the app. It should not begin with ./ or ../\n */\nexport type AppResourcePath = (\n\t`a${string}` | `b${string}` | `c${string}` | `d${string}` | `e${string}` | `f${string}`\n\t| `g${string}` | `h${string}` | `i${string}` | `j${string}` | `k${string}` | `l${string}`\n\t| `m${string}` | `n${string}` | `o${string}` | `p${string}` | `q${string}` | `r${string}`\n\t| `s${string}` | `t${string}` | `u${string}` | `v${string}` | `w${string}` | `x${string}`\n\t| `y${string}` | `z${string}`\n);\n\nexport const VSCODE_AUTHORITY = 'vscode-app';\n\nclass FileAccessImpl {\n\n\tprivate static readonly FALLBACK_AUTHORITY = VSCODE_AUTHORITY;\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\tasBrowserUri(resourcePath: AppResourcePath | ''): URI {\n\t\tconst uri = this.toUri(resourcePath);\n\t\treturn this.uriToBrowserUri(uri);\n\t}\n\n\t/**\n\t * Returns a URI to use in contexts where the browser is responsible\n\t * for loading (e.g. fetch()) or when used within the DOM.\n\t *\n\t * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n\t */\n\turiToBrowserUri(uri: URI): URI {\n\t\t// Handle remote URIs via `RemoteAuthorities`\n\t\tif (uri.scheme === Schemas.vscodeRemote) {\n\t\t\treturn RemoteAuthorities.rewrite(uri);\n\t\t}\n\n\t\t// Convert to `vscode-file` resource..\n\t\tif (\n\t\t\t// ...only ever for `file` resources\n\t\t\turi.scheme === Schemas.file &&\n\t\t\t(\n\t\t\t\t// ...and we run in native environments\n\t\t\t\tplatform.isNative ||\n\t\t\t\t// ...or web worker extensions on desktop\n\t\t\t\t(platform.webWorkerOrigin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)\n\t\t\t)\n\t\t) {\n\t\t\treturn uri.with({\n\t\t\t\tscheme: Schemas.vscodeFileResource,\n\t\t\t\t// We need to provide an authority here so that it can serve\n\t\t\t\t// as origin for network and loading matters in chromium.\n\t\t\t\t// If the URI is not coming with an authority already, we\n\t\t\t\t// add our own\n\t\t\t\tauthority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY,\n\t\t\t\tquery: null,\n\t\t\t\tfragment: null\n\t\t\t});\n\t\t}\n\n\t\treturn uri;\n\t}\n\n\tprivate toUri(uriOrModule: URI | string): URI {\n\t\tif (URI.isUri(uriOrModule)) {\n\t\t\treturn uriOrModule;\n\t\t}\n\n\t\tif (globalThis._VSCODE_FILE_ROOT) {\n\t\t\tconst rootUriOrPath = globalThis._VSCODE_FILE_ROOT;\n\n\t\t\t// File URL (with scheme)\n\t\t\tif (/^\\w[\\w\\d+.-]*:\\/\\//.test(rootUriOrPath)) {\n\t\t\t\treturn URI.joinPath(URI.parse(rootUriOrPath, true), uriOrModule);\n\t\t\t}\n\n\t\t\t// File Path (no scheme)\n\t\t\tconst modulePath = paths.join(rootUriOrPath, uriOrModule);\n\t\t\treturn URI.file(modulePath);\n\t\t}\n\n\t\tthrow new Error('Cannot determine URI for module id!');\n\t}\n}\n\nexport const FileAccess = new FileAccessImpl();\n\nexport const CacheControlheaders: Record<string, string> = Object.freeze({\n\t'Cache-Control': 'no-cache, no-store'\n});\n\nexport const DocumentPolicyheaders: Record<string, string> = Object.freeze({\n\t'Document-Policy': 'include-js-call-stacks-in-crash-reports'\n});\n\nexport namespace COI {\n\n\tconst coiHeaders = new Map<'3' | '2' | '1' | string, Record<string, string>>([\n\t\t['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],\n\t\t['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t\t['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n\t]);\n\n\texport const CoopAndCoep = Object.freeze(coiHeaders.get('3'));\n\n\tconst coiSearchParamName = 'vscode-coi';\n\n\t/**\n\t * Extract desired headers from `vscode-coi` invocation\n\t */\n\texport function getHeadersFromQuery(url: string | URI | URL): Record<string, string> | undefined {\n\t\tlet params: URLSearchParams | undefined;\n\t\tif (typeof url === 'string') {\n\t\t\tparams = new URL(url).searchParams;\n\t\t} else if (url instanceof URL) {\n\t\t\tparams = url.searchParams;\n\t\t} else if (URI.isUri(url)) {\n\t\t\tparams = new URL(url.toString(true)).searchParams;\n\t\t}\n\t\tconst value = params?.get(coiSearchParamName);\n\t\tif (!value) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn coiHeaders.get(value);\n\t}\n\n\t/**\n\t * Add the `vscode-coi` query attribute based on wanting `COOP` and `COEP`. Will be a noop when `crossOriginIsolated`\n\t * isn't enabled the current context\n\t */\n\texport function addSearchParam(urlOrSearch: URLSearchParams | Record<string, string>, coop: boolean, coep: boolean): void {\n\t\tif (!(globalThis as typeof globalThis & { crossOriginIsolated?: boolean }).crossOriginIsolated) {\n\t\t\t// depends on the current context being COI\n\t\t\treturn;\n\t\t}\n\t\tconst value = coop && coep ? '3' : coep ? '2' : '1';\n\t\tif (urlOrSearch instanceof URLSearchParams) {\n\t\t\turlOrSearch.set(coiSearchParamName, value);\n\t\t} else {\n\t\t\turlOrSearch[coiSearchParamName] = value;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -322,11 +322,17 @@ export class Derived extends BaseObservable {
|
|
|
322
322
|
this._value = newValue;
|
|
323
323
|
}
|
|
324
324
|
debugRecompute() {
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
this.beginUpdate(this);
|
|
326
|
+
try {
|
|
327
|
+
if (!this._isComputing) {
|
|
328
|
+
this._recompute();
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
this._state = 2 /* DerivedState.stale */;
|
|
332
|
+
}
|
|
327
333
|
}
|
|
328
|
-
|
|
329
|
-
this.
|
|
334
|
+
finally {
|
|
335
|
+
this.endUpdate(this);
|
|
330
336
|
}
|
|
331
337
|
}
|
|
332
338
|
setValue(newValue, tx, change) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/observables/derivedImpl.ts","vs/base/common/observableInternal/observables/derivedImpl.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAoB,QAAQ,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChI,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA6BlD,SAAS,oBAAoB,CAAC,KAAmB;IAChD,QAAQ,KAAK,EAAE,CAAC;QACf,iCAAyB,CAAC,CAAC,OAAO,SAAS,CAAC;QAC5C,sDAA8C,CAAC,CAAC,OAAO,8BAA8B,CAAC;QACtF,+BAAuB,CAAC,CAAC,OA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QAClC,CAAC;IACF,CAAC;IAEM,QAAQ,CAAC,QAAW,EAAE,EAAgB,EAAE,MAAe;QAC7D,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9B,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;YAC3B,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;CACD;AAGD,MAAM,OAAO,iBAA8D,SAAQ,OAAuC;IACzH,YACC,aAA4B,EAC5B,SAAoF,EACpF,aAAyD,EACzD,4BAAsD,SAAS,EAC/D,kBAAuC,EACvB,GAA0E,EAC1F,aAA4B;QAE5B,KAAK,CACJ,aAAa,EACb,SAAS,EACT,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,CACb,CAAC;QAVc,QAAG,GAAH,GAAG,CAAuE;IAW3F,CAAC;CACD","file":"derivedImpl.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 { IObservable, IObservableWithChange, IObserver, IReaderWithStore, ISettableObservable, ITransaction } from '../base.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BugIndicatingError, DisposableStore, EqualityComparer, assertFn, onBugIndicatingError } from '../commonFacade/deps.js';\nimport { getLogger } from '../logging/logging.js';\nimport { IChangeTracker } from '../changeTracker.js';\nimport { DebugLocation } from '../debugLocation.js';\n\nexport interface IDerivedReader<TChange = void> extends IReaderWithStore {\n}\n\nexport const enum DerivedState {\n\t/** Initial state, no previous value, recomputation needed */\n\tinitial = 0,\n\n\t/**\n\t * A dependency could have changed.\n\t * We need to explicitly ask them if at least one dependency changed.\n\t */\n\tdependenciesMightHaveChanged = 1,\n\n\t/**\n\t * A dependency changed and we need to recompute.\n\t * After recomputation, we need to check the previous value to see if we changed as well.\n\t */\n\tstale = 2,\n\n\t/**\n\t * No change reported, our cached value is up to date.\n\t */\n\tupToDate = 3,\n}\n\nfunction derivedStateToString(state: DerivedState): string {\n\tswitch (state) {\n\t\tcase DerivedState.initial: return 'initial';\n\t\tcase DerivedState.dependenciesMightHaveChanged: return 'dependenciesMightHaveChanged';\n\t\tcase DerivedState.stale: return 'stale';\n\t\tcase DerivedState.upToDate: return 'upToDate';\n\t\tdefault: return '<unknown>';\n\t}\n}\n\nexport class Derived<T, TChangeSummary = any, TChange = void> extends BaseObservable<T, TChange> implements IDerivedReader<TChange>, IObserver {\n\tprivate _state = DerivedState.initial;\n\tprivate _value: T | undefined = undefined;\n\tprivate _updateCount = 0;\n\tprivate _dependencies = new Set<IObservable<any>>();\n\tprivate _dependenciesToBeRemoved = new Set<IObservable<any>>();\n\tprivate _changeSummary: TChangeSummary | undefined = undefined;\n\tprivate _isUpdating = false;\n\tprivate _isComputing = false;\n\tprivate _didReportChange = false;\n\tprivate _isInBeforeUpdate = false;\n\tprivate _isReaderValid = false;\n\tprivate _store: DisposableStore | undefined = undefined;\n\tprivate _delayedStore: DisposableStore | undefined = undefined;\n\tprivate _removedObserverToCallEndUpdateOn: Set<IObserver> | null = null;\n\n\tpublic override get debugName(): string {\n\t\treturn this._debugNameData.getDebugName(this) ?? '(anonymous)';\n\t}\n\n\tconstructor(\n\t\tpublic readonly _debugNameData: DebugNameData,\n\t\tpublic readonly _computeFn: (reader: IDerivedReader<TChange>, changeSummary: TChangeSummary) => T,\n\t\tprivate readonly _changeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\tprivate readonly _handleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(debugLocation);\n\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(undefined);\n\t}\n\n\tprotected override onLastObserverRemoved(): void {\n\t\t/**\n\t\t * We are not tracking changes anymore, thus we have to assume\n\t\t * that our cache is invalid.\n\t\t */\n\t\tthis._state = DerivedState.initial;\n\t\tthis._value = undefined;\n\t\tgetLogger()?.handleDerivedCleared(this);\n\t\tfor (const d of this._dependencies) {\n\t\t\td.removeObserver(this);\n\t\t}\n\t\tthis._dependencies.clear();\n\n\t\tif (this._store !== undefined) {\n\t\t\tthis._store.dispose();\n\t\t\tthis._store = undefined;\n\t\t}\n\t\tif (this._delayedStore !== undefined) {\n\t\t\tthis._delayedStore.dispose();\n\t\t\tthis._delayedStore = undefined;\n\t\t}\n\n\t\tthis._handleLastObserverRemoved?.();\n\t}\n\n\tpublic override get(): T {\n\t\tconst checkEnabled = false; // TODO set to true\n\t\tif (this._isComputing && checkEnabled) {\n\t\t\t// investigate why this fails in the diff editor!\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tif (this._observers.size === 0) {\n\t\t\tlet result;\n\t\t\t// Without observers, we don't know when to clean up stuff.\n\t\t\t// Thus, we don't cache anything to prevent memory leaks.\n\t\t\ttry {\n\t\t\t\tthis._isReaderValid = true;\n\t\t\t\tlet changeSummary = undefined;\n\t\t\t\tif (this._changeTracker) {\n\t\t\t\t\tchangeSummary = this._changeTracker.createChangeSummary(undefined);\n\t\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\t}\n\t\t\t\tresult = this._computeFn(this, changeSummary!);\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t}\n\t\t\t// Clear new dependencies\n\t\t\tthis.onLastObserverRemoved();\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\tdo {\n\t\t\t\t// We might not get a notification for a dependency that changed while it is updating,\n\t\t\t\t// thus we also have to ask all our depedencies if they changed in this case.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tfor (const d of this._dependencies) {\n\t\t\t\t\t\t/** might call {@link handleChange} indirectly, which could make us stale */\n\t\t\t\t\t\td.reportChanges();\n\n\t\t\t\t\t\tif (this._state as DerivedState === DerivedState.stale) {\n\t\t\t\t\t\t\t// The other dependencies will refresh on demand, so early break\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// We called report changes of all dependencies.\n\t\t\t\t// If we are still not stale, we can assume to be up to date again.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tthis._state = DerivedState.upToDate;\n\t\t\t\t}\n\n\t\t\t\tif (this._state !== DerivedState.upToDate) {\n\t\t\t\t\tthis._recompute();\n\t\t\t\t}\n\t\t\t\t// In case recomputation changed one of our dependencies, we need to recompute again.\n\t\t\t} while (this._state !== DerivedState.upToDate);\n\t\t\treturn this._value!;\n\t\t}\n\t}\n\n\tprivate _recompute() {\n\t\tlet didChange = false;\n\t\tthis._isComputing = true;\n\t\tthis._didReportChange = false;\n\n\t\tconst emptySet = this._dependenciesToBeRemoved;\n\t\tthis._dependenciesToBeRemoved = this._dependencies;\n\t\tthis._dependencies = emptySet;\n\n\t\ttry {\n\t\t\tconst changeSummary = this._changeSummary!;\n\n\t\t\tthis._isReaderValid = true;\n\t\t\tif (this._changeTracker) {\n\t\t\t\tthis._isInBeforeUpdate = true;\n\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\tthis._isInBeforeUpdate = false;\n\t\t\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(changeSummary);\n\t\t\t}\n\n\t\t\tconst hadValue = this._state !== DerivedState.initial;\n\t\t\tconst oldValue = this._value;\n\t\t\tthis._state = DerivedState.upToDate;\n\n\t\t\tconst delayedStore = this._delayedStore;\n\t\t\tif (delayedStore !== undefined) {\n\t\t\t\tthis._delayedStore = undefined;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (this._store !== undefined) {\n\t\t\t\t\tthis._store.dispose();\n\t\t\t\t\tthis._store = undefined;\n\t\t\t\t}\n\t\t\t\t/** might call {@link handleChange} indirectly, which could invalidate us */\n\t\t\t\tthis._value = this._computeFn(this, changeSummary);\n\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t\t// We don't want our observed observables to think that they are (not even temporarily) not being observed.\n\t\t\t\t// Thus, we only unsubscribe from observables that are definitely not read anymore.\n\t\t\t\tfor (const o of this._dependenciesToBeRemoved) {\n\t\t\t\t\to.removeObserver(this);\n\t\t\t\t}\n\t\t\t\tthis._dependenciesToBeRemoved.clear();\n\n\t\t\t\tif (delayedStore !== undefined) {\n\t\t\t\t\tdelayedStore.dispose();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdidChange = this._didReportChange || (hadValue && !(this._equalityComparator(oldValue!, this._value)));\n\n\t\t\tgetLogger()?.handleObservableUpdated(this, {\n\t\t\t\toldValue,\n\t\t\t\tnewValue: this._value,\n\t\t\t\tchange: undefined,\n\t\t\t\tdidChange,\n\t\t\t\thadValue,\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tonBugIndicatingError(e);\n\t\t}\n\n\t\tthis._isComputing = false;\n\n\t\tif (!this._didReportChange && didChange) {\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handleChange(this, undefined);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._didReportChange = false;\n\t\t}\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `LazyDerived<${this.debugName}>`;\n\t}\n\n\t// IObserver Implementation\n\n\tpublic beginUpdate<T>(_observable: IObservable<T>): void {\n\t\tif (this._isUpdating) {\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tthis._updateCount++;\n\t\tthis._isUpdating = true;\n\t\ttry {\n\t\t\tconst propagateBeginUpdate = this._updateCount === 1;\n\t\t\tif (this._state === DerivedState.upToDate) {\n\t\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\t\t// If we propagate begin update, that will already signal a possible change.\n\t\t\t\tif (!propagateBeginUpdate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (propagateBeginUpdate) {\n\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\tr.beginUpdate(this); // This signals a possible change\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._isUpdating = false;\n\t\t}\n\t}\n\n\tpublic endUpdate<T>(_observable: IObservable<T>): void {\n\t\tthis._updateCount--;\n\t\tif (this._updateCount === 0) {\n\t\t\t// End update could change the observer list.\n\t\t\tconst observers = [...this._observers];\n\t\t\tfor (const r of observers) {\n\t\t\t\tr.endUpdate(this);\n\t\t\t}\n\t\t\tif (this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tconst observers = [...this._removedObserverToCallEndUpdateOn];\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = null;\n\t\t\t\tfor (const r of observers) {\n\t\t\t\t\tr.endUpdate(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassertFn(() => this._updateCount >= 0);\n\t}\n\n\tpublic handlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// In all other states, observers already know that we might have changed.\n\t\tif (this._state === DerivedState.upToDate && this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable)) {\n\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handlePossibleChange(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\tif (this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable) || this._isInBeforeUpdate) {\n\t\t\tgetLogger()?.handleDerivedDependencyChanged(this, observable, change);\n\n\t\t\tlet shouldReact = false;\n\t\t\ttry {\n\t\t\t\tshouldReact = this._changeTracker ? this._changeTracker.handleChange({\n\t\t\t\t\tchangedObservable: observable,\n\t\t\t\t\tchange,\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\tdidChange: (o): this is any => o === observable as any,\n\t\t\t\t}, this._changeSummary!) : true;\n\t\t\t} catch (e) {\n\t\t\t\tonBugIndicatingError(e);\n\t\t\t}\n\n\t\t\tconst wasUpToDate = this._state === DerivedState.upToDate;\n\t\t\tif (shouldReact && (this._state === DerivedState.dependenciesMightHaveChanged || wasUpToDate)) {\n\t\t\t\tthis._state = DerivedState.stale;\n\t\t\t\tif (wasUpToDate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// IReader Implementation\n\n\tprivate _ensureReaderValid(): void {\n\t\tif (!this._isReaderValid) { throw new BugIndicatingError('The reader object cannot be used outside its compute function!'); }\n\t}\n\n\tpublic readObservable<T>(observable: IObservable<T>): T {\n\t\tthis._ensureReaderValid();\n\n\t\t// Subscribe before getting the value to enable caching\n\t\tobservable.addObserver(this);\n\t\t/** This might call {@link handleChange} indirectly, which could invalidate us */\n\t\tconst value = observable.get();\n\t\t// Which is why we only add the observable to the dependencies now.\n\t\tthis._dependencies.add(observable);\n\t\tthis._dependenciesToBeRemoved.delete(observable);\n\t\treturn value;\n\t}\n\n\tget store(): DisposableStore {\n\t\tthis._ensureReaderValid();\n\n\t\tif (this._store === undefined) {\n\t\t\tthis._store = new DisposableStore();\n\t\t}\n\t\treturn this._store;\n\t}\n\n\tpublic override addObserver(observer: IObserver): void {\n\t\tconst shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCount > 0;\n\t\tsuper.addObserver(observer);\n\n\t\tif (shouldCallBeginUpdate) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn?.delete(observer)) {\n\t\t\t\tobserver.beginUpdate(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override removeObserver(observer: IObserver): void {\n\t\tif (this._observers.has(observer) && this._updateCount > 0) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = new Set();\n\t\t\t}\n\t\t\tthis._removedObserverToCallEndUpdateOn.add(observer);\n\t\t}\n\t\tsuper.removeObserver(observer);\n\t}\n\n\tpublic debugGetState() {\n\t\treturn {\n\t\t\tstate: this._state,\n\t\t\tstateStr: derivedStateToString(this._state),\n\t\t\tupdateCount: this._updateCount,\n\t\t\tisComputing: this._isComputing,\n\t\t\tdependencies: this._dependencies,\n\t\t\tvalue: this._value,\n\t\t};\n\t}\n\n\tpublic debugSetValue(newValue: unknown) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = newValue as any;\n\t}\n\n\tpublic debugRecompute(): void {\n\t\tif (!this._isComputing) {\n\t\t\tthis._recompute();\n\t\t} else {\n\t\t\tthis._state = DerivedState.stale;\n\t\t}\n\t}\n\n\tpublic setValue(newValue: T, tx: ITransaction, change: TChange): void {\n\t\tthis._value = newValue;\n\t\tconst observers = this._observers;\n\t\ttx.updateObserver(this, this);\n\t\tfor (const d of observers) {\n\t\t\td.handleChange(this, change);\n\t\t}\n\t}\n}\n\n\nexport class DerivedWithSetter<T, TChangeSummary = any, TOutChanges = any> extends Derived<T, TChangeSummary, TOutChanges> implements ISettableObservable<T, TOutChanges> {\n\tconstructor(\n\t\tdebugNameData: DebugNameData,\n\t\tcomputeFn: (reader: IDerivedReader<TOutChanges>, changeSummary: TChangeSummary) => T,\n\t\tchangeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\thandleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tequalityComparator: EqualityComparer<T>,\n\t\tpublic readonly set: (value: T, tx: ITransaction | undefined, change: TOutChanges) => void,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(\n\t\t\tdebugNameData,\n\t\t\tcomputeFn,\n\t\t\tchangeTracker,\n\t\t\thandleLastObserverRemoved,\n\t\t\tequalityComparator,\n\t\t\tdebugLocation,\n\t\t);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IObservable, IObservableWithChange, IObserver, IReaderWithStore, ISettableObservable, ITransaction } from '../base.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BugIndicatingError, DisposableStore, EqualityComparer, assertFn, onBugIndicatingError } from '../commonFacade/deps.js';\nimport { getLogger } from '../logging/logging.js';\nimport { IChangeTracker } from '../changeTracker.js';\nimport { DebugLocation } from '../debugLocation.js';\n\nexport interface IDerivedReader<TChange = void> extends IReaderWithStore {\n}\n\nexport const enum DerivedState {\n\t/** Initial state, no previous value, recomputation needed */\n\tinitial = 0,\n\n\t/**\n\t * A dependency could have changed.\n\t * We need to explicitly ask them if at least one dependency changed.\n\t */\n\tdependenciesMightHaveChanged = 1,\n\n\t/**\n\t * A dependency changed and we need to recompute.\n\t * After recomputation, we need to check the previous value to see if we changed as well.\n\t */\n\tstale = 2,\n\n\t/**\n\t * No change reported, our cached value is up to date.\n\t */\n\tupToDate = 3,\n}\n\nfunction derivedStateToString(state: DerivedState): string {\n\tswitch (state) {\n\t\tcase DerivedState.initial: return 'initial';\n\t\tcase DerivedState.dependenciesMightHaveChanged: return 'dependenciesMightHaveChanged';\n\t\tcase DerivedState.stale: return 'stale';\n\t\tcase DerivedState.upToDate: return 'upToDate';\n\t\tdefault: return '<unknown>';\n\t}\n}\n\nexport class Derived<T, TChangeSummary = any, TChange = void> extends BaseObservable<T, TChange> implements IDerivedReader<TChange>, IObserver {\n\tprivate _state = DerivedState.initial;\n\tprivate _value: T | undefined = undefined;\n\tprivate _updateCount = 0;\n\tprivate _dependencies = new Set<IObservable<any>>();\n\tprivate _dependenciesToBeRemoved = new Set<IObservable<any>>();\n\tprivate _changeSummary: TChangeSummary | undefined = undefined;\n\tprivate _isUpdating = false;\n\tprivate _isComputing = false;\n\tprivate _didReportChange = false;\n\tprivate _isInBeforeUpdate = false;\n\tprivate _isReaderValid = false;\n\tprivate _store: DisposableStore | undefined = undefined;\n\tprivate _delayedStore: DisposableStore | undefined = undefined;\n\tprivate _removedObserverToCallEndUpdateOn: Set<IObserver> | null = null;\n\n\tpublic override get debugName(): string {\n\t\treturn this._debugNameData.getDebugName(this) ?? '(anonymous)';\n\t}\n\n\tconstructor(\n\t\tpublic readonly _debugNameData: DebugNameData,\n\t\tpublic readonly _computeFn: (reader: IDerivedReader<TChange>, changeSummary: TChangeSummary) => T,\n\t\tprivate readonly _changeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\tprivate readonly _handleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(debugLocation);\n\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(undefined);\n\t}\n\n\tprotected override onLastObserverRemoved(): void {\n\t\t/**\n\t\t * We are not tracking changes anymore, thus we have to assume\n\t\t * that our cache is invalid.\n\t\t */\n\t\tthis._state = DerivedState.initial;\n\t\tthis._value = undefined;\n\t\tgetLogger()?.handleDerivedCleared(this);\n\t\tfor (const d of this._dependencies) {\n\t\t\td.removeObserver(this);\n\t\t}\n\t\tthis._dependencies.clear();\n\n\t\tif (this._store !== undefined) {\n\t\t\tthis._store.dispose();\n\t\t\tthis._store = undefined;\n\t\t}\n\t\tif (this._delayedStore !== undefined) {\n\t\t\tthis._delayedStore.dispose();\n\t\t\tthis._delayedStore = undefined;\n\t\t}\n\n\t\tthis._handleLastObserverRemoved?.();\n\t}\n\n\tpublic override get(): T {\n\t\tconst checkEnabled = false; // TODO set to true\n\t\tif (this._isComputing && checkEnabled) {\n\t\t\t// investigate why this fails in the diff editor!\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tif (this._observers.size === 0) {\n\t\t\tlet result;\n\t\t\t// Without observers, we don't know when to clean up stuff.\n\t\t\t// Thus, we don't cache anything to prevent memory leaks.\n\t\t\ttry {\n\t\t\t\tthis._isReaderValid = true;\n\t\t\t\tlet changeSummary = undefined;\n\t\t\t\tif (this._changeTracker) {\n\t\t\t\t\tchangeSummary = this._changeTracker.createChangeSummary(undefined);\n\t\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\t}\n\t\t\t\tresult = this._computeFn(this, changeSummary!);\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t}\n\t\t\t// Clear new dependencies\n\t\t\tthis.onLastObserverRemoved();\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\tdo {\n\t\t\t\t// We might not get a notification for a dependency that changed while it is updating,\n\t\t\t\t// thus we also have to ask all our depedencies if they changed in this case.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tfor (const d of this._dependencies) {\n\t\t\t\t\t\t/** might call {@link handleChange} indirectly, which could make us stale */\n\t\t\t\t\t\td.reportChanges();\n\n\t\t\t\t\t\tif (this._state as DerivedState === DerivedState.stale) {\n\t\t\t\t\t\t\t// The other dependencies will refresh on demand, so early break\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// We called report changes of all dependencies.\n\t\t\t\t// If we are still not stale, we can assume to be up to date again.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tthis._state = DerivedState.upToDate;\n\t\t\t\t}\n\n\t\t\t\tif (this._state !== DerivedState.upToDate) {\n\t\t\t\t\tthis._recompute();\n\t\t\t\t}\n\t\t\t\t// In case recomputation changed one of our dependencies, we need to recompute again.\n\t\t\t} while (this._state !== DerivedState.upToDate);\n\t\t\treturn this._value!;\n\t\t}\n\t}\n\n\tprivate _recompute() {\n\t\tlet didChange = false;\n\t\tthis._isComputing = true;\n\t\tthis._didReportChange = false;\n\n\t\tconst emptySet = this._dependenciesToBeRemoved;\n\t\tthis._dependenciesToBeRemoved = this._dependencies;\n\t\tthis._dependencies = emptySet;\n\n\t\ttry {\n\t\t\tconst changeSummary = this._changeSummary!;\n\n\t\t\tthis._isReaderValid = true;\n\t\t\tif (this._changeTracker) {\n\t\t\t\tthis._isInBeforeUpdate = true;\n\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\tthis._isInBeforeUpdate = false;\n\t\t\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(changeSummary);\n\t\t\t}\n\n\t\t\tconst hadValue = this._state !== DerivedState.initial;\n\t\t\tconst oldValue = this._value;\n\t\t\tthis._state = DerivedState.upToDate;\n\n\t\t\tconst delayedStore = this._delayedStore;\n\t\t\tif (delayedStore !== undefined) {\n\t\t\t\tthis._delayedStore = undefined;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (this._store !== undefined) {\n\t\t\t\t\tthis._store.dispose();\n\t\t\t\t\tthis._store = undefined;\n\t\t\t\t}\n\t\t\t\t/** might call {@link handleChange} indirectly, which could invalidate us */\n\t\t\t\tthis._value = this._computeFn(this, changeSummary);\n\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t\t// We don't want our observed observables to think that they are (not even temporarily) not being observed.\n\t\t\t\t// Thus, we only unsubscribe from observables that are definitely not read anymore.\n\t\t\t\tfor (const o of this._dependenciesToBeRemoved) {\n\t\t\t\t\to.removeObserver(this);\n\t\t\t\t}\n\t\t\t\tthis._dependenciesToBeRemoved.clear();\n\n\t\t\t\tif (delayedStore !== undefined) {\n\t\t\t\t\tdelayedStore.dispose();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdidChange = this._didReportChange || (hadValue && !(this._equalityComparator(oldValue!, this._value)));\n\n\t\t\tgetLogger()?.handleObservableUpdated(this, {\n\t\t\t\toldValue,\n\t\t\t\tnewValue: this._value,\n\t\t\t\tchange: undefined,\n\t\t\t\tdidChange,\n\t\t\t\thadValue,\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tonBugIndicatingError(e);\n\t\t}\n\n\t\tthis._isComputing = false;\n\n\t\tif (!this._didReportChange && didChange) {\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handleChange(this, undefined);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._didReportChange = false;\n\t\t}\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `LazyDerived<${this.debugName}>`;\n\t}\n\n\t// IObserver Implementation\n\n\tpublic beginUpdate<T>(_observable: IObservable<T>): void {\n\t\tif (this._isUpdating) {\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tthis._updateCount++;\n\t\tthis._isUpdating = true;\n\t\ttry {\n\t\t\tconst propagateBeginUpdate = this._updateCount === 1;\n\t\t\tif (this._state === DerivedState.upToDate) {\n\t\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\t\t// If we propagate begin update, that will already signal a possible change.\n\t\t\t\tif (!propagateBeginUpdate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (propagateBeginUpdate) {\n\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\tr.beginUpdate(this); // This signals a possible change\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._isUpdating = false;\n\t\t}\n\t}\n\n\tpublic endUpdate<T>(_observable: IObservable<T>): void {\n\t\tthis._updateCount--;\n\t\tif (this._updateCount === 0) {\n\t\t\t// End update could change the observer list.\n\t\t\tconst observers = [...this._observers];\n\t\t\tfor (const r of observers) {\n\t\t\t\tr.endUpdate(this);\n\t\t\t}\n\t\t\tif (this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tconst observers = [...this._removedObserverToCallEndUpdateOn];\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = null;\n\t\t\t\tfor (const r of observers) {\n\t\t\t\t\tr.endUpdate(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassertFn(() => this._updateCount >= 0);\n\t}\n\n\tpublic handlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// In all other states, observers already know that we might have changed.\n\t\tif (this._state === DerivedState.upToDate && this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable)) {\n\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handlePossibleChange(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\tif (this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable) || this._isInBeforeUpdate) {\n\t\t\tgetLogger()?.handleDerivedDependencyChanged(this, observable, change);\n\n\t\t\tlet shouldReact = false;\n\t\t\ttry {\n\t\t\t\tshouldReact = this._changeTracker ? this._changeTracker.handleChange({\n\t\t\t\t\tchangedObservable: observable,\n\t\t\t\t\tchange,\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\tdidChange: (o): this is any => o === observable as any,\n\t\t\t\t}, this._changeSummary!) : true;\n\t\t\t} catch (e) {\n\t\t\t\tonBugIndicatingError(e);\n\t\t\t}\n\n\t\t\tconst wasUpToDate = this._state === DerivedState.upToDate;\n\t\t\tif (shouldReact && (this._state === DerivedState.dependenciesMightHaveChanged || wasUpToDate)) {\n\t\t\t\tthis._state = DerivedState.stale;\n\t\t\t\tif (wasUpToDate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// IReader Implementation\n\n\tprivate _ensureReaderValid(): void {\n\t\tif (!this._isReaderValid) { throw new BugIndicatingError('The reader object cannot be used outside its compute function!'); }\n\t}\n\n\tpublic readObservable<T>(observable: IObservable<T>): T {\n\t\tthis._ensureReaderValid();\n\n\t\t// Subscribe before getting the value to enable caching\n\t\tobservable.addObserver(this);\n\t\t/** This might call {@link handleChange} indirectly, which could invalidate us */\n\t\tconst value = observable.get();\n\t\t// Which is why we only add the observable to the dependencies now.\n\t\tthis._dependencies.add(observable);\n\t\tthis._dependenciesToBeRemoved.delete(observable);\n\t\treturn value;\n\t}\n\n\tget store(): DisposableStore {\n\t\tthis._ensureReaderValid();\n\n\t\tif (this._store === undefined) {\n\t\t\tthis._store = new DisposableStore();\n\t\t}\n\t\treturn this._store;\n\t}\n\n\tpublic override addObserver(observer: IObserver): void {\n\t\tconst shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCount > 0;\n\t\tsuper.addObserver(observer);\n\n\t\tif (shouldCallBeginUpdate) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn?.delete(observer)) {\n\t\t\t\tobserver.beginUpdate(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override removeObserver(observer: IObserver): void {\n\t\tif (this._observers.has(observer) && this._updateCount > 0) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = new Set();\n\t\t\t}\n\t\t\tthis._removedObserverToCallEndUpdateOn.add(observer);\n\t\t}\n\t\tsuper.removeObserver(observer);\n\t}\n\n\tpublic debugGetState() {\n\t\treturn {\n\t\t\tstate: this._state,\n\t\t\tstateStr: derivedStateToString(this._state),\n\t\t\tupdateCount: this._updateCount,\n\t\t\tisComputing: this._isComputing,\n\t\t\tdependencies: this._dependencies,\n\t\t\tvalue: this._value,\n\t\t};\n\t}\n\n\tpublic debugSetValue(newValue: unknown) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = newValue as any;\n\t}\n\n\tpublic debugRecompute(): void {\n\t\tif (!this._isComputing) {\n\t\t\tthis._recompute();\n\t\t} else {\n\t\t\tthis._state = DerivedState.stale;\n\t\t}\n\t}\n\n\tpublic setValue(newValue: T, tx: ITransaction, change: TChange): void {\n\t\tthis._value = newValue;\n\t\tconst observers = this._observers;\n\t\ttx.updateObserver(this, this);\n\t\tfor (const d of observers) {\n\t\t\td.handleChange(this, change);\n\t\t}\n\t}\n}\n\n\nexport class DerivedWithSetter<T, TChangeSummary = any, TOutChanges = any> extends Derived<T, TChangeSummary, TOutChanges> implements ISettableObservable<T, TOutChanges> {\n\tconstructor(\n\t\tdebugNameData: DebugNameData,\n\t\tcomputeFn: (reader: IDerivedReader<TOutChanges>, changeSummary: TChangeSummary) => T,\n\t\tchangeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\thandleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tequalityComparator: EqualityComparer<T>,\n\t\tpublic readonly set: (value: T, tx: ITransaction | undefined, change: TOutChanges) => void,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(\n\t\t\tdebugNameData,\n\t\t\tcomputeFn,\n\t\t\tchangeTracker,\n\t\t\thandleLastObserverRemoved,\n\t\t\tequalityComparator,\n\t\t\tdebugLocation,\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/observables/derivedImpl.ts","vs/base/common/observableInternal/observables/derivedImpl.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAoB,QAAQ,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChI,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA6BlD,SAAS,oBAAoB,CAAC,KAAmB;IAChD,QAAQ,KAAK,EAAE,CAA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,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,MAAM,6BAAqB,CAAC;YAClC,CAAC;QACF,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACF,CAAC;IAEM,QAAQ,CAAC,QAAW,EAAE,EAAgB,EAAE,MAAe;QAC7D,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9B,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;YAC3B,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;CACD;AAGD,MAAM,OAAO,iBAA8D,SAAQ,OAAuC;IACzH,YACC,aAA4B,EAC5B,SAAoF,EACpF,aAAyD,EACzD,4BAAsD,SAAS,EAC/D,kBAAuC,EACvB,GAA0E,EAC1F,aAA4B;QAE5B,KAAK,CACJ,aAAa,EACb,SAAS,EACT,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,CACb,CAAC;QAVc,QAAG,GAAH,GAAG,CAAuE;IAW3F,CAAC;CACD","file":"derivedImpl.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 { IObservable, IObservableWithChange, IObserver, IReaderWithStore, ISettableObservable, ITransaction } from '../base.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BugIndicatingError, DisposableStore, EqualityComparer, assertFn, onBugIndicatingError } from '../commonFacade/deps.js';\nimport { getLogger } from '../logging/logging.js';\nimport { IChangeTracker } from '../changeTracker.js';\nimport { DebugLocation } from '../debugLocation.js';\n\nexport interface IDerivedReader<TChange = void> extends IReaderWithStore {\n}\n\nexport const enum DerivedState {\n\t/** Initial state, no previous value, recomputation needed */\n\tinitial = 0,\n\n\t/**\n\t * A dependency could have changed.\n\t * We need to explicitly ask them if at least one dependency changed.\n\t */\n\tdependenciesMightHaveChanged = 1,\n\n\t/**\n\t * A dependency changed and we need to recompute.\n\t * After recomputation, we need to check the previous value to see if we changed as well.\n\t */\n\tstale = 2,\n\n\t/**\n\t * No change reported, our cached value is up to date.\n\t */\n\tupToDate = 3,\n}\n\nfunction derivedStateToString(state: DerivedState): string {\n\tswitch (state) {\n\t\tcase DerivedState.initial: return 'initial';\n\t\tcase DerivedState.dependenciesMightHaveChanged: return 'dependenciesMightHaveChanged';\n\t\tcase DerivedState.stale: return 'stale';\n\t\tcase DerivedState.upToDate: return 'upToDate';\n\t\tdefault: return '<unknown>';\n\t}\n}\n\nexport class Derived<T, TChangeSummary = any, TChange = void> extends BaseObservable<T, TChange> implements IDerivedReader<TChange>, IObserver {\n\tprivate _state = DerivedState.initial;\n\tprivate _value: T | undefined = undefined;\n\tprivate _updateCount = 0;\n\tprivate _dependencies = new Set<IObservable<any>>();\n\tprivate _dependenciesToBeRemoved = new Set<IObservable<any>>();\n\tprivate _changeSummary: TChangeSummary | undefined = undefined;\n\tprivate _isUpdating = false;\n\tprivate _isComputing = false;\n\tprivate _didReportChange = false;\n\tprivate _isInBeforeUpdate = false;\n\tprivate _isReaderValid = false;\n\tprivate _store: DisposableStore | undefined = undefined;\n\tprivate _delayedStore: DisposableStore | undefined = undefined;\n\tprivate _removedObserverToCallEndUpdateOn: Set<IObserver> | null = null;\n\n\tpublic override get debugName(): string {\n\t\treturn this._debugNameData.getDebugName(this) ?? '(anonymous)';\n\t}\n\n\tconstructor(\n\t\tpublic readonly _debugNameData: DebugNameData,\n\t\tpublic readonly _computeFn: (reader: IDerivedReader<TChange>, changeSummary: TChangeSummary) => T,\n\t\tprivate readonly _changeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\tprivate readonly _handleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(debugLocation);\n\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(undefined);\n\t}\n\n\tprotected override onLastObserverRemoved(): void {\n\t\t/**\n\t\t * We are not tracking changes anymore, thus we have to assume\n\t\t * that our cache is invalid.\n\t\t */\n\t\tthis._state = DerivedState.initial;\n\t\tthis._value = undefined;\n\t\tgetLogger()?.handleDerivedCleared(this);\n\t\tfor (const d of this._dependencies) {\n\t\t\td.removeObserver(this);\n\t\t}\n\t\tthis._dependencies.clear();\n\n\t\tif (this._store !== undefined) {\n\t\t\tthis._store.dispose();\n\t\t\tthis._store = undefined;\n\t\t}\n\t\tif (this._delayedStore !== undefined) {\n\t\t\tthis._delayedStore.dispose();\n\t\t\tthis._delayedStore = undefined;\n\t\t}\n\n\t\tthis._handleLastObserverRemoved?.();\n\t}\n\n\tpublic override get(): T {\n\t\tconst checkEnabled = false; // TODO set to true\n\t\tif (this._isComputing && checkEnabled) {\n\t\t\t// investigate why this fails in the diff editor!\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tif (this._observers.size === 0) {\n\t\t\tlet result;\n\t\t\t// Without observers, we don't know when to clean up stuff.\n\t\t\t// Thus, we don't cache anything to prevent memory leaks.\n\t\t\ttry {\n\t\t\t\tthis._isReaderValid = true;\n\t\t\t\tlet changeSummary = undefined;\n\t\t\t\tif (this._changeTracker) {\n\t\t\t\t\tchangeSummary = this._changeTracker.createChangeSummary(undefined);\n\t\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\t}\n\t\t\t\tresult = this._computeFn(this, changeSummary!);\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t}\n\t\t\t// Clear new dependencies\n\t\t\tthis.onLastObserverRemoved();\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\tdo {\n\t\t\t\t// We might not get a notification for a dependency that changed while it is updating,\n\t\t\t\t// thus we also have to ask all our depedencies if they changed in this case.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tfor (const d of this._dependencies) {\n\t\t\t\t\t\t/** might call {@link handleChange} indirectly, which could make us stale */\n\t\t\t\t\t\td.reportChanges();\n\n\t\t\t\t\t\tif (this._state as DerivedState === DerivedState.stale) {\n\t\t\t\t\t\t\t// The other dependencies will refresh on demand, so early break\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// We called report changes of all dependencies.\n\t\t\t\t// If we are still not stale, we can assume to be up to date again.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tthis._state = DerivedState.upToDate;\n\t\t\t\t}\n\n\t\t\t\tif (this._state !== DerivedState.upToDate) {\n\t\t\t\t\tthis._recompute();\n\t\t\t\t}\n\t\t\t\t// In case recomputation changed one of our dependencies, we need to recompute again.\n\t\t\t} while (this._state !== DerivedState.upToDate);\n\t\t\treturn this._value!;\n\t\t}\n\t}\n\n\tprivate _recompute() {\n\t\tlet didChange = false;\n\t\tthis._isComputing = true;\n\t\tthis._didReportChange = false;\n\n\t\tconst emptySet = this._dependenciesToBeRemoved;\n\t\tthis._dependenciesToBeRemoved = this._dependencies;\n\t\tthis._dependencies = emptySet;\n\n\t\ttry {\n\t\t\tconst changeSummary = this._changeSummary!;\n\n\t\t\tthis._isReaderValid = true;\n\t\t\tif (this._changeTracker) {\n\t\t\t\tthis._isInBeforeUpdate = true;\n\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\tthis._isInBeforeUpdate = false;\n\t\t\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(changeSummary);\n\t\t\t}\n\n\t\t\tconst hadValue = this._state !== DerivedState.initial;\n\t\t\tconst oldValue = this._value;\n\t\t\tthis._state = DerivedState.upToDate;\n\n\t\t\tconst delayedStore = this._delayedStore;\n\t\t\tif (delayedStore !== undefined) {\n\t\t\t\tthis._delayedStore = undefined;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (this._store !== undefined) {\n\t\t\t\t\tthis._store.dispose();\n\t\t\t\t\tthis._store = undefined;\n\t\t\t\t}\n\t\t\t\t/** might call {@link handleChange} indirectly, which could invalidate us */\n\t\t\t\tthis._value = this._computeFn(this, changeSummary);\n\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t\t// We don't want our observed observables to think that they are (not even temporarily) not being observed.\n\t\t\t\t// Thus, we only unsubscribe from observables that are definitely not read anymore.\n\t\t\t\tfor (const o of this._dependenciesToBeRemoved) {\n\t\t\t\t\to.removeObserver(this);\n\t\t\t\t}\n\t\t\t\tthis._dependenciesToBeRemoved.clear();\n\n\t\t\t\tif (delayedStore !== undefined) {\n\t\t\t\t\tdelayedStore.dispose();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdidChange = this._didReportChange || (hadValue && !(this._equalityComparator(oldValue!, this._value)));\n\n\t\t\tgetLogger()?.handleObservableUpdated(this, {\n\t\t\t\toldValue,\n\t\t\t\tnewValue: this._value,\n\t\t\t\tchange: undefined,\n\t\t\t\tdidChange,\n\t\t\t\thadValue,\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tonBugIndicatingError(e);\n\t\t}\n\n\t\tthis._isComputing = false;\n\n\t\tif (!this._didReportChange && didChange) {\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handleChange(this, undefined);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._didReportChange = false;\n\t\t}\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `LazyDerived<${this.debugName}>`;\n\t}\n\n\t// IObserver Implementation\n\n\tpublic beginUpdate<T>(_observable: IObservable<T>): void {\n\t\tif (this._isUpdating) {\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tthis._updateCount++;\n\t\tthis._isUpdating = true;\n\t\ttry {\n\t\t\tconst propagateBeginUpdate = this._updateCount === 1;\n\t\t\tif (this._state === DerivedState.upToDate) {\n\t\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\t\t// If we propagate begin update, that will already signal a possible change.\n\t\t\t\tif (!propagateBeginUpdate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (propagateBeginUpdate) {\n\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\tr.beginUpdate(this); // This signals a possible change\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._isUpdating = false;\n\t\t}\n\t}\n\n\tpublic endUpdate<T>(_observable: IObservable<T>): void {\n\t\tthis._updateCount--;\n\t\tif (this._updateCount === 0) {\n\t\t\t// End update could change the observer list.\n\t\t\tconst observers = [...this._observers];\n\t\t\tfor (const r of observers) {\n\t\t\t\tr.endUpdate(this);\n\t\t\t}\n\t\t\tif (this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tconst observers = [...this._removedObserverToCallEndUpdateOn];\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = null;\n\t\t\t\tfor (const r of observers) {\n\t\t\t\t\tr.endUpdate(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassertFn(() => this._updateCount >= 0);\n\t}\n\n\tpublic handlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// In all other states, observers already know that we might have changed.\n\t\tif (this._state === DerivedState.upToDate && this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable)) {\n\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handlePossibleChange(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\tif (this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable) || this._isInBeforeUpdate) {\n\t\t\tgetLogger()?.handleDerivedDependencyChanged(this, observable, change);\n\n\t\t\tlet shouldReact = false;\n\t\t\ttry {\n\t\t\t\tshouldReact = this._changeTracker ? this._changeTracker.handleChange({\n\t\t\t\t\tchangedObservable: observable,\n\t\t\t\t\tchange,\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\tdidChange: (o): this is any => o === observable as any,\n\t\t\t\t}, this._changeSummary!) : true;\n\t\t\t} catch (e) {\n\t\t\t\tonBugIndicatingError(e);\n\t\t\t}\n\n\t\t\tconst wasUpToDate = this._state === DerivedState.upToDate;\n\t\t\tif (shouldReact && (this._state === DerivedState.dependenciesMightHaveChanged || wasUpToDate)) {\n\t\t\t\tthis._state = DerivedState.stale;\n\t\t\t\tif (wasUpToDate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// IReader Implementation\n\n\tprivate _ensureReaderValid(): void {\n\t\tif (!this._isReaderValid) { throw new BugIndicatingError('The reader object cannot be used outside its compute function!'); }\n\t}\n\n\tpublic readObservable<T>(observable: IObservable<T>): T {\n\t\tthis._ensureReaderValid();\n\n\t\t// Subscribe before getting the value to enable caching\n\t\tobservable.addObserver(this);\n\t\t/** This might call {@link handleChange} indirectly, which could invalidate us */\n\t\tconst value = observable.get();\n\t\t// Which is why we only add the observable to the dependencies now.\n\t\tthis._dependencies.add(observable);\n\t\tthis._dependenciesToBeRemoved.delete(observable);\n\t\treturn value;\n\t}\n\n\tget store(): DisposableStore {\n\t\tthis._ensureReaderValid();\n\n\t\tif (this._store === undefined) {\n\t\t\tthis._store = new DisposableStore();\n\t\t}\n\t\treturn this._store;\n\t}\n\n\tpublic override addObserver(observer: IObserver): void {\n\t\tconst shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCount > 0;\n\t\tsuper.addObserver(observer);\n\n\t\tif (shouldCallBeginUpdate) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn?.delete(observer)) {\n\t\t\t\tobserver.beginUpdate(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override removeObserver(observer: IObserver): void {\n\t\tif (this._observers.has(observer) && this._updateCount > 0) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = new Set();\n\t\t\t}\n\t\t\tthis._removedObserverToCallEndUpdateOn.add(observer);\n\t\t}\n\t\tsuper.removeObserver(observer);\n\t}\n\n\tpublic debugGetState() {\n\t\treturn {\n\t\t\tstate: this._state,\n\t\t\tstateStr: derivedStateToString(this._state),\n\t\t\tupdateCount: this._updateCount,\n\t\t\tisComputing: this._isComputing,\n\t\t\tdependencies: this._dependencies,\n\t\t\tvalue: this._value,\n\t\t};\n\t}\n\n\tpublic debugSetValue(newValue: unknown) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = newValue as any;\n\t}\n\n\tpublic debugRecompute(): void {\n\t\tthis.beginUpdate(this);\n\t\ttry {\n\t\t\tif (!this._isComputing) {\n\t\t\t\tthis._recompute();\n\t\t\t} else {\n\t\t\t\tthis._state = DerivedState.stale;\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.endUpdate(this);\n\t\t}\n\t}\n\n\tpublic setValue(newValue: T, tx: ITransaction, change: TChange): void {\n\t\tthis._value = newValue;\n\t\tconst observers = this._observers;\n\t\ttx.updateObserver(this, this);\n\t\tfor (const d of observers) {\n\t\t\td.handleChange(this, change);\n\t\t}\n\t}\n}\n\n\nexport class DerivedWithSetter<T, TChangeSummary = any, TOutChanges = any> extends Derived<T, TChangeSummary, TOutChanges> implements ISettableObservable<T, TOutChanges> {\n\tconstructor(\n\t\tdebugNameData: DebugNameData,\n\t\tcomputeFn: (reader: IDerivedReader<TOutChanges>, changeSummary: TChangeSummary) => T,\n\t\tchangeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\thandleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tequalityComparator: EqualityComparer<T>,\n\t\tpublic readonly set: (value: T, tx: ITransaction | undefined, change: TOutChanges) => void,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(\n\t\t\tdebugNameData,\n\t\t\tcomputeFn,\n\t\t\tchangeTracker,\n\t\t\thandleLastObserverRemoved,\n\t\t\tequalityComparator,\n\t\t\tdebugLocation,\n\t\t);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IObservable, IObservableWithChange, IObserver, IReaderWithStore, ISettableObservable, ITransaction } from '../base.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BugIndicatingError, DisposableStore, EqualityComparer, assertFn, onBugIndicatingError } from '../commonFacade/deps.js';\nimport { getLogger } from '../logging/logging.js';\nimport { IChangeTracker } from '../changeTracker.js';\nimport { DebugLocation } from '../debugLocation.js';\n\nexport interface IDerivedReader<TChange = void> extends IReaderWithStore {\n}\n\nexport const enum DerivedState {\n\t/** Initial state, no previous value, recomputation needed */\n\tinitial = 0,\n\n\t/**\n\t * A dependency could have changed.\n\t * We need to explicitly ask them if at least one dependency changed.\n\t */\n\tdependenciesMightHaveChanged = 1,\n\n\t/**\n\t * A dependency changed and we need to recompute.\n\t * After recomputation, we need to check the previous value to see if we changed as well.\n\t */\n\tstale = 2,\n\n\t/**\n\t * No change reported, our cached value is up to date.\n\t */\n\tupToDate = 3,\n}\n\nfunction derivedStateToString(state: DerivedState): string {\n\tswitch (state) {\n\t\tcase DerivedState.initial: return 'initial';\n\t\tcase DerivedState.dependenciesMightHaveChanged: return 'dependenciesMightHaveChanged';\n\t\tcase DerivedState.stale: return 'stale';\n\t\tcase DerivedState.upToDate: return 'upToDate';\n\t\tdefault: return '<unknown>';\n\t}\n}\n\nexport class Derived<T, TChangeSummary = any, TChange = void> extends BaseObservable<T, TChange> implements IDerivedReader<TChange>, IObserver {\n\tprivate _state = DerivedState.initial;\n\tprivate _value: T | undefined = undefined;\n\tprivate _updateCount = 0;\n\tprivate _dependencies = new Set<IObservable<any>>();\n\tprivate _dependenciesToBeRemoved = new Set<IObservable<any>>();\n\tprivate _changeSummary: TChangeSummary | undefined = undefined;\n\tprivate _isUpdating = false;\n\tprivate _isComputing = false;\n\tprivate _didReportChange = false;\n\tprivate _isInBeforeUpdate = false;\n\tprivate _isReaderValid = false;\n\tprivate _store: DisposableStore | undefined = undefined;\n\tprivate _delayedStore: DisposableStore | undefined = undefined;\n\tprivate _removedObserverToCallEndUpdateOn: Set<IObserver> | null = null;\n\n\tpublic override get debugName(): string {\n\t\treturn this._debugNameData.getDebugName(this) ?? '(anonymous)';\n\t}\n\n\tconstructor(\n\t\tpublic readonly _debugNameData: DebugNameData,\n\t\tpublic readonly _computeFn: (reader: IDerivedReader<TChange>, changeSummary: TChangeSummary) => T,\n\t\tprivate readonly _changeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\tprivate readonly _handleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(debugLocation);\n\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(undefined);\n\t}\n\n\tprotected override onLastObserverRemoved(): void {\n\t\t/**\n\t\t * We are not tracking changes anymore, thus we have to assume\n\t\t * that our cache is invalid.\n\t\t */\n\t\tthis._state = DerivedState.initial;\n\t\tthis._value = undefined;\n\t\tgetLogger()?.handleDerivedCleared(this);\n\t\tfor (const d of this._dependencies) {\n\t\t\td.removeObserver(this);\n\t\t}\n\t\tthis._dependencies.clear();\n\n\t\tif (this._store !== undefined) {\n\t\t\tthis._store.dispose();\n\t\t\tthis._store = undefined;\n\t\t}\n\t\tif (this._delayedStore !== undefined) {\n\t\t\tthis._delayedStore.dispose();\n\t\t\tthis._delayedStore = undefined;\n\t\t}\n\n\t\tthis._handleLastObserverRemoved?.();\n\t}\n\n\tpublic override get(): T {\n\t\tconst checkEnabled = false; // TODO set to true\n\t\tif (this._isComputing && checkEnabled) {\n\t\t\t// investigate why this fails in the diff editor!\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tif (this._observers.size === 0) {\n\t\t\tlet result;\n\t\t\t// Without observers, we don't know when to clean up stuff.\n\t\t\t// Thus, we don't cache anything to prevent memory leaks.\n\t\t\ttry {\n\t\t\t\tthis._isReaderValid = true;\n\t\t\t\tlet changeSummary = undefined;\n\t\t\t\tif (this._changeTracker) {\n\t\t\t\t\tchangeSummary = this._changeTracker.createChangeSummary(undefined);\n\t\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\t}\n\t\t\t\tresult = this._computeFn(this, changeSummary!);\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t}\n\t\t\t// Clear new dependencies\n\t\t\tthis.onLastObserverRemoved();\n\t\t\treturn result;\n\n\t\t} else {\n\t\t\tdo {\n\t\t\t\t// We might not get a notification for a dependency that changed while it is updating,\n\t\t\t\t// thus we also have to ask all our depedencies if they changed in this case.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tfor (const d of this._dependencies) {\n\t\t\t\t\t\t/** might call {@link handleChange} indirectly, which could make us stale */\n\t\t\t\t\t\td.reportChanges();\n\n\t\t\t\t\t\tif (this._state as DerivedState === DerivedState.stale) {\n\t\t\t\t\t\t\t// The other dependencies will refresh on demand, so early break\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// We called report changes of all dependencies.\n\t\t\t\t// If we are still not stale, we can assume to be up to date again.\n\t\t\t\tif (this._state === DerivedState.dependenciesMightHaveChanged) {\n\t\t\t\t\tthis._state = DerivedState.upToDate;\n\t\t\t\t}\n\n\t\t\t\tif (this._state !== DerivedState.upToDate) {\n\t\t\t\t\tthis._recompute();\n\t\t\t\t}\n\t\t\t\t// In case recomputation changed one of our dependencies, we need to recompute again.\n\t\t\t} while (this._state !== DerivedState.upToDate);\n\t\t\treturn this._value!;\n\t\t}\n\t}\n\n\tprivate _recompute() {\n\t\tlet didChange = false;\n\t\tthis._isComputing = true;\n\t\tthis._didReportChange = false;\n\n\t\tconst emptySet = this._dependenciesToBeRemoved;\n\t\tthis._dependenciesToBeRemoved = this._dependencies;\n\t\tthis._dependencies = emptySet;\n\n\t\ttry {\n\t\t\tconst changeSummary = this._changeSummary!;\n\n\t\t\tthis._isReaderValid = true;\n\t\t\tif (this._changeTracker) {\n\t\t\t\tthis._isInBeforeUpdate = true;\n\t\t\t\tthis._changeTracker.beforeUpdate?.(this, changeSummary);\n\t\t\t\tthis._isInBeforeUpdate = false;\n\t\t\t\tthis._changeSummary = this._changeTracker?.createChangeSummary(changeSummary);\n\t\t\t}\n\n\t\t\tconst hadValue = this._state !== DerivedState.initial;\n\t\t\tconst oldValue = this._value;\n\t\t\tthis._state = DerivedState.upToDate;\n\n\t\t\tconst delayedStore = this._delayedStore;\n\t\t\tif (delayedStore !== undefined) {\n\t\t\t\tthis._delayedStore = undefined;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (this._store !== undefined) {\n\t\t\t\t\tthis._store.dispose();\n\t\t\t\t\tthis._store = undefined;\n\t\t\t\t}\n\t\t\t\t/** might call {@link handleChange} indirectly, which could invalidate us */\n\t\t\t\tthis._value = this._computeFn(this, changeSummary);\n\n\t\t\t} finally {\n\t\t\t\tthis._isReaderValid = false;\n\t\t\t\t// We don't want our observed observables to think that they are (not even temporarily) not being observed.\n\t\t\t\t// Thus, we only unsubscribe from observables that are definitely not read anymore.\n\t\t\t\tfor (const o of this._dependenciesToBeRemoved) {\n\t\t\t\t\to.removeObserver(this);\n\t\t\t\t}\n\t\t\t\tthis._dependenciesToBeRemoved.clear();\n\n\t\t\t\tif (delayedStore !== undefined) {\n\t\t\t\t\tdelayedStore.dispose();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdidChange = this._didReportChange || (hadValue && !(this._equalityComparator(oldValue!, this._value)));\n\n\t\t\tgetLogger()?.handleObservableUpdated(this, {\n\t\t\t\toldValue,\n\t\t\t\tnewValue: this._value,\n\t\t\t\tchange: undefined,\n\t\t\t\tdidChange,\n\t\t\t\thadValue,\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tonBugIndicatingError(e);\n\t\t}\n\n\t\tthis._isComputing = false;\n\n\t\tif (!this._didReportChange && didChange) {\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handleChange(this, undefined);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._didReportChange = false;\n\t\t}\n\t}\n\n\tpublic override toString(): string {\n\t\treturn `LazyDerived<${this.debugName}>`;\n\t}\n\n\t// IObserver Implementation\n\n\tpublic beginUpdate<T>(_observable: IObservable<T>): void {\n\t\tif (this._isUpdating) {\n\t\t\tthrow new BugIndicatingError('Cyclic deriveds are not supported yet!');\n\t\t}\n\n\t\tthis._updateCount++;\n\t\tthis._isUpdating = true;\n\t\ttry {\n\t\t\tconst propagateBeginUpdate = this._updateCount === 1;\n\t\t\tif (this._state === DerivedState.upToDate) {\n\t\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\t\t// If we propagate begin update, that will already signal a possible change.\n\t\t\t\tif (!propagateBeginUpdate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (propagateBeginUpdate) {\n\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\tr.beginUpdate(this); // This signals a possible change\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis._isUpdating = false;\n\t\t}\n\t}\n\n\tpublic endUpdate<T>(_observable: IObservable<T>): void {\n\t\tthis._updateCount--;\n\t\tif (this._updateCount === 0) {\n\t\t\t// End update could change the observer list.\n\t\t\tconst observers = [...this._observers];\n\t\t\tfor (const r of observers) {\n\t\t\t\tr.endUpdate(this);\n\t\t\t}\n\t\t\tif (this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tconst observers = [...this._removedObserverToCallEndUpdateOn];\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = null;\n\t\t\t\tfor (const r of observers) {\n\t\t\t\t\tr.endUpdate(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassertFn(() => this._updateCount >= 0);\n\t}\n\n\tpublic handlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// In all other states, observers already know that we might have changed.\n\t\tif (this._state === DerivedState.upToDate && this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable)) {\n\t\t\tthis._state = DerivedState.dependenciesMightHaveChanged;\n\t\t\tfor (const r of this._observers) {\n\t\t\t\tr.handlePossibleChange(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic handleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\tif (this._dependencies.has(observable) && !this._dependenciesToBeRemoved.has(observable) || this._isInBeforeUpdate) {\n\t\t\tgetLogger()?.handleDerivedDependencyChanged(this, observable, change);\n\n\t\t\tlet shouldReact = false;\n\t\t\ttry {\n\t\t\t\tshouldReact = this._changeTracker ? this._changeTracker.handleChange({\n\t\t\t\t\tchangedObservable: observable,\n\t\t\t\t\tchange,\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\tdidChange: (o): this is any => o === observable as any,\n\t\t\t\t}, this._changeSummary!) : true;\n\t\t\t} catch (e) {\n\t\t\t\tonBugIndicatingError(e);\n\t\t\t}\n\n\t\t\tconst wasUpToDate = this._state === DerivedState.upToDate;\n\t\t\tif (shouldReact && (this._state === DerivedState.dependenciesMightHaveChanged || wasUpToDate)) {\n\t\t\t\tthis._state = DerivedState.stale;\n\t\t\t\tif (wasUpToDate) {\n\t\t\t\t\tfor (const r of this._observers) {\n\t\t\t\t\t\tr.handlePossibleChange(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// IReader Implementation\n\n\tprivate _ensureReaderValid(): void {\n\t\tif (!this._isReaderValid) { throw new BugIndicatingError('The reader object cannot be used outside its compute function!'); }\n\t}\n\n\tpublic readObservable<T>(observable: IObservable<T>): T {\n\t\tthis._ensureReaderValid();\n\n\t\t// Subscribe before getting the value to enable caching\n\t\tobservable.addObserver(this);\n\t\t/** This might call {@link handleChange} indirectly, which could invalidate us */\n\t\tconst value = observable.get();\n\t\t// Which is why we only add the observable to the dependencies now.\n\t\tthis._dependencies.add(observable);\n\t\tthis._dependenciesToBeRemoved.delete(observable);\n\t\treturn value;\n\t}\n\n\tget store(): DisposableStore {\n\t\tthis._ensureReaderValid();\n\n\t\tif (this._store === undefined) {\n\t\t\tthis._store = new DisposableStore();\n\t\t}\n\t\treturn this._store;\n\t}\n\n\tpublic override addObserver(observer: IObserver): void {\n\t\tconst shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCount > 0;\n\t\tsuper.addObserver(observer);\n\n\t\tif (shouldCallBeginUpdate) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn?.delete(observer)) {\n\t\t\t\tobserver.beginUpdate(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override removeObserver(observer: IObserver): void {\n\t\tif (this._observers.has(observer) && this._updateCount > 0) {\n\t\t\tif (!this._removedObserverToCallEndUpdateOn) {\n\t\t\t\tthis._removedObserverToCallEndUpdateOn = new Set();\n\t\t\t}\n\t\t\tthis._removedObserverToCallEndUpdateOn.add(observer);\n\t\t}\n\t\tsuper.removeObserver(observer);\n\t}\n\n\tpublic debugGetState() {\n\t\treturn {\n\t\t\tstate: this._state,\n\t\t\tstateStr: derivedStateToString(this._state),\n\t\t\tupdateCount: this._updateCount,\n\t\t\tisComputing: this._isComputing,\n\t\t\tdependencies: this._dependencies,\n\t\t\tvalue: this._value,\n\t\t};\n\t}\n\n\tpublic debugSetValue(newValue: unknown) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = newValue as any;\n\t}\n\n\tpublic debugRecompute(): void {\n\t\tthis.beginUpdate(this);\n\t\ttry {\n\t\t\tif (!this._isComputing) {\n\t\t\t\tthis._recompute();\n\t\t\t} else {\n\t\t\t\tthis._state = DerivedState.stale;\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.endUpdate(this);\n\t\t}\n\t}\n\n\tpublic setValue(newValue: T, tx: ITransaction, change: TChange): void {\n\t\tthis._value = newValue;\n\t\tconst observers = this._observers;\n\t\ttx.updateObserver(this, this);\n\t\tfor (const d of observers) {\n\t\t\td.handleChange(this, change);\n\t\t}\n\t}\n}\n\n\nexport class DerivedWithSetter<T, TChangeSummary = any, TOutChanges = any> extends Derived<T, TChangeSummary, TOutChanges> implements ISettableObservable<T, TOutChanges> {\n\tconstructor(\n\t\tdebugNameData: DebugNameData,\n\t\tcomputeFn: (reader: IDerivedReader<TOutChanges>, changeSummary: TChangeSummary) => T,\n\t\tchangeTracker: IChangeTracker<TChangeSummary> | undefined,\n\t\thandleLastObserverRemoved: (() => void) | undefined = undefined,\n\t\tequalityComparator: EqualityComparer<T>,\n\t\tpublic readonly set: (value: T, tx: ITransaction | undefined, change: TOutChanges) => void,\n\t\tdebugLocation: DebugLocation,\n\t) {\n\t\tsuper(\n\t\t\tdebugNameData,\n\t\t\tcomputeFn,\n\t\t\tchangeTracker,\n\t\t\thandleLastObserverRemoved,\n\t\t\tequalityComparator,\n\t\t\tdebugLocation,\n\t\t);\n\t}\n}\n"]}
|
|
@@ -14,27 +14,27 @@ export var PolicyCategory;
|
|
|
14
14
|
export const PolicyCategoryData = {
|
|
15
15
|
[PolicyCategory.Extensions]: {
|
|
16
16
|
name: {
|
|
17
|
-
key: 'extensionsConfigurationTitle', value: localize(
|
|
17
|
+
key: 'extensionsConfigurationTitle', value: localize(57, "Extensions"),
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
[PolicyCategory.IntegratedTerminal]: {
|
|
21
21
|
name: {
|
|
22
|
-
key: 'terminalIntegratedConfigurationTitle', value: localize(
|
|
22
|
+
key: 'terminalIntegratedConfigurationTitle', value: localize(58, "Integrated Terminal"),
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
[PolicyCategory.InteractiveSession]: {
|
|
26
26
|
name: {
|
|
27
|
-
key: 'interactiveSessionConfigurationTitle', value: localize(
|
|
27
|
+
key: 'interactiveSessionConfigurationTitle', value: localize(59, "Chat"),
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
[PolicyCategory.Telemetry]: {
|
|
31
31
|
name: {
|
|
32
|
-
key: 'telemetryConfigurationTitle', value: localize(
|
|
32
|
+
key: 'telemetryConfigurationTitle', value: localize(60, "Telemetry"),
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
[PolicyCategory.Update]: {
|
|
36
36
|
name: {
|
|
37
|
-
key: 'updateConfigurationTitle', value: localize(
|
|
37
|
+
key: 'updateConfigurationTitle', value: localize(61, "Update"),
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -90,7 +90,7 @@ let ScreenReaderSupport = class ScreenReaderSupport extends Disposable {
|
|
|
90
90
|
this._domNode.domNode.setAttribute('aria-required', options.get(9 /* EditorOption.ariaRequired */) ? 'true' : 'false');
|
|
91
91
|
this._domNode.domNode.setAttribute('aria-multiline', 'true');
|
|
92
92
|
this._domNode.domNode.setAttribute('aria-autocomplete', options.get(104 /* EditorOption.readOnly */) ? 'none' : 'both');
|
|
93
|
-
this._domNode.domNode.setAttribute('aria-roledescription', localize(
|
|
93
|
+
this._domNode.domNode.setAttribute('aria-roledescription', localize(62, "editor"));
|
|
94
94
|
this._domNode.domNode.setAttribute('aria-label', ariaLabelForScreenReaderContent(options, this._keybindingService));
|
|
95
95
|
const tabSize = this._context.viewModel.model.getOptions().tabSize;
|
|
96
96
|
const spaceWidth = options.get(59 /* EditorOption.fontInfo */).spaceWidth;
|
|
@@ -77,15 +77,15 @@ export function ariaLabelForScreenReaderContent(options, keybindingService) {
|
|
|
77
77
|
const toggleKeybindingLabel = keybindingService.lookupKeybinding('editor.action.toggleScreenReaderAccessibilityMode')?.getAriaLabel();
|
|
78
78
|
const runCommandKeybindingLabel = keybindingService.lookupKeybinding('workbench.action.showCommands')?.getAriaLabel();
|
|
79
79
|
const keybindingEditorKeybindingLabel = keybindingService.lookupKeybinding('workbench.action.openGlobalKeybindings')?.getAriaLabel();
|
|
80
|
-
const editorNotAccessibleMessage = nls.localize(
|
|
80
|
+
const editorNotAccessibleMessage = nls.localize(63, "The editor is not accessible at this time.");
|
|
81
81
|
if (toggleKeybindingLabel) {
|
|
82
|
-
return nls.localize(
|
|
82
|
+
return nls.localize(64, "{0} To enable screen reader optimized mode, use {1}", editorNotAccessibleMessage, toggleKeybindingLabel);
|
|
83
83
|
}
|
|
84
84
|
else if (runCommandKeybindingLabel) {
|
|
85
|
-
return nls.localize(
|
|
85
|
+
return nls.localize(65, "{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.", editorNotAccessibleMessage, runCommandKeybindingLabel);
|
|
86
86
|
}
|
|
87
87
|
else if (keybindingEditorKeybindingLabel) {
|
|
88
|
-
return nls.localize(
|
|
88
|
+
return nls.localize(66, "{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.", editorNotAccessibleMessage, keybindingEditorKeybindingLabel);
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
91
|
// SOS
|
|
@@ -130,7 +130,7 @@ let TextAreaEditContext = class TextAreaEditContext extends AbstractEditContext
|
|
|
130
130
|
this.textArea.setAttribute('aria-required', options.get(9 /* EditorOption.ariaRequired */) ? 'true' : 'false');
|
|
131
131
|
this.textArea.setAttribute('tabindex', String(options.get(140 /* EditorOption.tabIndex */)));
|
|
132
132
|
this.textArea.setAttribute('role', 'textbox');
|
|
133
|
-
this.textArea.setAttribute('aria-roledescription', nls.localize(
|
|
133
|
+
this.textArea.setAttribute('aria-roledescription', nls.localize(67, "editor"));
|
|
134
134
|
this.textArea.setAttribute('aria-multiline', 'true');
|
|
135
135
|
this.textArea.setAttribute('aria-autocomplete', options.get(104 /* EditorOption.readOnly */) ? 'none' : 'both');
|
|
136
136
|
this._ensureReadOnlyAttribute();
|
|
@@ -860,7 +860,7 @@ export var CoreNavigationCommands;
|
|
|
860
860
|
type: 'object',
|
|
861
861
|
properties: {
|
|
862
862
|
'sticky': {
|
|
863
|
-
description: nls.localize(
|
|
863
|
+
description: nls.localize(68, "Stick to the end even when going to longer lines"),
|
|
864
864
|
type: 'boolean',
|
|
865
865
|
default: false
|
|
866
866
|
}
|
|
@@ -888,7 +888,7 @@ export var CoreNavigationCommands;
|
|
|
888
888
|
type: 'object',
|
|
889
889
|
properties: {
|
|
890
890
|
'sticky': {
|
|
891
|
-
description: nls.localize(
|
|
891
|
+
description: nls.localize(69, "Stick to the end even when going to longer lines"),
|
|
892
892
|
type: 'boolean',
|
|
893
893
|
default: false
|
|
894
894
|
}
|
|
@@ -1436,7 +1436,7 @@ export var CoreNavigationCommands;
|
|
|
1436
1436
|
viewModel.getPrimaryCursorState()
|
|
1437
1437
|
]);
|
|
1438
1438
|
viewModel.revealAllCursors(args.source, true);
|
|
1439
|
-
status(nls.localize(
|
|
1439
|
+
status(nls.localize(70, "Removed secondary cursors"));
|
|
1440
1440
|
}
|
|
1441
1441
|
});
|
|
1442
1442
|
CoreNavigationCommands.RevealLine = registerEditorCommand(new class extends CoreEditorCommand {
|