monaco-editor-core 0.55.0-dev-20251021 → 0.55.0-dev-20251023

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +23 -5
  18. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  19. package/esm/vs/base/browser/ui/iconLabel/iconlabel.css +2 -3
  20. package/esm/vs/base/browser/ui/list/listPaging.js +5 -1
  21. package/esm/vs/base/browser/ui/list/listPaging.js.map +1 -1
  22. package/esm/vs/base/browser/ui/list/listView.js +4 -3
  23. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  24. package/esm/vs/base/common/arrays.js +10 -0
  25. package/esm/vs/base/common/arrays.js.map +1 -1
  26. package/esm/vs/base/common/codiconsLibrary.js +1 -0
  27. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  28. package/esm/vs/base/common/paging.js.map +1 -1
  29. package/esm/vs/base/common/platform.js +1 -0
  30. package/esm/vs/base/common/platform.js.map +1 -1
  31. package/esm/vs/base/common/policy.js +40 -1
  32. package/esm/vs/base/common/policy.js.map +1 -1
  33. package/esm/vs/base/common/validation.js +157 -0
  34. package/esm/vs/base/common/validation.js.map +1 -0
  35. package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
  36. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
  37. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
  38. package/esm/vs/editor/browser/coreCommands.js +3 -3
  39. package/esm/vs/editor/browser/editorExtensions.js +9 -9
  40. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  41. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
  42. package/esm/vs/editor/browser/services/hoverService/updatableHoverWidget.js +1 -1
  43. package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
  44. package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
  45. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +2 -2
  46. package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  47. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
  48. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
  49. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  50. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +1 -1
  51. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
  52. package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
  53. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
  54. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  55. package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  56. package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  57. package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  58. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
  59. package/esm/vs/editor/common/config/editorConfigurationSchema.js +54 -54
  60. package/esm/vs/editor/common/config/editorOptions.js +406 -406
  61. package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
  62. package/esm/vs/editor/common/editorContextKeys.js +46 -46
  63. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  64. package/esm/vs/editor/common/languages.js +66 -56
  65. package/esm/vs/editor/common/languages.js.map +1 -1
  66. package/esm/vs/editor/common/model/editStack.js +1 -1
  67. package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js.map +1 -1
  68. package/esm/vs/editor/common/model/tokens/treeSitter/treeSitterSyntaxTokenBackend.js +1 -1
  69. package/esm/vs/editor/common/model/tokens/treeSitter/treeSitterSyntaxTokenBackend.js.map +1 -1
  70. package/esm/vs/editor/common/services/treeSitter/treeSitterLibraryService.js.map +1 -1
  71. package/esm/vs/editor/common/standaloneStrings.js +10 -10
  72. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  73. package/esm/vs/editor/common/viewModel/viewModelLines.js.map +1 -1
  74. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  75. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  76. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  77. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  78. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  79. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  80. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  81. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  82. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  83. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  84. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  85. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  86. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  87. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  88. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  89. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  90. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  91. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  92. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  93. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  94. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  95. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  96. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  97. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  98. package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
  99. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  100. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  101. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  102. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  103. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
  104. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  105. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  106. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  107. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  108. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  109. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  110. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  111. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  112. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  113. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  114. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  115. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  116. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  117. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  118. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
  119. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  120. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  121. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  122. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  123. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +63 -52
  124. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  125. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
  126. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
  127. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +1 -1
  128. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  129. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -4
  130. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
  131. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +11 -12
  132. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  133. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +4 -4
  134. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  135. package/esm/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js.map +1 -1
  136. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  137. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  138. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +3 -0
  139. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  140. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
  141. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +5 -5
  142. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  143. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  144. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  145. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  146. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
  147. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  148. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  149. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  150. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  151. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  152. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  153. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  154. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  155. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +35 -28
  156. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
  157. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  158. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  159. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  160. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  161. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  162. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  163. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  164. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  165. package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  166. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  167. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  168. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  169. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  170. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  171. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  172. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  173. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  174. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  175. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  176. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  177. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  178. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  179. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  180. package/esm/vs/editor/standalone/browser/standaloneTreeSitterLibraryService.js +2 -12
  181. package/esm/vs/editor/standalone/browser/standaloneTreeSitterLibraryService.js.map +1 -1
  182. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  183. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  184. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  185. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  186. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  187. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  188. package/esm/vs/platform/actions/common/actions.js +1 -0
  189. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  190. package/esm/vs/platform/actions/common/menuService.js +2 -2
  191. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  192. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  193. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  194. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  195. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  196. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  197. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  198. package/esm/vs/platform/list/browser/listService.js +27 -27
  199. package/esm/vs/platform/markers/common/markerService.js +2 -2
  200. package/esm/vs/platform/markers/common/markers.js +6 -6
  201. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +19 -9
  202. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
  203. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  204. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  205. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  206. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  207. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  208. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  209. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +2 -2
  210. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js.map +1 -1
  211. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  212. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  213. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  214. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  215. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  216. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  217. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  218. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  219. package/esm/vs/platform/theme/common/colors/miscColors.js +15 -15
  220. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  221. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  222. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  223. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  224. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  225. package/package.json +2 -2
  226. package/version.txt +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/platform.ts","vs/base/common/platform.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,IAAI,UAAU,GAAG,KAAK,CAAC;AACvB,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,IAAI,WA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AAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC","file":"platform.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 nls from '../../nls.js';\n\nexport const LANGUAGE_DEFAULT = 'en';\n\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isElectron = false;\nlet _isIOS = false;\nlet _isCI = false;\nlet _isMobile = false;\nlet _locale: string | undefined = undefined;\nlet _language: string = LANGUAGE_DEFAULT;\nlet _platformLocale: string = LANGUAGE_DEFAULT;\nlet _translationsConfigFile: string | undefined = undefined;\nlet _userAgent: string | undefined = undefined;\n\nexport interface IProcessEnvironment {\n\t[key: string]: string | undefined;\n}\n\n/**\n * This interface is intentionally not identical to node.js\n * process because it also works in sandboxed environments\n * where the process object is implemented differently. We\n * define the properties here that we need for `platform`\n * to work and nothing else.\n */\nexport interface INodeProcess {\n\tplatform: string;\n\tarch: string;\n\tenv: IProcessEnvironment;\n\tversions?: {\n\t\tnode?: string;\n\t\telectron?: string;\n\t\tchrome?: string;\n\t};\n\ttype?: string;\n\tcwd: () => string;\n}\n\ndeclare const process: INodeProcess;\n\nconst $globalThis: any = globalThis;\n\nlet nodeProcess: INodeProcess | undefined = undefined;\nif (typeof $globalThis.vscode !== 'undefined' && typeof $globalThis.vscode.process !== 'undefined') {\n\t// Native environment (sandboxed)\n\tnodeProcess = $globalThis.vscode.process;\n} else if (typeof process !== 'undefined' && typeof process?.versions?.node === 'string') {\n\t// Native environment (non-sandboxed)\n\tnodeProcess = process;\n}\n\nconst isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';\nconst isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';\n\ninterface INavigator {\n\tuserAgent: string;\n\tmaxTouchPoints?: number;\n\tlanguage: string;\n}\ndeclare const navigator: INavigator;\n\n// Native environment\nif (typeof nodeProcess === 'object') {\n\t_isWindows = (nodeProcess.platform === 'win32');\n\t_isMacintosh = (nodeProcess.platform === 'darwin');\n\t_isLinux = (nodeProcess.platform === 'linux');\n\t_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\n\t_isElectron = isElectronProcess;\n\t_isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] || !!nodeProcess.env['GITHUB_WORKSPACE'];\n\t_locale = LANGUAGE_DEFAULT;\n\t_language = LANGUAGE_DEFAULT;\n\tconst rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\n\tif (rawNlsConfig) {\n\t\ttry {\n\t\t\tconst nlsConfig: nls.INLSConfiguration = JSON.parse(rawNlsConfig);\n\t\t\t_locale = nlsConfig.userLocale;\n\t\t\t_platformLocale = nlsConfig.osLocale;\n\t\t\t_language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;\n\t\t\t_translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;\n\t\t} catch (e) {\n\t\t}\n\t}\n\t_isNative = true;\n}\n\n// Web environment\nelse if (typeof navigator === 'object' && !isElectronRenderer) {\n\t_userAgent = navigator.userAgent;\n\t_isWindows = _userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n\t_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n\t_isLinux = _userAgent.indexOf('Linux') >= 0;\n\t_isMobile = _userAgent?.indexOf('Mobi') >= 0;\n\t_isWeb = true;\n\t_language = nls.getNLSLanguage() || LANGUAGE_DEFAULT;\n\t_locale = navigator.language.toLowerCase();\n\t_platformLocale = _locale;\n}\n\n// Unknown environment\nelse {\n\tconsole.error('Unable to resolve platform.');\n}\n\nexport const enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isMacintosh) {\n\t_platform = Platform.Mac;\n} else if (_isWindows) {\n\t_platform = Platform.Windows;\n} else if (_isLinux) {\n\t_platform = Platform.Linux;\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isElectron = _isElectron;\nexport const isWeb = _isWeb;\nexport const isWebWorker = (_isWeb && typeof $globalThis.importScripts === 'function');\nexport const webWorkerOrigin = isWebWorker ? $globalThis.origin : undefined;\nexport const isIOS = _isIOS;\nexport const isMobile = _isMobile;\nexport const platform = _platform;\nexport const userAgent = _userAgent;\n\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese or de for German)\n */\nexport const language = _language;\n\nexport const setTimeout0IsFaster = (typeof $globalThis.postMessage === 'function' && !$globalThis.importScripts);\n\n/**\n * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.\n *\n * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay\n * that browsers set when the nesting level is > 5.\n */\nexport const setTimeout0 = (() => {\n\tif (setTimeout0IsFaster) {\n\t\tinterface IQueueElement {\n\t\t\tid: number;\n\t\t\tcallback: () => void;\n\t\t}\n\t\tconst pending: IQueueElement[] = [];\n\n\t\t$globalThis.addEventListener('message', (e: any) => {\n\t\t\tif (e.data && e.data.vscodeScheduleAsyncWork) {\n\t\t\t\tfor (let i = 0, len = pending.length; i < len; i++) {\n\t\t\t\t\tconst candidate = pending[i];\n\t\t\t\t\tif (candidate.id === e.data.vscodeScheduleAsyncWork) {\n\t\t\t\t\t\tpending.splice(i, 1);\n\t\t\t\t\t\tcandidate.callback();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlet lastId = 0;\n\t\treturn (callback: () => void) => {\n\t\t\tconst myId = ++lastId;\n\t\t\tpending.push({\n\t\t\t\tid: myId,\n\t\t\t\tcallback: callback\n\t\t\t});\n\t\t\t$globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, '*');\n\t\t};\n\t}\n\treturn (callback: () => void) => setTimeout(callback);\n})();\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh || _isIOS ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian(): boolean {\n\tif (!_isLittleEndianComputed) {\n\t\t_isLittleEndianComputed = true;\n\t\tconst test = new Uint8Array(2);\n\t\ttest[0] = 1;\n\t\ttest[1] = 2;\n\t\tconst view = new Uint16Array(test.buffer);\n\t\t_isLittleEndian = (view[0] === (2 << 8) + 1);\n\t}\n\treturn _isLittleEndian;\n}\n\nexport const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0);\nexport const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0);\nexport const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0));\nexport const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0);\nexport const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as nls from '../../nls.js';\n\nexport const LANGUAGE_DEFAULT = 'en';\n\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isElectron = false;\nlet _isIOS = false;\nlet _isCI = false;\nlet _isMobile = false;\nlet _locale: string | undefined = undefined;\nlet _language: string = LANGUAGE_DEFAULT;\nlet _platformLocale: string = LANGUAGE_DEFAULT;\nlet _translationsConfigFile: string | undefined = undefined;\nlet _userAgent: string | undefined = undefined;\n\nexport interface IProcessEnvironment {\n\t[key: string]: string | undefined;\n}\n\n/**\n * This interface is intentionally not identical to node.js\n * process because it also works in sandboxed environments\n * where the process object is implemented differently. We\n * define the properties here that we need for `platform`\n * to work and nothing else.\n */\nexport interface INodeProcess {\n\tplatform: string;\n\tarch: string;\n\tenv: IProcessEnvironment;\n\tversions?: {\n\t\tnode?: string;\n\t\telectron?: string;\n\t\tchrome?: string;\n\t};\n\ttype?: string;\n\tcwd: () => string;\n}\n\ndeclare const process: INodeProcess;\n\nconst $globalThis: any = globalThis;\n\nlet nodeProcess: INodeProcess | undefined = undefined;\nif (typeof $globalThis.vscode !== 'undefined' && typeof $globalThis.vscode.process !== 'undefined') {\n\t// Native environment (sandboxed)\n\tnodeProcess = $globalThis.vscode.process;\n} else if (typeof process !== 'undefined' && typeof process?.versions?.node === 'string') {\n\t// Native environment (non-sandboxed)\n\tnodeProcess = process;\n}\n\nconst isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';\nconst isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';\n\ninterface INavigator {\n\tuserAgent: string;\n\tmaxTouchPoints?: number;\n\tlanguage: string;\n}\ndeclare const navigator: INavigator;\n\n// Native environment\nif (typeof nodeProcess === 'object') {\n\t_isWindows = (nodeProcess.platform === 'win32');\n\t_isMacintosh = (nodeProcess.platform === 'darwin');\n\t_isLinux = (nodeProcess.platform === 'linux');\n\t_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\n\t_isElectron = isElectronProcess;\n\t_isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] || !!nodeProcess.env['GITHUB_WORKSPACE'];\n\t_locale = LANGUAGE_DEFAULT;\n\t_language = LANGUAGE_DEFAULT;\n\tconst rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\n\tif (rawNlsConfig) {\n\t\ttry {\n\t\t\tconst nlsConfig: nls.INLSConfiguration = JSON.parse(rawNlsConfig);\n\t\t\t_locale = nlsConfig.userLocale;\n\t\t\t_platformLocale = nlsConfig.osLocale;\n\t\t\t_language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;\n\t\t\t_translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;\n\t\t} catch (e) {\n\t\t}\n\t}\n\t_isNative = true;\n}\n\n// Web environment\nelse if (typeof navigator === 'object' && !isElectronRenderer) {\n\t_userAgent = navigator.userAgent;\n\t_isWindows = _userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n\t_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n\t_isLinux = _userAgent.indexOf('Linux') >= 0;\n\t_isMobile = _userAgent?.indexOf('Mobi') >= 0;\n\t_isWeb = true;\n\t_language = nls.getNLSLanguage() || LANGUAGE_DEFAULT;\n\t_locale = navigator.language.toLowerCase();\n\t_platformLocale = _locale;\n}\n\n// Unknown environment\nelse {\n\tconsole.error('Unable to resolve platform.');\n}\n\nexport const enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isMacintosh) {\n\t_platform = Platform.Mac;\n} else if (_isWindows) {\n\t_platform = Platform.Windows;\n} else if (_isLinux) {\n\t_platform = Platform.Linux;\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isElectron = _isElectron;\nexport const isWeb = _isWeb;\nexport const isWebWorker = (_isWeb && typeof $globalThis.importScripts === 'function');\nexport const webWorkerOrigin = isWebWorker ? $globalThis.origin : undefined;\nexport const isIOS = _isIOS;\nexport const isMobile = _isMobile;\nexport const platform = _platform;\nexport const userAgent = _userAgent;\n\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese or de for German)\n */\nexport const language = _language;\n\nexport const setTimeout0IsFaster = (typeof $globalThis.postMessage === 'function' && !$globalThis.importScripts);\n\n/**\n * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.\n *\n * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay\n * that browsers set when the nesting level is > 5.\n */\nexport const setTimeout0 = (() => {\n\tif (setTimeout0IsFaster) {\n\t\tinterface IQueueElement {\n\t\t\tid: number;\n\t\t\tcallback: () => void;\n\t\t}\n\t\tconst pending: IQueueElement[] = [];\n\n\t\t$globalThis.addEventListener('message', (e: any) => {\n\t\t\tif (e.data && e.data.vscodeScheduleAsyncWork) {\n\t\t\t\tfor (let i = 0, len = pending.length; i < len; i++) {\n\t\t\t\t\tconst candidate = pending[i];\n\t\t\t\t\tif (candidate.id === e.data.vscodeScheduleAsyncWork) {\n\t\t\t\t\t\tpending.splice(i, 1);\n\t\t\t\t\t\tcandidate.callback();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlet lastId = 0;\n\t\treturn (callback: () => void) => {\n\t\t\tconst myId = ++lastId;\n\t\t\tpending.push({\n\t\t\t\tid: myId,\n\t\t\t\tcallback: callback\n\t\t\t});\n\t\t\t$globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, '*');\n\t\t};\n\t}\n\treturn (callback: () => void) => setTimeout(callback);\n})();\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh || _isIOS ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian(): boolean {\n\tif (!_isLittleEndianComputed) {\n\t\t_isLittleEndianComputed = true;\n\t\tconst test = new Uint8Array(2);\n\t\ttest[0] = 1;\n\t\ttest[1] = 2;\n\t\tconst view = new Uint16Array(test.buffer);\n\t\t_isLittleEndian = (view[0] === (2 << 8) + 1);\n\t}\n\treturn _isLittleEndian;\n}\n\nexport const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0);\nexport const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0);\nexport const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0));\nexport const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0);\nexport const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/platform.ts","vs/base/common/platform.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;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CAAC,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,eAAe,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,eAAe,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC","file":"platform.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 nls from '../../nls.js';\n\nexport const LANGUAGE_DEFAULT = 'en';\n\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isElectron = false;\nlet _isIOS = false;\nlet _isCI = false;\nlet _isMobile = false;\nlet _locale: string | undefined = undefined;\nlet _language: string = LANGUAGE_DEFAULT;\nlet _platformLocale: string = LANGUAGE_DEFAULT;\nlet _translationsConfigFile: string | undefined = undefined;\nlet _userAgent: string | undefined = undefined;\n\nexport interface IProcessEnvironment {\n\t[key: string]: string | undefined;\n}\n\n/**\n * This interface is intentionally not identical to node.js\n * process because it also works in sandboxed environments\n * where the process object is implemented differently. We\n * define the properties here that we need for `platform`\n * to work and nothing else.\n */\nexport interface INodeProcess {\n\tplatform: string;\n\tarch: string;\n\tenv: IProcessEnvironment;\n\tversions?: {\n\t\tnode?: string;\n\t\telectron?: string;\n\t\tchrome?: string;\n\t};\n\ttype?: string;\n\tcwd: () => string;\n}\n\ndeclare const process: INodeProcess;\n\nconst $globalThis: any = globalThis;\n\nlet nodeProcess: INodeProcess | undefined = undefined;\nif (typeof $globalThis.vscode !== 'undefined' && typeof $globalThis.vscode.process !== 'undefined') {\n\t// Native environment (sandboxed)\n\tnodeProcess = $globalThis.vscode.process;\n} else if (typeof process !== 'undefined' && typeof process?.versions?.node === 'string') {\n\t// Native environment (non-sandboxed)\n\tnodeProcess = process;\n}\n\nconst isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';\nconst isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';\n\ninterface INavigator {\n\tuserAgent: string;\n\tmaxTouchPoints?: number;\n\tlanguage: string;\n}\ndeclare const navigator: INavigator;\n\n// Native environment\nif (typeof nodeProcess === 'object') {\n\t_isWindows = (nodeProcess.platform === 'win32');\n\t_isMacintosh = (nodeProcess.platform === 'darwin');\n\t_isLinux = (nodeProcess.platform === 'linux');\n\t_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\n\t_isElectron = isElectronProcess;\n\t_isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] || !!nodeProcess.env['GITHUB_WORKSPACE'];\n\t_locale = LANGUAGE_DEFAULT;\n\t_language = LANGUAGE_DEFAULT;\n\tconst rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\n\tif (rawNlsConfig) {\n\t\ttry {\n\t\t\tconst nlsConfig: nls.INLSConfiguration = JSON.parse(rawNlsConfig);\n\t\t\t_locale = nlsConfig.userLocale;\n\t\t\t_platformLocale = nlsConfig.osLocale;\n\t\t\t_language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;\n\t\t\t_translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;\n\t\t} catch (e) {\n\t\t}\n\t}\n\t_isNative = true;\n}\n\n// Web environment\nelse if (typeof navigator === 'object' && !isElectronRenderer) {\n\t_userAgent = navigator.userAgent;\n\t_isWindows = _userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n\t_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n\t_isLinux = _userAgent.indexOf('Linux') >= 0;\n\t_isMobile = _userAgent?.indexOf('Mobi') >= 0;\n\t_isWeb = true;\n\t_language = nls.getNLSLanguage() || LANGUAGE_DEFAULT;\n\t_locale = navigator.language.toLowerCase();\n\t_platformLocale = _locale;\n}\n\n// Unknown environment\nelse {\n\tconsole.error('Unable to resolve platform.');\n}\n\nexport const enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isMacintosh) {\n\t_platform = Platform.Mac;\n} else if (_isWindows) {\n\t_platform = Platform.Windows;\n} else if (_isLinux) {\n\t_platform = Platform.Linux;\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isElectron = _isElectron;\nexport const isWeb = _isWeb;\nexport const isWebWorker = (_isWeb && typeof $globalThis.importScripts === 'function');\nexport const webWorkerOrigin = isWebWorker ? $globalThis.origin : undefined;\nexport const isIOS = _isIOS;\nexport const isMobile = _isMobile;\nexport const platform = _platform;\nexport const userAgent = _userAgent;\n\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese or de for German)\n */\nexport const language = _language;\n\nexport const setTimeout0IsFaster = (typeof $globalThis.postMessage === 'function' && !$globalThis.importScripts);\n\n/**\n * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.\n *\n * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay\n * that browsers set when the nesting level is > 5.\n */\nexport const setTimeout0 = (() => {\n\tif (setTimeout0IsFaster) {\n\t\tinterface IQueueElement {\n\t\t\tid: number;\n\t\t\tcallback: () => void;\n\t\t}\n\t\tconst pending: IQueueElement[] = [];\n\n\t\t$globalThis.addEventListener('message', (e: any) => {\n\t\t\tif (e.data && e.data.vscodeScheduleAsyncWork) {\n\t\t\t\tfor (let i = 0, len = pending.length; i < len; i++) {\n\t\t\t\t\tconst candidate = pending[i];\n\t\t\t\t\tif (candidate.id === e.data.vscodeScheduleAsyncWork) {\n\t\t\t\t\t\tpending.splice(i, 1);\n\t\t\t\t\t\tcandidate.callback();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlet lastId = 0;\n\t\treturn (callback: () => void) => {\n\t\t\tconst myId = ++lastId;\n\t\t\tpending.push({\n\t\t\t\tid: myId,\n\t\t\t\tcallback: callback\n\t\t\t});\n\t\t\t$globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, '*');\n\t\t};\n\t}\n\treturn (callback: () => void) => setTimeout(callback);\n})();\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh || _isIOS ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian(): boolean {\n\tif (!_isLittleEndianComputed) {\n\t\t_isLittleEndianComputed = true;\n\t\tconst test = new Uint8Array(2);\n\t\ttest[0] = 1;\n\t\ttest[1] = 2;\n\t\tconst view = new Uint16Array(test.buffer);\n\t\t_isLittleEndian = (view[0] === (2 << 8) + 1);\n\t}\n\treturn _isLittleEndian;\n}\n\nexport const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0);\nexport const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0);\nexport const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0));\nexport const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0);\nexport const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);\nexport const hasElectronUserAgent = !!(userAgent && userAgent.indexOf('Electron') >= 0);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as nls from '../../nls.js';\n\nexport const LANGUAGE_DEFAULT = 'en';\n\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isElectron = false;\nlet _isIOS = false;\nlet _isCI = false;\nlet _isMobile = false;\nlet _locale: string | undefined = undefined;\nlet _language: string = LANGUAGE_DEFAULT;\nlet _platformLocale: string = LANGUAGE_DEFAULT;\nlet _translationsConfigFile: string | undefined = undefined;\nlet _userAgent: string | undefined = undefined;\n\nexport interface IProcessEnvironment {\n\t[key: string]: string | undefined;\n}\n\n/**\n * This interface is intentionally not identical to node.js\n * process because it also works in sandboxed environments\n * where the process object is implemented differently. We\n * define the properties here that we need for `platform`\n * to work and nothing else.\n */\nexport interface INodeProcess {\n\tplatform: string;\n\tarch: string;\n\tenv: IProcessEnvironment;\n\tversions?: {\n\t\tnode?: string;\n\t\telectron?: string;\n\t\tchrome?: string;\n\t};\n\ttype?: string;\n\tcwd: () => string;\n}\n\ndeclare const process: INodeProcess;\n\nconst $globalThis: any = globalThis;\n\nlet nodeProcess: INodeProcess | undefined = undefined;\nif (typeof $globalThis.vscode !== 'undefined' && typeof $globalThis.vscode.process !== 'undefined') {\n\t// Native environment (sandboxed)\n\tnodeProcess = $globalThis.vscode.process;\n} else if (typeof process !== 'undefined' && typeof process?.versions?.node === 'string') {\n\t// Native environment (non-sandboxed)\n\tnodeProcess = process;\n}\n\nconst isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';\nconst isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';\n\ninterface INavigator {\n\tuserAgent: string;\n\tmaxTouchPoints?: number;\n\tlanguage: string;\n}\ndeclare const navigator: INavigator;\n\n// Native environment\nif (typeof nodeProcess === 'object') {\n\t_isWindows = (nodeProcess.platform === 'win32');\n\t_isMacintosh = (nodeProcess.platform === 'darwin');\n\t_isLinux = (nodeProcess.platform === 'linux');\n\t_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\n\t_isElectron = isElectronProcess;\n\t_isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] || !!nodeProcess.env['GITHUB_WORKSPACE'];\n\t_locale = LANGUAGE_DEFAULT;\n\t_language = LANGUAGE_DEFAULT;\n\tconst rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\n\tif (rawNlsConfig) {\n\t\ttry {\n\t\t\tconst nlsConfig: nls.INLSConfiguration = JSON.parse(rawNlsConfig);\n\t\t\t_locale = nlsConfig.userLocale;\n\t\t\t_platformLocale = nlsConfig.osLocale;\n\t\t\t_language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;\n\t\t\t_translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;\n\t\t} catch (e) {\n\t\t}\n\t}\n\t_isNative = true;\n}\n\n// Web environment\nelse if (typeof navigator === 'object' && !isElectronRenderer) {\n\t_userAgent = navigator.userAgent;\n\t_isWindows = _userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n\t_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n\t_isLinux = _userAgent.indexOf('Linux') >= 0;\n\t_isMobile = _userAgent?.indexOf('Mobi') >= 0;\n\t_isWeb = true;\n\t_language = nls.getNLSLanguage() || LANGUAGE_DEFAULT;\n\t_locale = navigator.language.toLowerCase();\n\t_platformLocale = _locale;\n}\n\n// Unknown environment\nelse {\n\tconsole.error('Unable to resolve platform.');\n}\n\nexport const enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isMacintosh) {\n\t_platform = Platform.Mac;\n} else if (_isWindows) {\n\t_platform = Platform.Windows;\n} else if (_isLinux) {\n\t_platform = Platform.Linux;\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isElectron = _isElectron;\nexport const isWeb = _isWeb;\nexport const isWebWorker = (_isWeb && typeof $globalThis.importScripts === 'function');\nexport const webWorkerOrigin = isWebWorker ? $globalThis.origin : undefined;\nexport const isIOS = _isIOS;\nexport const isMobile = _isMobile;\nexport const platform = _platform;\nexport const userAgent = _userAgent;\n\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese or de for German)\n */\nexport const language = _language;\n\nexport const setTimeout0IsFaster = (typeof $globalThis.postMessage === 'function' && !$globalThis.importScripts);\n\n/**\n * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.\n *\n * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay\n * that browsers set when the nesting level is > 5.\n */\nexport const setTimeout0 = (() => {\n\tif (setTimeout0IsFaster) {\n\t\tinterface IQueueElement {\n\t\t\tid: number;\n\t\t\tcallback: () => void;\n\t\t}\n\t\tconst pending: IQueueElement[] = [];\n\n\t\t$globalThis.addEventListener('message', (e: any) => {\n\t\t\tif (e.data && e.data.vscodeScheduleAsyncWork) {\n\t\t\t\tfor (let i = 0, len = pending.length; i < len; i++) {\n\t\t\t\t\tconst candidate = pending[i];\n\t\t\t\t\tif (candidate.id === e.data.vscodeScheduleAsyncWork) {\n\t\t\t\t\t\tpending.splice(i, 1);\n\t\t\t\t\t\tcandidate.callback();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlet lastId = 0;\n\t\treturn (callback: () => void) => {\n\t\t\tconst myId = ++lastId;\n\t\t\tpending.push({\n\t\t\t\tid: myId,\n\t\t\t\tcallback: callback\n\t\t\t});\n\t\t\t$globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, '*');\n\t\t};\n\t}\n\treturn (callback: () => void) => setTimeout(callback);\n})();\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh || _isIOS ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian(): boolean {\n\tif (!_isLittleEndianComputed) {\n\t\t_isLittleEndianComputed = true;\n\t\tconst test = new Uint8Array(2);\n\t\ttest[0] = 1;\n\t\ttest[1] = 2;\n\t\tconst view = new Uint16Array(test.buffer);\n\t\t_isLittleEndian = (view[0] === (2 << 8) + 1);\n\t}\n\treturn _isLittleEndian;\n}\n\nexport const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0);\nexport const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0);\nexport const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0));\nexport const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0);\nexport const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);\nexport const hasElectronUserAgent = !!(userAgent && userAgent.indexOf('Electron') >= 0);\n"]}
@@ -1,2 +1,41 @@
1
- export {};
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { localize } from '../../nls.js';
6
+ export var PolicyCategory;
7
+ (function (PolicyCategory) {
8
+ PolicyCategory["Extensions"] = "Extensions";
9
+ PolicyCategory["IntegratedTerminal"] = "IntegratedTerminal";
10
+ PolicyCategory["InteractiveSession"] = "InteractiveSession";
11
+ PolicyCategory["Telemetry"] = "Telemetry";
12
+ PolicyCategory["Update"] = "Update";
13
+ })(PolicyCategory || (PolicyCategory = {}));
14
+ export const PolicyCategoryData = {
15
+ [PolicyCategory.Extensions]: {
16
+ name: {
17
+ key: 'extensionsConfigurationTitle', value: localize(55, "Extensions"),
18
+ }
19
+ },
20
+ [PolicyCategory.IntegratedTerminal]: {
21
+ name: {
22
+ key: 'terminalIntegratedConfigurationTitle', value: localize(56, "Integrated Terminal"),
23
+ }
24
+ },
25
+ [PolicyCategory.InteractiveSession]: {
26
+ name: {
27
+ key: 'interactiveSessionConfigurationTitle', value: localize(57, "Chat"),
28
+ }
29
+ },
30
+ [PolicyCategory.Telemetry]: {
31
+ name: {
32
+ key: 'telemetryConfigurationTitle', value: localize(58, "Telemetry"),
33
+ }
34
+ },
35
+ [PolicyCategory.Update]: {
36
+ name: {
37
+ key: 'updateConfigurationTitle', value: localize(59, "Update"),
38
+ }
39
+ }
40
+ };
2
41
  //# sourceMappingURL=policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sources":["vs/base/common/policy.ts"],"names":[],"mappings":"","sourcesContent":["\n\nexport type PolicyName = string;\n\nexport interface IPolicy {\n\n\t/**\n\t * The policy name.\n\t */\n\treadonly name: PolicyName;\n}\n"]}
1
+ {"version":3,"sources":["vs/base/common/policy.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQxC,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACzB,2CAAyB,CAAA;IACzB,2DAAyC,CAAA;IACzC,2DAAyC,CAAA;IACzC,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;AAClB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,MAAM,CAAC,MAAM,kBAAkB,GAE3B;IACH,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;QAC5B,IAAI,EAAE;YACL,GAAG,EAAE,8BAA8B,EAAE,KAAK,EAAE,QAAQ,CAAC,EAA8B,EAAE,YAAY,CAAC;SAClG;KACD;IACD,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE;QACpC,IAAI,EAAE;YACL,GAAG,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAsC,EAAE,qBAAqB,CAAC;SAC3H;KACD;IACD,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE;QACpC,IAAI,EAAE;YACL,GAAG,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAsC,EAAE,MAAM,CAAC;SAC5G;KACD;IACD,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;QAC3B,IAAI,EAAE;YACL,GAAG,EAAE,6BAA6B,EAAE,KAAK,EAAE,QAAQ,CAAC,EAA6B,EAAE,WAAW,CAAC;SAC/F;KACD;IACD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACxB,IAAI,EAAE;YACL,GAAG,EAAE,0BAA0B,EAAE,KAAK,EAAE,QAAQ,CAAC,EAA0B,EAAE,QAAQ,CAAC;SACtF;KACD;CACD,CAAC","file":"policy.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 { localize } from '../../nls.js';\n\nexport type PolicyName = string;\nexport type LocalizedValue = {\n\tkey: string;\n\tvalue: string;\n};\n\nexport enum PolicyCategory {\n\tExtensions = 'Extensions',\n\tIntegratedTerminal = 'IntegratedTerminal',\n\tInteractiveSession = 'InteractiveSession',\n\tTelemetry = 'Telemetry',\n\tUpdate = 'Update',\n}\n\nexport const PolicyCategoryData: {\n\t[key in PolicyCategory]: { name: LocalizedValue }\n} = {\n\t[PolicyCategory.Extensions]: {\n\t\tname: {\n\t\t\tkey: 'extensionsConfigurationTitle', value: localize('extensionsConfigurationTitle', \"Extensions\"),\n\t\t}\n\t},\n\t[PolicyCategory.IntegratedTerminal]: {\n\t\tname: {\n\t\t\tkey: 'terminalIntegratedConfigurationTitle', value: localize('terminalIntegratedConfigurationTitle', \"Integrated Terminal\"),\n\t\t}\n\t},\n\t[PolicyCategory.InteractiveSession]: {\n\t\tname: {\n\t\t\tkey: 'interactiveSessionConfigurationTitle', value: localize('interactiveSessionConfigurationTitle', \"Chat\"),\n\t\t}\n\t},\n\t[PolicyCategory.Telemetry]: {\n\t\tname: {\n\t\t\tkey: 'telemetryConfigurationTitle', value: localize('telemetryConfigurationTitle', \"Telemetry\"),\n\t\t}\n\t},\n\t[PolicyCategory.Update]: {\n\t\tname: {\n\t\t\tkey: 'updateConfigurationTitle', value: localize('updateConfigurationTitle', \"Update\"),\n\t\t}\n\t}\n};\n\nexport interface IPolicy {\n\n\t/**\n\t * The policy name.\n\t */\n\treadonly name: PolicyName;\n}\n"]}
@@ -0,0 +1,157 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { mapFilter } from './arrays.js';
6
+ export class ValidatorBase {
7
+ validateOrThrow(content) {
8
+ const result = this.validate(content);
9
+ if (result.error) {
10
+ throw new Error(result.error.message);
11
+ }
12
+ return result.content;
13
+ }
14
+ }
15
+ class TypeofValidator extends ValidatorBase {
16
+ constructor(type) {
17
+ super();
18
+ this.type = type;
19
+ }
20
+ validate(content) {
21
+ if (typeof content !== this.type) {
22
+ return { content: undefined, error: { message: `Expected ${this.type}, but got ${typeof content}` } };
23
+ }
24
+ return { content: content, error: undefined };
25
+ }
26
+ getJSONSchema() {
27
+ return { type: this.type };
28
+ }
29
+ }
30
+ const vStringValidator = new TypeofValidator('string');
31
+ export function vString() { return vStringValidator; }
32
+ const vNumberValidator = new TypeofValidator('number');
33
+ const vBooleanValidator = new TypeofValidator('boolean');
34
+ export function vBoolean() { return vBooleanValidator; }
35
+ const vObjAnyValidator = new TypeofValidator('object');
36
+ class UndefinedValidator extends ValidatorBase {
37
+ validate(content) {
38
+ if (content !== undefined) {
39
+ return { content: undefined, error: { message: `Expected undefined, but got ${typeof content}` } };
40
+ }
41
+ return { content: undefined, error: undefined };
42
+ }
43
+ getJSONSchema() {
44
+ return {};
45
+ }
46
+ }
47
+ export function vUndefined() {
48
+ return new UndefinedValidator();
49
+ }
50
+ export class Optional {
51
+ constructor(validator) {
52
+ this.validator = validator;
53
+ }
54
+ }
55
+ export function vOptionalProp(validator) {
56
+ return new Optional(validator);
57
+ }
58
+ class ObjValidator extends ValidatorBase {
59
+ constructor(properties) {
60
+ super();
61
+ this.properties = properties;
62
+ }
63
+ validate(content) {
64
+ if (typeof content !== 'object' || content === null) {
65
+ return { content: undefined, error: { message: 'Expected object' } };
66
+ }
67
+ // eslint-disable-next-line local/code-no-dangerous-type-assertions
68
+ const result = {};
69
+ for (const key in this.properties) {
70
+ const prop = this.properties[key];
71
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
72
+ const fieldValue = content[key];
73
+ const isOptional = prop instanceof Optional;
74
+ const validator = isOptional ? prop.validator : prop;
75
+ if (isOptional && fieldValue === undefined) {
76
+ // Optional field not provided, skip validation
77
+ continue;
78
+ }
79
+ const { content: value, error } = validator.validate(fieldValue);
80
+ if (error) {
81
+ return { content: undefined, error: { message: `Error in property '${key}': ${error.message}` } };
82
+ }
83
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
84
+ result[key] = value;
85
+ }
86
+ return { content: result, error: undefined };
87
+ }
88
+ getJSONSchema() {
89
+ const requiredFields = [];
90
+ const schemaProperties = {};
91
+ for (const [key, prop] of Object.entries(this.properties)) {
92
+ const isOptional = prop instanceof Optional;
93
+ const validator = isOptional ? prop.validator : prop;
94
+ schemaProperties[key] = validator.getJSONSchema();
95
+ if (!isOptional) {
96
+ requiredFields.push(key);
97
+ }
98
+ }
99
+ const schema = {
100
+ type: 'object',
101
+ properties: schemaProperties,
102
+ ...(requiredFields.length > 0 ? { required: requiredFields } : {})
103
+ };
104
+ return schema;
105
+ }
106
+ }
107
+ export function vObj(properties) {
108
+ return new ObjValidator(properties);
109
+ }
110
+ class UnionValidator extends ValidatorBase {
111
+ constructor(validators) {
112
+ super();
113
+ this.validators = validators;
114
+ }
115
+ validate(content) {
116
+ let lastError;
117
+ for (const validator of this.validators) {
118
+ const { content: value, error } = validator.validate(content);
119
+ if (!error) {
120
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
121
+ return { content: value, error: undefined };
122
+ }
123
+ lastError = error;
124
+ }
125
+ return { content: undefined, error: lastError };
126
+ }
127
+ getJSONSchema() {
128
+ return {
129
+ oneOf: mapFilter(this.validators, validator => {
130
+ if (validator instanceof UndefinedValidator) {
131
+ return undefined;
132
+ }
133
+ return validator.getJSONSchema();
134
+ }),
135
+ };
136
+ }
137
+ }
138
+ export function vUnion(...validators) {
139
+ return new UnionValidator(validators);
140
+ }
141
+ class UseRefSchemaValidator extends ValidatorBase {
142
+ constructor(_ref, _validator) {
143
+ super();
144
+ this._ref = _ref;
145
+ this._validator = _validator;
146
+ }
147
+ validate(content) {
148
+ return this._validator.validate(content);
149
+ }
150
+ getJSONSchema() {
151
+ return { $ref: this._ref };
152
+ }
153
+ }
154
+ export function vWithJsonSchemaRef(ref, validator) {
155
+ return new UseRefSchemaValidator(ref, validator);
156
+ }
157
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/validation.ts","vs/base/common/validation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,MAAM,OAAgB,aAAa;IAKlC,eAAe,CAAC,OAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACvB,CAAC;CACD;AAgBD,MAAM,eAA8C,SAAQ,aAA8B;IACzF,YAA6B,IAAU;QACtC,KAAK,EAAE,CAAC;QADoB,SAAI,GAAJ,IAAI,CAAM;IAEvC,CAAC;IAED,QAAQ,CAAC,OAAgB;QACxB,IAAI,OAAO,OAAO,KAAK,IAAI,CAA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AE,SAAS,CAAC,CAAC;AAClD,CAAC","file":"validation.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 { mapFilter } from './arrays.js';\nimport { IJSONSchema } from './jsonSchema.js';\n\nexport interface IValidator<T> {\n\tvalidate(content: unknown): { content: T; error: undefined } | { content: undefined; error: ValidationError };\n\n\tgetJSONSchema(): IJSONSchema;\n}\n\nexport abstract class ValidatorBase<T> implements IValidator<T> {\n\tabstract validate(content: unknown): { content: T; error: undefined } | { content: undefined; error: ValidationError };\n\n\tabstract getJSONSchema(): IJSONSchema;\n\n\tvalidateOrThrow(content: unknown): T {\n\t\tconst result = this.validate(content);\n\t\tif (result.error) {\n\t\t\tthrow new Error(result.error.message);\n\t\t}\n\t\treturn result.content;\n\t}\n}\n\nexport type ValidatorType<T> = T extends IValidator<infer U> ? U : never;\n\nexport interface ValidationError {\n\tmessage: string;\n}\n\ntype TypeOfMap = {\n\tstring: string;\n\tnumber: number;\n\tboolean: boolean;\n\tobject: object;\n\tnull: null;\n};\n\nclass TypeofValidator<TKey extends keyof TypeOfMap> extends ValidatorBase<TypeOfMap[TKey]> {\n\tconstructor(private readonly type: TKey) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: TypeOfMap[TKey]; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tif (typeof content !== this.type) {\n\t\t\treturn { content: undefined, error: { message: `Expected ${this.type}, but got ${typeof content}` } };\n\t\t}\n\n\t\treturn { content: content as TypeOfMap[TKey], error: undefined };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn { type: this.type };\n\t}\n}\n\nconst vStringValidator = new TypeofValidator('string');\nexport function vString(): ValidatorBase<string> { return vStringValidator; }\n\nconst vNumberValidator = new TypeofValidator('number');\n\nconst vBooleanValidator = new TypeofValidator('boolean');\nexport function vBoolean(): ValidatorBase<boolean> { return vBooleanValidator; }\n\nconst vObjAnyValidator = new TypeofValidator('object');\n\nclass UndefinedValidator extends ValidatorBase<undefined> {\n\tvalidate(content: unknown): { content: undefined; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tif (content !== undefined) {\n\t\t\treturn { content: undefined, error: { message: `Expected undefined, but got ${typeof content}` } };\n\t\t}\n\n\t\treturn { content: undefined, error: undefined };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn {};\n\t}\n}\n\nexport function vUndefined(): ValidatorBase<undefined> {\n\treturn new UndefinedValidator();\n}\n\nexport class Optional<T extends IValidator<unknown>> {\n\tconstructor(public readonly validator: T) { }\n}\n\nexport function vOptionalProp<T>(validator: IValidator<T>): Optional<IValidator<T>> {\n\treturn new Optional(validator);\n}\n\ntype ExtractOptionalKeys<T> = {\n\t[K in keyof T]: T[K] extends Optional<IValidator<unknown>> ? K : never;\n}[keyof T];\n\ntype ExtractRequiredKeys<T> = {\n\t[K in keyof T]: T[K] extends Optional<IValidator<unknown>> ? never : K;\n}[keyof T];\n\nexport type vObjType<T extends Record<string, IValidator<unknown> | Optional<IValidator<unknown>>>> = {\n\t[K in ExtractRequiredKeys<T>]: T[K] extends IValidator<infer U> ? U : never;\n} & {\n\t[K in ExtractOptionalKeys<T>]?: T[K] extends Optional<IValidator<infer U>> ? U : never;\n};\n\nclass ObjValidator<T extends Record<string, IValidator<unknown> | Optional<IValidator<unknown>>>> extends ValidatorBase<vObjType<T>> {\n\tconstructor(private readonly properties: T) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: vObjType<T>; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tif (typeof content !== 'object' || content === null) {\n\t\t\treturn { content: undefined, error: { message: 'Expected object' } };\n\t\t}\n\n\t\t// eslint-disable-next-line local/code-no-dangerous-type-assertions\n\t\tconst result: vObjType<T> = {} as vObjType<T>;\n\n\t\tfor (const key in this.properties) {\n\t\t\tconst prop = this.properties[key];\n\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\tconst fieldValue = (content as any)[key];\n\n\t\t\tconst isOptional = prop instanceof Optional;\n\t\t\tconst validator: IValidator<unknown> = isOptional ? prop.validator : prop;\n\n\t\t\tif (isOptional && fieldValue === undefined) {\n\t\t\t\t// Optional field not provided, skip validation\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst { content: value, error } = validator.validate(fieldValue);\n\t\t\tif (error) {\n\t\t\t\treturn { content: undefined, error: { message: `Error in property '${key}': ${error.message}` } };\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t(result as any)[key] = value;\n\t\t}\n\n\t\treturn { content: result, error: undefined };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\tconst requiredFields: string[] = [];\n\t\tconst schemaProperties: Record<string, IJSONSchema> = {};\n\n\t\tfor (const [key, prop] of Object.entries(this.properties)) {\n\t\t\tconst isOptional = prop instanceof Optional;\n\t\t\tconst validator: IValidator<unknown> = isOptional ? prop.validator : prop;\n\t\t\tschemaProperties[key] = validator.getJSONSchema();\n\t\t\tif (!isOptional) {\n\t\t\t\trequiredFields.push(key);\n\t\t\t}\n\t\t}\n\n\t\tconst schema: IJSONSchema = {\n\t\t\ttype: 'object',\n\t\t\tproperties: schemaProperties,\n\t\t\t...(requiredFields.length > 0 ? { required: requiredFields } : {})\n\t\t};\n\n\t\treturn schema;\n\t}\n}\n\nexport function vObj<T extends Record<string, IValidator<unknown> | Optional<IValidator<unknown>>>>(properties: T): ValidatorBase<vObjType<T>> {\n\treturn new ObjValidator(properties);\n}\n\nclass UnionValidator<T extends IValidator<unknown>[]> extends ValidatorBase<ValidatorType<T[number]>> {\n\tconstructor(private readonly validators: T) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: ValidatorType<T[number]>; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tlet lastError: ValidationError | undefined;\n\t\tfor (const validator of this.validators) {\n\t\t\tconst { content: value, error } = validator.validate(content);\n\t\t\tif (!error) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\treturn { content: value as any, error: undefined };\n\t\t\t}\n\n\t\t\tlastError = error;\n\t\t}\n\n\t\treturn { content: undefined, error: lastError! };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn {\n\t\t\toneOf: mapFilter(this.validators, validator => {\n\t\t\t\tif (validator instanceof UndefinedValidator) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn validator.getJSONSchema();\n\t\t\t}),\n\t\t};\n\t}\n}\n\nexport function vUnion<T extends IValidator<unknown>[]>(...validators: T): ValidatorBase<ValidatorType<T[number]>> {\n\treturn new UnionValidator(validators);\n}\n\nclass UseRefSchemaValidator<T> extends ValidatorBase<T> {\n\tconstructor(\n\t\tprivate readonly _ref: string,\n\t\tprivate readonly _validator: IValidator<T>\n\t) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: T; error: undefined } | { content: undefined; error: ValidationError } {\n\t\treturn this._validator.validate(content);\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn { $ref: this._ref };\n\t}\n}\n\nexport function vWithJsonSchemaRef<T>(ref: string, validator: IValidator<T>): ValidatorBase<T> {\n\treturn new UseRefSchemaValidator(ref, validator);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { mapFilter } from './arrays.js';\nimport { IJSONSchema } from './jsonSchema.js';\n\nexport interface IValidator<T> {\n\tvalidate(content: unknown): { content: T; error: undefined } | { content: undefined; error: ValidationError };\n\n\tgetJSONSchema(): IJSONSchema;\n}\n\nexport abstract class ValidatorBase<T> implements IValidator<T> {\n\tabstract validate(content: unknown): { content: T; error: undefined } | { content: undefined; error: ValidationError };\n\n\tabstract getJSONSchema(): IJSONSchema;\n\n\tvalidateOrThrow(content: unknown): T {\n\t\tconst result = this.validate(content);\n\t\tif (result.error) {\n\t\t\tthrow new Error(result.error.message);\n\t\t}\n\t\treturn result.content;\n\t}\n}\n\nexport type ValidatorType<T> = T extends IValidator<infer U> ? U : never;\n\nexport interface ValidationError {\n\tmessage: string;\n}\n\ntype TypeOfMap = {\n\tstring: string;\n\tnumber: number;\n\tboolean: boolean;\n\tobject: object;\n\tnull: null;\n};\n\nclass TypeofValidator<TKey extends keyof TypeOfMap> extends ValidatorBase<TypeOfMap[TKey]> {\n\tconstructor(private readonly type: TKey) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: TypeOfMap[TKey]; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tif (typeof content !== this.type) {\n\t\t\treturn { content: undefined, error: { message: `Expected ${this.type}, but got ${typeof content}` } };\n\t\t}\n\n\t\treturn { content: content as TypeOfMap[TKey], error: undefined };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn { type: this.type };\n\t}\n}\n\nconst vStringValidator = new TypeofValidator('string');\nexport function vString(): ValidatorBase<string> { return vStringValidator; }\n\nconst vNumberValidator = new TypeofValidator('number');\n\nconst vBooleanValidator = new TypeofValidator('boolean');\nexport function vBoolean(): ValidatorBase<boolean> { return vBooleanValidator; }\n\nconst vObjAnyValidator = new TypeofValidator('object');\n\nclass UndefinedValidator extends ValidatorBase<undefined> {\n\tvalidate(content: unknown): { content: undefined; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tif (content !== undefined) {\n\t\t\treturn { content: undefined, error: { message: `Expected undefined, but got ${typeof content}` } };\n\t\t}\n\n\t\treturn { content: undefined, error: undefined };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn {};\n\t}\n}\n\nexport function vUndefined(): ValidatorBase<undefined> {\n\treturn new UndefinedValidator();\n}\n\nexport class Optional<T extends IValidator<unknown>> {\n\tconstructor(public readonly validator: T) { }\n}\n\nexport function vOptionalProp<T>(validator: IValidator<T>): Optional<IValidator<T>> {\n\treturn new Optional(validator);\n}\n\ntype ExtractOptionalKeys<T> = {\n\t[K in keyof T]: T[K] extends Optional<IValidator<unknown>> ? K : never;\n}[keyof T];\n\ntype ExtractRequiredKeys<T> = {\n\t[K in keyof T]: T[K] extends Optional<IValidator<unknown>> ? never : K;\n}[keyof T];\n\nexport type vObjType<T extends Record<string, IValidator<unknown> | Optional<IValidator<unknown>>>> = {\n\t[K in ExtractRequiredKeys<T>]: T[K] extends IValidator<infer U> ? U : never;\n} & {\n\t[K in ExtractOptionalKeys<T>]?: T[K] extends Optional<IValidator<infer U>> ? U : never;\n};\n\nclass ObjValidator<T extends Record<string, IValidator<unknown> | Optional<IValidator<unknown>>>> extends ValidatorBase<vObjType<T>> {\n\tconstructor(private readonly properties: T) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: vObjType<T>; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tif (typeof content !== 'object' || content === null) {\n\t\t\treturn { content: undefined, error: { message: 'Expected object' } };\n\t\t}\n\n\t\t// eslint-disable-next-line local/code-no-dangerous-type-assertions\n\t\tconst result: vObjType<T> = {} as vObjType<T>;\n\n\t\tfor (const key in this.properties) {\n\t\t\tconst prop = this.properties[key];\n\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\tconst fieldValue = (content as any)[key];\n\n\t\t\tconst isOptional = prop instanceof Optional;\n\t\t\tconst validator: IValidator<unknown> = isOptional ? prop.validator : prop;\n\n\t\t\tif (isOptional && fieldValue === undefined) {\n\t\t\t\t// Optional field not provided, skip validation\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst { content: value, error } = validator.validate(fieldValue);\n\t\t\tif (error) {\n\t\t\t\treturn { content: undefined, error: { message: `Error in property '${key}': ${error.message}` } };\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t(result as any)[key] = value;\n\t\t}\n\n\t\treturn { content: result, error: undefined };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\tconst requiredFields: string[] = [];\n\t\tconst schemaProperties: Record<string, IJSONSchema> = {};\n\n\t\tfor (const [key, prop] of Object.entries(this.properties)) {\n\t\t\tconst isOptional = prop instanceof Optional;\n\t\t\tconst validator: IValidator<unknown> = isOptional ? prop.validator : prop;\n\t\t\tschemaProperties[key] = validator.getJSONSchema();\n\t\t\tif (!isOptional) {\n\t\t\t\trequiredFields.push(key);\n\t\t\t}\n\t\t}\n\n\t\tconst schema: IJSONSchema = {\n\t\t\ttype: 'object',\n\t\t\tproperties: schemaProperties,\n\t\t\t...(requiredFields.length > 0 ? { required: requiredFields } : {})\n\t\t};\n\n\t\treturn schema;\n\t}\n}\n\nexport function vObj<T extends Record<string, IValidator<unknown> | Optional<IValidator<unknown>>>>(properties: T): ValidatorBase<vObjType<T>> {\n\treturn new ObjValidator(properties);\n}\n\nclass UnionValidator<T extends IValidator<unknown>[]> extends ValidatorBase<ValidatorType<T[number]>> {\n\tconstructor(private readonly validators: T) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: ValidatorType<T[number]>; error: undefined } | { content: undefined; error: ValidationError } {\n\t\tlet lastError: ValidationError | undefined;\n\t\tfor (const validator of this.validators) {\n\t\t\tconst { content: value, error } = validator.validate(content);\n\t\t\tif (!error) {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\treturn { content: value as any, error: undefined };\n\t\t\t}\n\n\t\t\tlastError = error;\n\t\t}\n\n\t\treturn { content: undefined, error: lastError! };\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn {\n\t\t\toneOf: mapFilter(this.validators, validator => {\n\t\t\t\tif (validator instanceof UndefinedValidator) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn validator.getJSONSchema();\n\t\t\t}),\n\t\t};\n\t}\n}\n\nexport function vUnion<T extends IValidator<unknown>[]>(...validators: T): ValidatorBase<ValidatorType<T[number]>> {\n\treturn new UnionValidator(validators);\n}\n\nclass UseRefSchemaValidator<T> extends ValidatorBase<T> {\n\tconstructor(\n\t\tprivate readonly _ref: string,\n\t\tprivate readonly _validator: IValidator<T>\n\t) {\n\t\tsuper();\n\t}\n\n\tvalidate(content: unknown): { content: T; error: undefined } | { content: undefined; error: ValidationError } {\n\t\treturn this._validator.validate(content);\n\t}\n\n\tgetJSONSchema(): IJSONSchema {\n\t\treturn { $ref: this._ref };\n\t}\n}\n\nexport function vWithJsonSchemaRef<T>(ref: string, validator: IValidator<T>): ValidatorBase<T> {\n\treturn new UseRefSchemaValidator(ref, validator);\n}\n"]}
@@ -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(55, "editor"));
93
+ this._domNode.domNode.setAttribute('aria-roledescription', localize(60, "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(56, "The editor is not accessible at this time.");
80
+ const editorNotAccessibleMessage = nls.localize(61, "The editor is not accessible at this time.");
81
81
  if (toggleKeybindingLabel) {
82
- return nls.localize(57, "{0} To enable screen reader optimized mode, use {1}", editorNotAccessibleMessage, toggleKeybindingLabel);
82
+ return nls.localize(62, "{0} To enable screen reader optimized mode, use {1}", editorNotAccessibleMessage, toggleKeybindingLabel);
83
83
  }
84
84
  else if (runCommandKeybindingLabel) {
85
- return nls.localize(58, "{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);
85
+ return nls.localize(63, "{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(59, "{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);
88
+ return nls.localize(64, "{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
@@ -131,7 +131,7 @@ let TextAreaEditContext = class TextAreaEditContext extends AbstractEditContext
131
131
  this.textArea.setAttribute('aria-required', options.get(9 /* EditorOption.ariaRequired */) ? 'true' : 'false');
132
132
  this.textArea.setAttribute('tabindex', String(options.get(140 /* EditorOption.tabIndex */)));
133
133
  this.textArea.setAttribute('role', 'textbox');
134
- this.textArea.setAttribute('aria-roledescription', nls.localize(60, "editor"));
134
+ this.textArea.setAttribute('aria-roledescription', nls.localize(65, "editor"));
135
135
  this.textArea.setAttribute('aria-multiline', 'true');
136
136
  this.textArea.setAttribute('aria-autocomplete', options.get(104 /* EditorOption.readOnly */) ? 'none' : 'both');
137
137
  this._ensureReadOnlyAttribute();
@@ -860,7 +860,7 @@ export var CoreNavigationCommands;
860
860
  type: 'object',
861
861
  properties: {
862
862
  'sticky': {
863
- description: nls.localize(61, "Stick to the end even when going to longer lines"),
863
+ description: nls.localize(66, "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(62, "Stick to the end even when going to longer lines"),
891
+ description: nls.localize(67, "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(63, "Removed secondary cursors"));
1439
+ status(nls.localize(68, "Removed secondary cursors"));
1440
1440
  }
1441
1441
  });
1442
1442
  CoreNavigationCommands.RevealLine = registerEditorCommand(new class extends CoreEditorCommand {
@@ -412,17 +412,17 @@ export const UndoCommand = registerCommand(new MultiCommand({
412
412
  menuOpts: [{
413
413
  menuId: MenuId.MenubarEditMenu,
414
414
  group: '1_do',
415
- title: nls.localize(64, "&&Undo"),
415
+ title: nls.localize(69, "&&Undo"),
416
416
  order: 1
417
417
  }, {
418
418
  menuId: MenuId.CommandPalette,
419
419
  group: '',
420
- title: nls.localize(65, "Undo"),
420
+ title: nls.localize(70, "Undo"),
421
421
  order: 1
422
422
  }, {
423
423
  menuId: MenuId.SimpleEditorContext,
424
424
  group: '1_do',
425
- title: nls.localize(66, "Undo"),
425
+ title: nls.localize(71, "Undo"),
426
426
  order: 1
427
427
  }]
428
428
  }));
@@ -439,17 +439,17 @@ export const RedoCommand = registerCommand(new MultiCommand({
439
439
  menuOpts: [{
440
440
  menuId: MenuId.MenubarEditMenu,
441
441
  group: '1_do',
442
- title: nls.localize(67, "&&Redo"),
442
+ title: nls.localize(72, "&&Redo"),
443
443
  order: 2
444
444
  }, {
445
445
  menuId: MenuId.CommandPalette,
446
446
  group: '',
447
- title: nls.localize(68, "Redo"),
447
+ title: nls.localize(73, "Redo"),
448
448
  order: 1
449
449
  }, {
450
450
  menuId: MenuId.SimpleEditorContext,
451
451
  group: '1_do',
452
- title: nls.localize(69, "Redo"),
452
+ title: nls.localize(74, "Redo"),
453
453
  order: 2
454
454
  }]
455
455
  }));
@@ -465,17 +465,17 @@ export const SelectAllCommand = registerCommand(new MultiCommand({
465
465
  menuOpts: [{
466
466
  menuId: MenuId.MenubarSelectionMenu,
467
467
  group: '1_basic',
468
- title: nls.localize(70, "&&Select All"),
468
+ title: nls.localize(75, "&&Select All"),
469
469
  order: 1
470
470
  }, {
471
471
  menuId: MenuId.CommandPalette,
472
472
  group: '',
473
- title: nls.localize(71, "Select All"),
473
+ title: nls.localize(76, "Select All"),
474
474
  order: 1
475
475
  }, {
476
476
  menuId: MenuId.SimpleEditorContext,
477
477
  group: '9_select',
478
- title: nls.localize(72, "Select All"),
478
+ title: nls.localize(77, "Select All"),
479
479
  order: 1
480
480
  }]
481
481
  }));
@@ -83,7 +83,7 @@ let ViewGpuContext = class ViewGpuContext extends Disposable {
83
83
  if (!ViewGpuContext_1.device) {
84
84
  ViewGpuContext_1.device = GPULifecycle.requestDevice((message) => {
85
85
  const choices = [{
86
- label: nls.localize(73, "Use DOM-based rendering"),
86
+ label: nls.localize(78, "Use DOM-based rendering"),
87
87
  run: () => this.configurationService.updateValue('editor.experimentalGpuAcceleration', 'off'),
88
88
  }];
89
89
  this._notificationService.prompt(Severity.Warning, message, choices);
@@ -197,7 +197,7 @@ let HoverWidget = class HoverWidget extends Widget {
197
197
  if (options.appearance?.showHoverHint) {
198
198
  const statusBarElement = $('div.hover-row.status-bar');
199
199
  const infoElement = $('div.info');
200
- infoElement.textContent = localize(74, 'Hold {0} key to mouse over', isMacintosh ? 'Option' : 'Alt');
200
+ infoElement.textContent = localize(79, 'Hold {0} key to mouse over', isMacintosh ? 'Option' : 'Alt');
201
201
  statusBarElement.appendChild(infoElement);
202
202
  this._hover.containerDomNode.appendChild(statusBarElement);
203
203
  }
@@ -47,7 +47,7 @@ export class ManagedHoverWidget {
47
47
  if (managedContent instanceof Promise) {
48
48
  // show 'Loading' if no hover is up yet
49
49
  if (!this._hoverWidget) {
50
- this.show(localize(75, "Loading..."), focus, options);
50
+ this.show(localize(80, "Loading..."), focus, options);
51
51
  }
52
52
  resolvedContent = await managedContent;
53
53
  }
@@ -24,7 +24,7 @@ import { IQuickInputService } from '../../../platform/quickinput/common/quickInp
24
24
  import { IStorageService } from '../../../platform/storage/common/storage.js';
25
25
  import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js';
26
26
  export const IInlineCompletionsService = createDecorator('IInlineCompletionsService');
27
- const InlineCompletionsSnoozing = new RawContextKey('inlineCompletions.snoozed', false, localize(76, "Whether inline completions are currently snoozed"));
27
+ const InlineCompletionsSnoozing = new RawContextKey('inlineCompletions.snoozed', false, localize(81, "Whether inline completions are currently snoozed"));
28
28
  let InlineCompletionsService = class InlineCompletionsService extends Disposable {
29
29
  get snoozeTimeLeft() {
30
30
  if (this._snoozeTimeEnd === undefined) {
@@ -111,7 +111,7 @@ export class SnoozeInlineCompletion extends Action2 {
111
111
  constructor() {
112
112
  super({
113
113
  id: SnoozeInlineCompletion.ID,
114
- title: localize2(78, "Snooze Inline Suggestions"),
114
+ title: localize2(83, "Snooze Inline Suggestions"),
115
115
  precondition: ContextKeyExpr.true(),
116
116
  f1: true,
117
117
  });
@@ -142,7 +142,7 @@ export class SnoozeInlineCompletion extends Action2 {
142
142
  { label: '60 minutes', id: '60', value: 3_600_000 }
143
143
  ];
144
144
  const picked = await quickInputService.pick(items, {
145
- placeHolder: localize(77, "Select snooze duration for Code completions and NES"),
145
+ placeHolder: localize(82, "Select snooze duration for Inline Suggestions"),
146
146
  activeItem: items.find(item => item.value === lastSelectedDuration),
147
147
  });
148
148
  if (picked) {
@@ -157,7 +157,7 @@ export class CancelSnoozeInlineCompletion extends Action2 {
157
157
  constructor() {
158
158
  super({
159
159
  id: CancelSnoozeInlineCompletion.ID,
160
- title: localize2(79, "Cancel Snooze Inline Suggestions"),
160
+ title: localize2(84, "Cancel Snooze Inline Suggestions"),
161
161
  precondition: InlineCompletionsSnoozing,
162
162
  f1: true,
163
163
  });