@codingame/monaco-vscode-api 26.2.2 → 27.0.0

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 (1080) hide show
  1. package/missing-services.js +385 -25
  2. package/package.json +9 -9
  3. package/service-override/tools/editor.d.ts +4 -2
  4. package/service-override/tools/editor.js +1 -0
  5. package/services.d.ts +16 -1
  6. package/services.js +21 -4
  7. package/vscode/product.json.js +1 -1
  8. package/vscode/src/vs/base/browser/dom.d.ts +0 -15
  9. package/vscode/src/vs/base/browser/dom.js +1 -28
  10. package/vscode/src/vs/base/browser/pixelRatio.js +4 -1
  11. package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +3 -3
  12. package/vscode/src/vs/base/browser/ui/animations/animations.d.ts +40 -0
  13. package/vscode/src/vs/base/browser/ui/animations/animations.js +373 -0
  14. package/vscode/src/vs/base/browser/ui/button/button.js +11 -4
  15. package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  16. package/vscode/src/vs/base/browser/ui/contextview/contextview.d.ts +3 -42
  17. package/vscode/src/vs/base/browser/ui/contextview/contextview.js +48 -126
  18. package/vscode/src/vs/base/browser/ui/dialog/dialog.d.ts +1 -0
  19. package/vscode/src/vs/base/browser/ui/dialog/dialog.js +2 -0
  20. package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +2 -1
  21. package/vscode/src/vs/base/browser/ui/grid/grid.d.ts +2 -1
  22. package/vscode/src/vs/base/browser/ui/grid/grid.js +2 -2
  23. package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -1
  24. package/vscode/src/vs/base/browser/ui/grid/gridview.js +6 -2
  25. package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +8 -3
  26. package/vscode/src/vs/base/browser/ui/list/listView.js +9 -2
  27. package/vscode/src/vs/base/browser/ui/menu/menu.d.ts +1 -1
  28. package/vscode/src/vs/base/browser/ui/menu/menu.js +3 -3
  29. package/vscode/src/vs/base/browser/ui/progressbar/progressbar.d.ts +1 -0
  30. package/vscode/src/vs/base/browser/ui/progressbar/progressbar.js +6 -0
  31. package/vscode/src/vs/base/browser/ui/selectBox/selectBox.css +2 -2
  32. package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.css +4 -4
  33. package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +3 -2
  34. package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
  35. package/vscode/src/vs/base/browser/ui/table/tableWidget.js +1 -1
  36. package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +1 -1
  37. package/vscode/src/vs/base/browser/ui/tree/abstractTree.d.ts +3 -0
  38. package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +24 -19
  39. package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +3 -1
  40. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +1 -1
  41. package/vscode/src/vs/base/common/actions.js +1 -1
  42. package/vscode/src/vs/base/common/codicons.d.ts +2 -0
  43. package/vscode/src/vs/base/common/codiconsLibrary.d.ts +2 -0
  44. package/vscode/src/vs/base/common/codiconsLibrary.js +2 -0
  45. package/vscode/src/vs/base/common/date.js +40 -40
  46. package/vscode/src/vs/base/common/defaultAccount.d.ts +5 -0
  47. package/vscode/src/vs/base/common/errorMessage.js +6 -6
  48. package/vscode/src/vs/base/common/jsonErrorMessages.js +9 -9
  49. package/vscode/src/vs/base/common/keyCodes.js +4 -2
  50. package/vscode/src/vs/base/common/keybindingLabels.js +20 -20
  51. package/vscode/src/vs/base/common/layout.d.ts +67 -0
  52. package/vscode/src/vs/base/common/layout.js +96 -0
  53. package/vscode/src/vs/base/common/lifecycle.d.ts +32 -0
  54. package/vscode/src/vs/base/common/lifecycle.js +58 -1
  55. package/vscode/src/vs/base/common/mime.js +7 -5
  56. package/vscode/src/vs/base/common/platform.d.ts +1 -0
  57. package/vscode/src/vs/base/common/product.d.ts +2 -0
  58. package/vscode/src/vs/base/common/strings.d.ts +0 -30
  59. package/vscode/src/vs/base/common/strings.js +0 -11
  60. package/vscode/src/vs/base/common/uri.js +5 -1
  61. package/vscode/src/vs/base/common/yaml.d.ts +29 -53
  62. package/vscode/src/vs/base/common/yaml.js +1119 -502
  63. package/vscode/src/vs/base/parts/ipc/common/ipc.js +1 -0
  64. package/vscode/src/vs/base/parts/ipc/common/ipc.net.js +2 -2
  65. package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
  66. package/vscode/src/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
  67. package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
  68. package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +1 -1
  69. package/vscode/src/vs/editor/browser/coreCommands.js +3 -3
  70. package/vscode/src/vs/editor/browser/editorExtensions.js +9 -9
  71. package/vscode/src/vs/editor/browser/gpu/renderStrategy/fullFileRenderStrategy.js +3 -0
  72. package/vscode/src/vs/editor/browser/gpu/renderStrategy/viewportRenderStrategy.js +3 -0
  73. package/vscode/src/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  74. package/vscode/src/vs/editor/browser/services/inlineCompletionsService.js +4 -4
  75. package/vscode/src/vs/editor/browser/view/viewController.js +29 -9
  76. package/vscode/src/vs/editor/browser/view.d.ts +3 -1
  77. package/vscode/src/vs/editor/browser/view.js +10 -7
  78. package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.d.ts +3 -1
  79. package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +8 -4
  80. package/vscode/src/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.d.ts +2 -1
  81. package/vscode/src/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget.js +4 -2
  82. package/vscode/src/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  83. package/vscode/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +12 -12
  84. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  85. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +4 -4
  86. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
  87. package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +1 -0
  88. package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
  89. package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +4 -4
  90. package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +1 -1
  91. package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  92. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  93. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +1 -1
  94. package/vscode/src/vs/editor/common/config/editorConfigurationSchema.js +50 -50
  95. package/vscode/src/vs/editor/common/config/editorOptions.d.ts +5 -3
  96. package/vscode/src/vs/editor/common/config/editorOptions.js +416 -383
  97. package/vscode/src/vs/editor/common/core/editorColorRegistry.js +72 -72
  98. package/vscode/src/vs/editor/common/core/edits/stringEdit.d.ts +5 -0
  99. package/vscode/src/vs/editor/common/core/edits/stringEdit.js +19 -21
  100. package/vscode/src/vs/editor/common/core/ranges/offsetRange.d.ts +4 -0
  101. package/vscode/src/vs/editor/common/editorContextKeys.d.ts +1 -0
  102. package/vscode/src/vs/editor/common/editorContextKeys.js +49 -48
  103. package/vscode/src/vs/editor/common/languageFeatureRegistry.d.ts +1 -0
  104. package/vscode/src/vs/editor/common/languageFeatureRegistry.js +8 -1
  105. package/vscode/src/vs/editor/common/languageSelector.d.ts +1 -0
  106. package/vscode/src/vs/editor/common/languageSelector.js +15 -1
  107. package/vscode/src/vs/editor/common/languages/modesRegistry.js +1 -1
  108. package/vscode/src/vs/editor/common/languages.d.ts +13 -0
  109. package/vscode/src/vs/editor/common/languages.js +56 -56
  110. package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js +1 -1
  111. package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js +1 -1
  112. package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js +1 -1
  113. package/vscode/src/vs/editor/common/model/editStack.js +1 -1
  114. package/vscode/src/vs/editor/common/model/prefixSumComputer.js +6 -1
  115. package/vscode/src/vs/editor/common/model/textModel.d.ts +9 -4
  116. package/vscode/src/vs/editor/common/model/textModel.js +99 -34
  117. package/vscode/src/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.d.ts +3 -2
  118. package/vscode/src/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +3 -0
  119. package/vscode/src/vs/editor/common/model/tokens/annotations.js +9 -1
  120. package/vscode/src/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +2 -2
  121. package/vscode/src/vs/editor/common/model.d.ts +2 -1
  122. package/vscode/src/vs/editor/common/standalone/standaloneEnums.d.ts +2 -1
  123. package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +1 -0
  124. package/vscode/src/vs/editor/common/standaloneStrings.d.ts +1 -0
  125. package/vscode/src/vs/editor/common/standaloneStrings.js +55 -49
  126. package/vscode/src/vs/editor/common/textModelEvents.d.ts +25 -5
  127. package/vscode/src/vs/editor/common/textModelEvents.js +13 -4
  128. package/vscode/src/vs/editor/common/viewLayout/lineHeights.d.ts +14 -4
  129. package/vscode/src/vs/editor/common/viewLayout/lineHeights.js +192 -91
  130. package/vscode/src/vs/editor/common/viewLayout/linesLayout.d.ts +3 -3
  131. package/vscode/src/vs/editor/common/viewLayout/linesLayout.js +11 -15
  132. package/vscode/src/vs/editor/common/viewLayout/viewLayout.d.ts +3 -3
  133. package/vscode/src/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  134. package/vscode/src/vs/editor/common/viewModel/inlineDecorations.d.ts +71 -7
  135. package/vscode/src/vs/editor/common/viewModel/inlineDecorations.js +180 -14
  136. package/vscode/src/vs/editor/common/viewModel/minimapTokensColorTracker.js +8 -2
  137. package/vscode/src/vs/editor/common/viewModel/modelLineProjection.d.ts +2 -2
  138. package/vscode/src/vs/editor/common/viewModel/modelLineProjection.js +31 -82
  139. package/vscode/src/vs/editor/common/viewModel/viewModelDecorations.d.ts +2 -23
  140. package/vscode/src/vs/editor/common/viewModel/viewModelDecorations.js +19 -114
  141. package/vscode/src/vs/editor/common/viewModel/viewModelImpl.d.ts +11 -0
  142. package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +174 -141
  143. package/vscode/src/vs/editor/common/viewModel/viewModelLines.d.ts +1 -0
  144. package/vscode/src/vs/editor/common/viewModel/viewModelLines.js +16 -3
  145. package/vscode/src/vs/editor/common/viewModel.d.ts +6 -3
  146. package/vscode/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  147. package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  148. package/vscode/src/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  149. package/vscode/src/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  150. package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  151. package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  152. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionCommands.js +19 -19
  153. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  154. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.d.ts +9 -1
  155. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +56 -13
  156. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  157. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.d.ts +2 -0
  158. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +23 -3
  159. package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.d.ts +2 -0
  160. package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +59 -52
  161. package/vscode/src/vs/editor/contrib/codelens/browser/codelensController.js +3 -2
  162. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerModel.d.ts +2 -1
  163. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerModel.js +6 -4
  164. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  165. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  166. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerSaturationBox.js +2 -2
  167. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerStrip.js +2 -2
  168. package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  169. package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  170. package/vscode/src/vs/editor/contrib/comment/browser/comment.js +6 -6
  171. package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  172. package/vscode/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  173. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  174. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  175. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +5 -5
  176. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  177. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  178. package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  179. package/vscode/src/vs/editor/contrib/find/browser/findController.d.ts +25 -1
  180. package/vscode/src/vs/editor/contrib/find/browser/findController.js +38 -20
  181. package/vscode/src/vs/editor/contrib/find/browser/findModel.d.ts +5 -0
  182. package/vscode/src/vs/editor/contrib/find/browser/findModel.js +2 -1
  183. package/vscode/src/vs/editor/contrib/find/browser/findWidget.d.ts +29 -1
  184. package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +101 -33
  185. package/vscode/src/vs/editor/contrib/folding/browser/folding.js +20 -20
  186. package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  187. package/vscode/src/vs/editor/contrib/folding/browser/foldingModel.d.ts +2 -1
  188. package/vscode/src/vs/editor/contrib/folding/browser/foldingModel.js +1 -0
  189. package/vscode/src/vs/editor/contrib/folding/browser/hiddenRangeModel.d.ts +2 -1
  190. package/vscode/src/vs/editor/contrib/folding/browser/hiddenRangeModel.js +1 -0
  191. package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  192. package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +2 -2
  193. package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  194. package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -13
  195. package/vscode/src/vs/editor/contrib/gotoError/browser/markerSelectionStatus.d.ts +1 -0
  196. package/vscode/src/vs/editor/contrib/gotoError/browser/markerSelectionStatus.js +60 -0
  197. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +33 -33
  198. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  199. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  200. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  201. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +4 -4
  202. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  203. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  204. package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  205. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +3 -3
  206. package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
  207. package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  208. package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +22 -22
  209. package/vscode/src/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  210. package/vscode/src/vs/editor/contrib/hover/browser/hoverUtils.js +8 -4
  211. package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +7 -7
  212. package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  213. package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  214. package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +18 -18
  215. package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +5 -5
  216. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  217. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/common.d.ts +4 -0
  218. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/common.js +11 -0
  219. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  220. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +4 -2
  221. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  222. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
  223. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.d.ts +6 -1
  224. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +41 -13
  225. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.d.ts +10 -3
  226. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +44 -9
  227. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.d.ts +18 -7
  228. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +79 -37
  229. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.d.ts +1 -0
  230. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +53 -1
  231. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +5 -3
  232. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/textModelValueReference.d.ts +30 -0
  233. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/textModelValueReference.js +65 -0
  234. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.d.ts +1 -1
  235. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +27 -20
  236. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.d.ts +9 -3
  237. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +30 -15
  238. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.d.ts +3 -3
  239. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +20 -7
  240. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +4 -5
  241. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.d.ts +3 -1
  242. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +6 -3
  243. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.d.ts +4 -2
  244. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +17 -9
  245. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.d.ts +7 -1
  246. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +74 -39
  247. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.d.ts +6 -0
  248. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +3 -2
  249. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  250. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +2 -2
  251. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +14 -0
  252. package/vscode/src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  253. package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  254. package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
  255. package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  256. package/vscode/src/vs/editor/contrib/links/browser/links.js +6 -6
  257. package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
  258. package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  259. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  260. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +1 -1
  261. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  262. package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +19 -18
  263. package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  264. package/vscode/src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +9 -1
  265. package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +20 -10
  266. package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  267. package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  268. package/vscode/src/vs/editor/contrib/rename/browser/rename.js +11 -11
  269. package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +8 -8
  270. package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  271. package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  272. package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  273. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  274. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.d.ts +1 -0
  275. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +5 -1
  276. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +5 -5
  277. package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  278. package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
  279. package/vscode/src/vs/editor/contrib/suggest/browser/suggestModel.js +3 -1
  280. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -17
  281. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +4 -2
  282. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  283. package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  284. package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.css +34 -34
  285. package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  286. package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  287. package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  288. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  289. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  290. package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  291. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  292. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  293. package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
  294. package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditor.d.ts +3 -2
  295. package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditor.js +10 -6
  296. package/vscode/src/vs/editor/standalone/browser/standaloneServices.d.ts +3 -3
  297. package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +68 -65
  298. package/vscode/src/vs/platform/accessibility/browser/accessibilityService.d.ts +7 -0
  299. package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +38 -4
  300. package/vscode/src/vs/platform/accessibility/browser/accessibleView.d.ts +7 -1
  301. package/vscode/src/vs/platform/accessibility/browser/accessibleView.js +6 -0
  302. package/vscode/src/vs/platform/accessibility/common/accessibility.service.d.ts +2 -0
  303. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  304. package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
  305. package/vscode/src/vs/platform/actionWidget/browser/actionList.d.ts +99 -4
  306. package/vscode/src/vs/platform/actionWidget/browser/actionList.js +530 -56
  307. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css +63 -13
  308. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.d.ts +6 -2
  309. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +133 -10
  310. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.service.d.ts +2 -2
  311. package/vscode/src/vs/platform/actions/browser/floatingMenu.js +1 -1
  312. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.d.ts +2 -0
  313. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -4
  314. package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
  315. package/vscode/src/vs/platform/actions/common/actions.d.ts +7 -1
  316. package/vscode/src/vs/platform/actions/common/actions.js +19 -2
  317. package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
  318. package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
  319. package/vscode/src/vs/platform/configuration/common/configurationRegistry.d.ts +11 -4
  320. package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +24 -12
  321. package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  322. package/vscode/src/vs/platform/contextkey/common/contextkey.js +26 -12
  323. package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
  324. package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
  325. package/vscode/src/vs/platform/contextview/browser/contextView.d.ts +2 -0
  326. package/vscode/src/vs/platform/contextview/browser/contextView.service.d.ts +2 -1
  327. package/vscode/src/vs/platform/defaultAccount/common/defaultAccount.d.ts +4 -1
  328. package/vscode/src/vs/platform/defaultAccount/common/defaultAccount.service.d.ts +4 -1
  329. package/vscode/src/vs/platform/dialogs/common/dialogs.js +9 -9
  330. package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
  331. package/vscode/src/vs/platform/editor/common/editor.d.ts +32 -0
  332. package/vscode/src/vs/platform/environment/common/argv.d.ts +1 -0
  333. package/vscode/src/vs/platform/environment/common/environment.service.d.ts +0 -1
  334. package/vscode/src/vs/platform/environment/common/environmentService.d.ts +0 -1
  335. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +1 -1
  336. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +14 -14
  337. package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
  338. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +7 -7
  339. package/vscode/src/vs/platform/extensions/common/extensionValidator.js +21 -21
  340. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -0
  341. package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.d.ts +12 -1
  342. package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +15 -4
  343. package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
  344. package/vscode/src/vs/platform/files/common/files.js +6 -6
  345. package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  346. package/vscode/src/vs/platform/hover/browser/hoverService.js +0 -1
  347. package/vscode/src/vs/platform/hover/browser/hoverWidget.js +3 -2
  348. package/vscode/src/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  349. package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  350. package/vscode/src/vs/platform/languagePacks/common/languagePacks.js +1 -1
  351. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +3 -3
  352. package/vscode/src/vs/platform/list/browser/listService.js +25 -25
  353. package/vscode/src/vs/platform/log/common/log.js +6 -6
  354. package/vscode/src/vs/platform/markers/common/markerService.js +2 -2
  355. package/vscode/src/vs/platform/markers/common/markers.js +6 -6
  356. package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.d.ts +42 -0
  357. package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.js +105 -0
  358. package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +130 -0
  359. package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +665 -0
  360. package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.d.ts +13 -0
  361. package/vscode/src/vs/platform/mcp/common/modelContextProtocol.d.ts +2917 -0
  362. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.config.contribution.d.ts +1 -0
  363. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.config.contribution.js +32 -0
  364. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.d.ts +44 -0
  365. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.js +62 -0
  366. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.service.d.ts +18 -0
  367. package/vscode/src/vs/platform/meteredConnection/common/meteredConnection.service.js +6 -0
  368. package/vscode/src/vs/platform/native/common/native.d.ts +43 -5
  369. package/vscode/src/vs/platform/notification/common/notification.js +3 -3
  370. package/vscode/src/vs/platform/observable/common/platformObservableUtils.js +10 -2
  371. package/vscode/src/vs/platform/product/common/product.js +3 -3
  372. package/vscode/src/vs/platform/quickinput/browser/media/quickInput.css +5 -0
  373. package/vscode/src/vs/platform/quickinput/browser/quickInput.js +10 -10
  374. package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  375. package/vscode/src/vs/platform/quickinput/browser/quickInputBox.d.ts +9 -0
  376. package/vscode/src/vs/platform/quickinput/browser/quickInputBox.js +15 -4
  377. package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +76 -12
  378. package/vscode/src/vs/platform/quickinput/browser/quickInputList.js +6 -6
  379. package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  380. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +2 -2
  381. package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  382. package/vscode/src/vs/platform/quickinput/browser/tree/quickInputTreeController.js +1 -1
  383. package/vscode/src/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  384. package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +14 -0
  385. package/vscode/src/vs/platform/remote/common/remoteHosts.d.ts +13 -0
  386. package/vscode/src/vs/platform/remote/common/remoteHosts.js +11 -1
  387. package/vscode/src/vs/platform/request/common/request.js +19 -19
  388. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +8 -2
  389. package/vscode/src/vs/platform/terminal/common/terminal.d.ts +12 -2
  390. package/vscode/src/vs/platform/terminal/common/terminal.js +1 -0
  391. package/vscode/src/vs/platform/terminal/common/terminal.service.d.ts +1 -1
  392. package/vscode/src/vs/platform/terminal/common/terminalPlatformConfiguration.js +31 -31
  393. package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +1 -1
  394. package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.d.ts +0 -13
  395. package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +2 -2
  396. package/vscode/src/vs/platform/theme/common/colorUtils.js +2 -2
  397. package/vscode/src/vs/platform/theme/common/colors/baseColors.js +18 -18
  398. package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
  399. package/vscode/src/vs/platform/theme/common/colors/editorColors.js +95 -95
  400. package/vscode/src/vs/platform/theme/common/colors/inputColors.js +51 -51
  401. package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
  402. package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
  403. package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
  404. package/vscode/src/vs/platform/theme/common/colors/miscColors.js +16 -16
  405. package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  406. package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
  407. package/vscode/src/vs/platform/theme/common/iconRegistry.js +6 -6
  408. package/vscode/src/vs/platform/theme/common/sizeRegistry.d.ts +2 -0
  409. package/vscode/src/vs/platform/theme/common/sizeUtils.d.ts +90 -0
  410. package/vscode/src/vs/platform/theme/common/sizeUtils.js +142 -0
  411. package/vscode/src/vs/platform/theme/common/sizes/baseSizes.d.ts +11 -0
  412. package/vscode/src/vs/platform/theme/common/sizes/baseSizes.js +18 -0
  413. package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +42 -42
  414. package/vscode/src/vs/platform/tunnel/common/tunnel.js +4 -3
  415. package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  416. package/vscode/src/vs/platform/update/common/update.d.ts +14 -6
  417. package/vscode/src/vs/platform/update/common/update.js +4 -3
  418. package/vscode/src/vs/platform/update/common/update.service.d.ts +5 -2
  419. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
  420. package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +2 -2
  421. package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +2 -2
  422. package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +1 -1
  423. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
  424. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +1 -1
  425. package/vscode/src/vs/platform/userInteraction/browser/userInteractionService.d.ts +25 -0
  426. package/vscode/src/vs/platform/userInteraction/browser/userInteractionService.service.d.ts +28 -0
  427. package/vscode/src/vs/platform/userInteraction/browser/userInteractionService.service.js +6 -0
  428. package/vscode/src/vs/platform/userInteraction/browser/userInteractionServiceImpl.d.ts +13 -0
  429. package/vscode/src/vs/platform/userInteraction/browser/userInteractionServiceImpl.js +62 -0
  430. package/vscode/src/vs/platform/window/common/window.d.ts +1 -0
  431. package/vscode/src/vs/platform/workspace/common/workspace.d.ts +1 -7
  432. package/vscode/src/vs/platform/workspace/common/workspace.js +3 -16
  433. package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.service.d.ts +47 -0
  434. package/vscode/src/vs/{workbench/services/layout/common/workbenchModeService.service.js → sessions/contrib/agentFeedback/browser/agentFeedbackService.service.js} +2 -2
  435. package/vscode/src/vs/sessions/contrib/chat/browser/sessionTargetPicker.d.ts +64 -0
  436. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.service.d.ts +37 -0
  437. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.service.js +6 -0
  438. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.service.d.ts +47 -0
  439. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.service.js +6 -0
  440. package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +12 -12
  441. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +121 -7
  442. package/vscode/src/vs/workbench/api/common/extHost.common.services.js +6 -0
  443. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +237 -11
  444. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +17 -3
  445. package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +6 -5
  446. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.d.ts +7 -2
  447. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +32 -5
  448. package/vscode/src/vs/workbench/api/common/extHostChatContext.js +34 -13
  449. package/vscode/src/vs/workbench/api/common/extHostChatDebug.d.ts +22 -0
  450. package/vscode/src/vs/workbench/api/common/extHostChatDebug.js +287 -0
  451. package/vscode/src/vs/workbench/api/common/extHostChatSessions.d.ts +4 -12
  452. package/vscode/src/vs/workbench/api/common/extHostChatSessions.js +158 -139
  453. package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -0
  454. package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
  455. package/vscode/src/vs/workbench/api/common/extHostDocuments.d.ts +1 -1
  456. package/vscode/src/vs/workbench/api/common/extHostDocuments.js +6 -6
  457. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +2 -2
  458. package/vscode/src/vs/workbench/api/common/extHostGitExtensionService.d.ts +31 -0
  459. package/vscode/src/vs/workbench/api/common/extHostGitExtensionService.js +167 -0
  460. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.d.ts +1 -0
  461. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +41 -3
  462. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +0 -3
  463. package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +4 -2
  464. package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
  465. package/vscode/src/vs/workbench/api/common/extHostMcp.d.ts +4 -0
  466. package/vscode/src/vs/workbench/api/common/extHostMcp.js +15 -1
  467. package/vscode/src/vs/workbench/api/common/extHostMeteredConnection.d.ts +19 -0
  468. package/vscode/src/vs/workbench/api/common/extHostMeteredConnection.js +28 -0
  469. package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
  470. package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +6 -3
  471. package/vscode/src/vs/workbench/api/common/extHostPower.d.ts +45 -0
  472. package/vscode/src/vs/workbench/api/common/extHostPower.js +88 -0
  473. package/vscode/src/vs/workbench/api/common/extHostSCM.js +3 -0
  474. package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +4 -2
  475. package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +2 -1
  476. package/vscode/src/vs/workbench/api/common/extHostTerminalService.d.ts +1 -1
  477. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +46 -12
  478. package/vscode/src/vs/workbench/api/common/extHostTerminalShellIntegration.js +3 -3
  479. package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +7 -7
  480. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +10 -22
  481. package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +3 -3
  482. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.d.ts +9 -3
  483. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +167 -14
  484. package/vscode/src/vs/workbench/api/common/extHostTypes.d.ts +158 -7
  485. package/vscode/src/vs/workbench/api/common/extHostTypes.js +132 -7
  486. package/vscode/src/vs/workbench/api/common/extHostWorkspace.d.ts +0 -1
  487. package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +3 -10
  488. package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +11 -11
  489. package/vscode/src/vs/workbench/browser/actions/developerActions.js +32 -32
  490. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +130 -130
  491. package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
  492. package/vscode/src/vs/workbench/browser/actions/windowActions.js +29 -29
  493. package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +21 -21
  494. package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
  495. package/vscode/src/vs/workbench/browser/contextkeys.d.ts +2 -8
  496. package/vscode/src/vs/workbench/browser/contextkeys.js +8 -26
  497. package/vscode/src/vs/workbench/browser/editor.js +2 -2
  498. package/vscode/src/vs/workbench/browser/labels.js +4 -4
  499. package/vscode/src/vs/workbench/browser/media/style.css +2 -1
  500. package/vscode/src/vs/workbench/browser/panecomposite.d.ts +1 -0
  501. package/vscode/src/vs/workbench/browser/panecomposite.js +3 -1
  502. package/vscode/src/vs/workbench/browser/part.d.ts +1 -1
  503. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.d.ts +15 -4
  504. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +112 -33
  505. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css +26 -6
  506. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css +1 -1
  507. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +44 -40
  508. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.d.ts +2 -0
  509. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +39 -6
  510. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +1 -1
  511. package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +13 -13
  512. package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +1 -1
  513. package/vscode/src/vs/workbench/browser/parts/compositePart.js +23 -17
  514. package/vscode/src/vs/workbench/browser/parts/dialogs/dialog.d.ts +11 -0
  515. package/vscode/src/vs/{platform/dialogs/browser → workbench/browser/parts/dialogs}/dialog.js +12 -10
  516. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.d.ts +1 -0
  517. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +19 -7
  518. package/vscode/src/vs/workbench/browser/parts/editor/binaryDiffEditor.js +1 -1
  519. package/vscode/src/vs/workbench/browser/parts/editor/binaryEditor.js +3 -3
  520. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.js +37 -37
  521. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +12 -12
  522. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +1 -1
  523. package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +8 -10
  524. package/vscode/src/vs/workbench/browser/parts/editor/editor.d.ts +3 -2
  525. package/vscode/src/vs/workbench/browser/parts/editor/editor.js +2 -0
  526. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +135 -135
  527. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.d.ts +6 -0
  528. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +216 -20
  529. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.d.ts +3 -1
  530. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +14 -6
  531. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +7 -7
  532. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +13 -13
  533. package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +2 -2
  534. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.d.ts +5 -5
  535. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +10 -9
  536. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.d.ts +9 -2
  537. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +79 -22
  538. package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +10 -10
  539. package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +5 -5
  540. package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +66 -66
  541. package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +4 -3
  542. package/vscode/src/vs/workbench/browser/parts/editor/media/modalEditorPart.css +142 -0
  543. package/vscode/src/vs/workbench/browser/parts/editor/modalEditorPart.d.ts +65 -0
  544. package/vscode/src/vs/workbench/browser/parts/editor/modalEditorPart.js +407 -0
  545. package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +1 -1
  546. package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
  547. package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +1 -1
  548. package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -3
  549. package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +1 -1
  550. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +21 -20
  551. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css +9 -1
  552. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css +10 -0
  553. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css +14 -0
  554. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.d.ts +12 -1
  555. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +49 -18
  556. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +3 -3
  557. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.d.ts +10 -1
  558. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +87 -15
  559. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +92 -11
  560. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +6 -6
  561. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.d.ts +5 -1
  562. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +58 -25
  563. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.d.ts +8 -1
  564. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +62 -7
  565. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.d.ts +3 -1
  566. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +24 -8
  567. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.d.ts +3 -2
  568. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +9 -8
  569. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +13 -7
  570. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +89 -68
  571. package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +38 -50
  572. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +6 -4
  573. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -2
  574. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +2 -0
  575. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +44 -7
  576. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +21 -21
  577. package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarActions.js +23 -14
  578. package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +3 -3
  579. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +1 -1
  580. package/vscode/src/vs/workbench/browser/parts/views/media/paneviewlet.css +1 -1
  581. package/vscode/src/vs/workbench/browser/parts/views/media/views.css +33 -2
  582. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +8 -7
  583. package/vscode/src/vs/workbench/browser/parts/views/viewFilter.d.ts +19 -1
  584. package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +27 -4
  585. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +7 -5
  586. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +178 -174
  587. package/vscode/src/vs/workbench/browser/parts/visibleViewContainersTracker.d.ts +29 -0
  588. package/vscode/src/vs/workbench/browser/parts/visibleViewContainersTracker.js +104 -0
  589. package/vscode/src/vs/workbench/browser/quickaccess.js +1 -1
  590. package/vscode/src/vs/workbench/browser/window.js +14 -14
  591. package/vscode/src/vs/workbench/browser/workbench.contribution.js +317 -225
  592. package/vscode/src/vs/workbench/common/configuration.js +9 -9
  593. package/vscode/src/vs/workbench/common/contextkeys.d.ts +4 -2
  594. package/vscode/src/vs/workbench/common/contextkeys.js +78 -76
  595. package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +1 -1
  596. package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +1 -1
  597. package/vscode/src/vs/workbench/common/editor/textEditorModel.js +1 -1
  598. package/vscode/src/vs/workbench/common/editor.d.ts +1 -0
  599. package/vscode/src/vs/workbench/common/editor.js +4 -4
  600. package/vscode/src/vs/workbench/common/notifications.d.ts +11 -0
  601. package/vscode/src/vs/workbench/common/notifications.js +19 -1
  602. package/vscode/src/vs/workbench/common/theme.js +160 -160
  603. package/vscode/src/vs/workbench/common/views.d.ts +32 -5
  604. package/vscode/src/vs/workbench/common/views.js +16 -12
  605. package/vscode/src/vs/workbench/common/views.service.d.ts +1 -0
  606. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.d.ts +4 -2
  607. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +170 -152
  608. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
  609. package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +1 -0
  610. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.d.ts +39 -0
  611. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +498 -77
  612. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +4 -1
  613. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +26 -15
  614. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +7 -2
  615. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +37 -17
  616. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service.d.ts +1 -0
  617. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service.d.ts +19 -0
  618. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service.js +6 -0
  619. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +44 -0
  620. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +243 -0
  621. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatScreenshotContext.js +1 -1
  622. package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +42 -0
  623. package/vscode/src/vs/workbench/contrib/chat/browser/chat.service.d.ts +9 -0
  624. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +7 -7
  625. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.service.d.ts +55 -7
  626. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileRewriter.js +2 -2
  627. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.js +15 -14
  628. package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.d.ts +20 -0
  629. package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.js +118 -65
  630. package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service.d.ts +40 -0
  631. package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service.js +6 -0
  632. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +32 -4
  633. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.js +3 -3
  634. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +71 -0
  635. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.js +6 -0
  636. package/vscode/src/vs/workbench/contrib/chat/common/chatModes.d.ts +8 -0
  637. package/vscode/src/vs/workbench/contrib/chat/common/chatModes.js +38 -11
  638. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +122 -4
  639. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.js +4 -2
  640. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.service.d.ts +27 -12
  641. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.d.ts +10 -5
  642. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.service.d.ts +34 -11
  643. package/vscode/src/vs/workbench/contrib/chat/common/constants.d.ts +19 -5
  644. package/vscode/src/vs/workbench/contrib/chat/common/constants.js +19 -4
  645. package/vscode/src/vs/workbench/contrib/chat/common/contextContrib/chatContext.d.ts +3 -2
  646. package/vscode/src/vs/workbench/contrib/chat/common/editing/chatEditingService.js +2 -2
  647. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +3 -3
  648. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.d.ts +49 -3
  649. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +253 -32
  650. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.service.d.ts +32 -2
  651. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.d.ts +11 -5
  652. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.js +94 -12
  653. package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatQuestionCarouselData.d.ts +20 -0
  654. package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatQuestionCarouselData.js +26 -0
  655. package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.d.ts +71 -0
  656. package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +298 -0
  657. package/vscode/src/vs/workbench/contrib/chat/common/model/chatUri.d.ts +1 -0
  658. package/vscode/src/vs/workbench/contrib/chat/common/model/chatUri.js +5 -0
  659. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatAgents.d.ts +7 -30
  660. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatAgents.js +10 -73
  661. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatAgents.service.d.ts +1 -1
  662. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +23 -0
  663. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +29 -0
  664. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.js +6 -0
  665. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +10 -0
  666. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.js +6 -0
  667. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +24 -0
  668. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.js +6 -0
  669. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +11 -0
  670. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.js +6 -0
  671. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +7 -1
  672. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +35 -20
  673. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations.d.ts +2 -1
  674. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations.js +11 -1
  675. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.d.ts +10 -0
  676. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.js +190 -89
  677. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.d.ts +14 -28
  678. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.js +95 -98
  679. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +52 -8
  680. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +2 -1
  681. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service.d.ts +22 -7
  682. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptEditHelper.d.ts +2 -2
  683. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptEditHelper.js +1 -1
  684. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +2 -1
  685. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +3 -1
  686. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +47 -0
  687. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +478 -0
  688. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +3 -0
  689. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +40 -2
  690. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +9 -9
  691. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -5
  692. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +19 -26
  693. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +8 -1
  694. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.service.d.ts +1 -0
  695. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.d.ts +2 -0
  696. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +45 -25
  697. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.d.ts +9 -11
  698. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.js +4 -4
  699. package/vscode/src/vs/workbench/contrib/chat/common/tools/promptTsxTypes.d.ts +3 -0
  700. package/vscode/src/vs/workbench/contrib/chat/common/tools/promptTsxTypes.js +12 -1
  701. package/vscode/src/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget.js +1 -1
  702. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +11 -11
  703. package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
  704. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
  705. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
  706. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.d.ts +19 -1
  707. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +35 -11
  708. package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +2 -2
  709. package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
  710. package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.d.ts +1 -3
  711. package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +9 -11
  712. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
  713. package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +2 -2
  714. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
  715. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +3 -3
  716. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
  717. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
  718. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +6 -6
  719. package/vscode/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.js +65 -65
  720. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +7 -7
  721. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +7 -7
  722. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +5 -4
  723. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +3 -3
  724. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +4 -4
  725. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +3 -3
  726. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +4 -4
  727. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +7 -4
  728. package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
  729. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.d.ts +2 -2
  730. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +30 -28
  731. package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
  732. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +9 -9
  733. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +14 -14
  734. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +16 -16
  735. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +7 -7
  736. package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.d.ts +2 -1
  737. package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +4 -1
  738. package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +12 -12
  739. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +3 -3
  740. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +1 -1
  741. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +29 -29
  742. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +14 -14
  743. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +75 -75
  744. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
  745. package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +9 -7
  746. package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
  747. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +38 -38
  748. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +5 -8
  749. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +4 -3
  750. package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
  751. package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +3 -3
  752. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +4 -4
  753. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +2 -2
  754. package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css +7 -2
  755. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +19 -19
  756. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +5 -5
  757. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +11 -11
  758. package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +3 -1
  759. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +68 -68
  760. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +7 -9
  761. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
  762. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
  763. package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +2 -2
  764. package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +1 -1
  765. package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/commands.js +2 -2
  766. package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/configurationSchema.js +4 -4
  767. package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +18 -18
  768. package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +1 -1
  769. package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +1 -1
  770. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +49 -47
  771. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +1 -1
  772. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +15 -15
  773. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +14 -14
  774. package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +159 -147
  775. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +181 -181
  776. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +1 -1
  777. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +1 -1
  778. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +5 -5
  779. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.d.ts +1 -0
  780. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +29 -25
  781. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsList.js +4 -3
  782. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +4 -4
  783. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.d.ts +10 -2
  784. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +93 -13
  785. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.d.ts +4 -4
  786. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +92 -91
  787. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.d.ts +2 -0
  788. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +24 -6
  789. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.d.ts +7 -0
  790. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +58 -31
  791. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.d.ts +3 -1
  792. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +134 -82
  793. package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +2 -2
  794. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extension.css +24 -3
  795. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css +1 -1
  796. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css +29 -9
  797. package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +1 -1
  798. package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +2 -2
  799. package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.js +2 -1
  800. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.d.ts +6 -0
  801. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +3 -2
  802. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
  803. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +2 -2
  804. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +3 -3
  805. package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +2 -2
  806. package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +3 -3
  807. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/configuration.js +4 -4
  808. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +3 -3
  809. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +1 -1
  810. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -8
  811. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +18 -18
  812. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +14 -14
  813. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +39 -39
  814. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +84 -84
  815. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands._save.js +4 -4
  816. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +2 -2
  817. package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
  818. package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +27 -27
  819. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +50 -50
  820. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
  821. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
  822. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.js +4 -4
  823. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +7 -7
  824. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +18 -17
  825. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +7 -7
  826. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +4 -4
  827. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
  828. package/vscode/src/vs/workbench/contrib/files/common/explorerModel.js +1 -0
  829. package/vscode/src/vs/workbench/contrib/files/common/files.js +16 -16
  830. package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
  831. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
  832. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
  833. package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
  834. package/vscode/src/vs/workbench/contrib/git/browser/gitService.d.ts +25 -0
  835. package/vscode/src/vs/workbench/contrib/git/browser/gitService.js +61 -0
  836. package/vscode/src/vs/workbench/contrib/git/common/gitService.service.d.ts +10 -0
  837. package/vscode/src/vs/workbench/contrib/git/common/gitService.service.js +6 -0
  838. package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
  839. package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
  840. package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
  841. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.js +71 -69
  842. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +259 -0
  843. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +1225 -0
  844. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +72 -0
  845. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +996 -0
  846. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +17 -0
  847. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +49 -0
  848. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.d.ts +5 -0
  849. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +12 -0
  850. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +88 -0
  851. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +464 -0
  852. package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerEditor.css +94 -0
  853. package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfiguration.js +118 -31
  854. package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayService.d.ts +11 -0
  855. package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayService.service.d.ts +26 -0
  856. package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayService.service.js +6 -0
  857. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.service.d.ts +8 -0
  858. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.service.js +6 -0
  859. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +1 -1
  860. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +14 -13
  861. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTaskManager.js +1 -1
  862. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.d.ts +10 -3
  863. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +9 -6
  864. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.service.d.ts +1 -1
  865. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypesUtils.js +1 -0
  866. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.d.ts +1 -2917
  867. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +4 -4
  868. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +23 -23
  869. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +2 -2
  870. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
  871. package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution.d.ts +1 -0
  872. package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution.js +55 -0
  873. package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnectionStatus.d.ts +13 -0
  874. package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnectionStatus.js +62 -0
  875. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/icons.contribution.js +1 -1
  876. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +3 -3
  877. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
  878. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +1 -1
  879. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +19 -18
  880. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  881. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +6 -6
  882. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
  883. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
  884. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  885. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  886. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  887. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +1 -1
  888. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +2 -4
  889. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  890. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  891. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +4 -4
  892. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +7 -7
  893. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +24 -24
  894. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +29 -29
  895. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +5 -5
  896. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +7 -7
  897. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
  898. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +4 -4
  899. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +1 -1
  900. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +3 -3
  901. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
  902. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +2 -2
  903. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +4 -4
  904. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +1 -1
  905. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +1 -1
  906. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +14 -14
  907. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
  908. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +1 -1
  909. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -2
  910. package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +3 -3
  911. package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +13 -13
  912. package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +10 -10
  913. package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.d.ts +1 -1
  914. package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +151 -57
  915. package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.d.ts +1 -1
  916. package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +16 -4
  917. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.d.ts +0 -1
  918. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +5 -6
  919. package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +21 -21
  920. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +18 -17
  921. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +17 -17
  922. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +84 -84
  923. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.d.ts +15 -2
  924. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +28 -5
  925. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +11 -11
  926. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.js +6 -6
  927. package/vscode/src/vs/workbench/contrib/scm/common/quickDiff.js +14 -14
  928. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +9 -9
  929. package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css +3 -3
  930. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.js +1 -1
  931. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -3
  932. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -1
  933. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +12 -12
  934. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +9 -9
  935. package/vscode/src/vs/workbench/contrib/search/browser/searchChatContext.js +6 -6
  936. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +1 -1
  937. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +20 -20
  938. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +2 -2
  939. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +14 -14
  940. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/fileMatch.js +1 -1
  941. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +55 -55
  942. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.d.ts +15 -0
  943. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +33 -10
  944. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +2 -2
  945. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +4 -4
  946. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +5 -5
  947. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
  948. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
  949. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
  950. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
  951. package/vscode/src/vs/workbench/contrib/tasks/common/constants.js +1 -1
  952. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
  953. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.d.ts +1 -0
  954. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +6 -6
  955. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.d.ts +17 -13
  956. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +30 -27
  957. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +1 -0
  958. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.d.ts +0 -7
  959. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +3 -3
  960. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +13 -13
  961. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +40 -40
  962. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +15 -15
  963. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +5 -3
  964. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +17 -9
  965. package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -23
  966. package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +17 -17
  967. package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +26 -26
  968. package/vscode/src/vs/workbench/contrib/terminal/terminalContribExports.js +2 -0
  969. package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/common/terminalAccessibilityConfiguration.js +2 -2
  970. package/vscode/src/vs/workbench/contrib/terminalContrib/autoReplies/common/terminalAutoRepliesConfiguration.js +2 -2
  971. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.js +71 -61
  972. package/vscode/src/vs/workbench/contrib/terminalContrib/commandGuide/common/terminalCommandGuideConfiguration.js +1 -1
  973. package/vscode/src/vs/workbench/contrib/terminalContrib/history/common/terminal.history.js +1 -1
  974. package/vscode/src/vs/workbench/contrib/terminalContrib/inlineHint/common/terminalInitialHintConfiguration.js +1 -1
  975. package/vscode/src/vs/workbench/contrib/terminalContrib/notification/common/terminalNotificationConfiguration.d.ts +6 -0
  976. package/vscode/src/vs/workbench/contrib/terminalContrib/notification/common/terminalNotificationConfiguration.js +21 -0
  977. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/common/terminalStickyScrollConfiguration.js +3 -3
  978. package/vscode/src/vs/workbench/contrib/terminalContrib/suggest/common/terminalSuggestConfiguration.js +30 -30
  979. package/vscode/src/vs/workbench/contrib/terminalContrib/typeAhead/common/terminalTypeAheadConfiguration.js +5 -5
  980. package/vscode/src/vs/workbench/contrib/terminalContrib/zoom/common/terminal.zoom.js +2 -2
  981. package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
  982. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
  983. package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
  984. package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainService.d.ts +2 -1
  985. package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +6 -6
  986. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +6 -3
  987. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindAccessibilityHelp.d.ts +10 -0
  988. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindAccessibilityHelp.js +118 -0
  989. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +10 -4
  990. package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
  991. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +6 -2
  992. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +193 -100
  993. package/vscode/src/vs/workbench/services/assignment/common/assignmentService.d.ts +1 -1
  994. package/vscode/src/vs/workbench/services/assignment/common/assignmentService.service.d.ts +1 -1
  995. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +11 -11
  996. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
  997. package/vscode/src/vs/workbench/services/banner/browser/bannerService.d.ts +1 -1
  998. package/vscode/src/vs/workbench/services/browserElements/browser/browserElementsService.service.d.ts +2 -0
  999. package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.d.ts +9 -0
  1000. package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.js +34 -17
  1001. package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.service.d.ts +3 -0
  1002. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +16 -16
  1003. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +1 -1
  1004. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +16 -16
  1005. package/vscode/src/vs/workbench/services/editor/common/editorGroupColumn.js +2 -2
  1006. package/vscode/src/vs/workbench/services/editor/common/editorGroupFinder.d.ts +7 -7
  1007. package/vscode/src/vs/workbench/services/editor/common/editorGroupFinder.js +39 -20
  1008. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +59 -3
  1009. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.js +6 -1
  1010. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.service.d.ts +14 -1
  1011. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
  1012. package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +6 -1
  1013. package/vscode/src/vs/workbench/services/editor/common/editorService.js +2 -1
  1014. package/vscode/src/vs/workbench/services/editor/common/editorService.service.d.ts +1 -1
  1015. package/vscode/src/vs/workbench/services/environment/browser/environmentService.d.ts +1 -1
  1016. package/vscode/src/vs/workbench/services/environment/browser/environmentService.js +9 -9
  1017. package/vscode/src/vs/workbench/services/environment/common/environmentService.service.d.ts +1 -0
  1018. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionsIcons.js +3 -3
  1019. package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -6
  1020. package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +10 -10
  1021. package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +1 -1
  1022. package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +90 -90
  1023. package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +5 -5
  1024. package/vscode/src/vs/workbench/services/host/browser/host.d.ts +11 -0
  1025. package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +11 -0
  1026. package/vscode/src/vs/workbench/services/language/common/languageService.js +24 -24
  1027. package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +3 -0
  1028. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +3 -0
  1029. package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
  1030. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.d.ts +87 -0
  1031. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +702 -0
  1032. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.service.d.ts +1 -1
  1033. package/vscode/src/vs/workbench/services/panecomposite/browser/panecomposite.service.d.ts +3 -0
  1034. package/vscode/src/vs/workbench/services/power/common/powerService.d.ts +12 -0
  1035. package/vscode/src/vs/workbench/services/power/common/powerService.service.d.ts +25 -0
  1036. package/vscode/src/vs/workbench/services/power/common/powerService.service.js +6 -0
  1037. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
  1038. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
  1039. package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +1 -0
  1040. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +4 -4
  1041. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
  1042. package/vscode/src/vs/workbench/services/remote/common/tunnelModel.d.ts +1 -1
  1043. package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +13 -13
  1044. package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
  1045. package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +16 -14
  1046. package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
  1047. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +3 -3
  1048. package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +18 -18
  1049. package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +8 -8
  1050. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
  1051. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
  1052. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +3 -3
  1053. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
  1054. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +13 -13
  1055. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +16 -16
  1056. package/vscode/src/vs/workbench/services/workspaces/common/workspaceEditing.d.ts +12 -0
  1057. package/vscode/src/vs/workbench/services/workspaces/common/workspaceEditing.service.d.ts +7 -0
  1058. package/vscode-dts/vscode.d.ts +26 -1
  1059. package/vscode-dts/vscode.proposed.chatContextProvider.d.ts +47 -11
  1060. package/vscode-dts/vscode.proposed.chatDebug.d.ts +657 -0
  1061. package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +92 -12
  1062. package/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +29 -6
  1063. package/vscode-dts/vscode.proposed.chatProvider.d.ts +14 -0
  1064. package/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts +90 -15
  1065. package/vscode-dts/vscode.proposed.d.ts +4 -1
  1066. package/vscode-dts/{vscode.proposed.envIsAppPortable.d.ts → vscode.proposed.envIsConnectionMetered.d.ts} +7 -7
  1067. package/vscode-dts/vscode.proposed.environmentPower.d.ts +166 -0
  1068. package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +17 -0
  1069. package/vscode-dts/vscode.proposed.mcpServerDefinitions.d.ts +28 -0
  1070. package/vscode-dts/vscode.proposed.terminalTitle.d.ts +37 -0
  1071. package/vscode/src/vs/platform/assignment/common/assignment.d.ts +0 -85
  1072. package/vscode/src/vs/platform/dialogs/browser/dialog.d.ts +0 -10
  1073. package/vscode/src/vs/workbench/services/layout/common/workbenchModeService.d.ts +0 -16
  1074. package/vscode/src/vs/workbench/services/layout/common/workbenchModeService.js +0 -20
  1075. package/vscode/src/vs/workbench/services/layout/common/workbenchModeService.service.d.ts +0 -27
  1076. package/vscode/src/vs/workbench/services/views/browser/viewsService.d.ts +0 -77
  1077. package/vscode/src/vs/workbench/services/views/browser/viewsService.js +0 -733
  1078. /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocol.js +0 -0
  1079. /package/vscode/src/vs/workbench/contrib/url/{browser → common}/trustedDomainService.service.d.ts +0 -0
  1080. /package/vscode/src/vs/workbench/contrib/url/{browser → common}/trustedDomainService.service.js +0 -0
@@ -1,618 +1,1235 @@
1
1
 
2
+ import { localize } from '../../nls.js';
2
3
 
3
4
  function parse(input, errors = [], options = {}) {
4
- const lines = input.length === 0 ? [] : input.split(/\r\n|\n/);
5
- const parser = ( new YamlParser(lines, errors, options));
5
+ const scanner = ( new YamlScanner(input));
6
+ const tokens = scanner.scan();
7
+ const parser = ( new YamlParser(tokens, input, errors, options));
6
8
  return parser.parse();
7
9
  }
8
- function createPosition(line, character) {
10
+ var TokenType;
11
+ (function(TokenType) {
12
+ TokenType[TokenType["Scalar"] = 0] = "Scalar";
13
+ TokenType[TokenType["Colon"] = 1] = "Colon";
14
+ TokenType[TokenType["Dash"] = 2] = "Dash";
15
+ TokenType[TokenType["Comma"] = 3] = "Comma";
16
+ TokenType[TokenType["FlowMapStart"] = 4] = "FlowMapStart";
17
+ TokenType[TokenType["FlowMapEnd"] = 5] = "FlowMapEnd";
18
+ TokenType[TokenType["FlowSeqStart"] = 6] = "FlowSeqStart";
19
+ TokenType[TokenType["FlowSeqEnd"] = 7] = "FlowSeqEnd";
20
+ TokenType[TokenType["Newline"] = 8] = "Newline";
21
+ TokenType[TokenType["Indent"] = 9] = "Indent";
22
+ TokenType[TokenType["Comment"] = 10] = "Comment";
23
+ TokenType[TokenType["DocumentStart"] = 11] = "DocumentStart";
24
+ TokenType[TokenType["DocumentEnd"] = 12] = "DocumentEnd";
25
+ TokenType[TokenType["EOF"] = 13] = "EOF";
26
+ })(TokenType || (TokenType = {}));
27
+ function makeToken(type, startOffset, endOffset, extra) {
9
28
  return {
10
- line,
11
- character
29
+ type,
30
+ startOffset,
31
+ endOffset,
32
+ rawValue: extra?.rawValue ?? "",
33
+ value: extra?.value ?? "",
34
+ format: extra?.format ?? "none",
35
+ indent: extra?.indent ?? 0
12
36
  };
13
37
  }
14
- function createStringNode(value, start, end) {
15
- return {
16
- type: "string",
17
- value,
18
- start,
19
- end
20
- };
21
- }
22
- function createNumberNode(value, start, end) {
23
- return {
24
- type: "number",
25
- value,
26
- start,
27
- end
28
- };
29
- }
30
- function createBooleanNode(value, start, end) {
31
- return {
32
- type: "boolean",
33
- value,
34
- start,
35
- end
36
- };
37
- }
38
- function createNullNode(start, end) {
39
- return {
40
- type: "null",
41
- value: null,
42
- start,
43
- end
44
- };
45
- }
46
- function createObjectNode(properties, start, end) {
47
- return {
48
- type: "object",
49
- start,
50
- end,
51
- properties
52
- };
53
- }
54
- function createArrayNode(items, start, end) {
55
- return {
56
- type: "array",
57
- start,
58
- end,
59
- items
60
- };
61
- }
62
- function isWhitespace(char) {
63
- return char === " " || char === "\t";
64
- }
65
- function isValidNumber(value) {
66
- return /^-?\d*\.?\d+$/.test(value);
67
- }
68
- class YamlLexer {
69
- constructor(lines) {
70
- this.currentLine = 0;
71
- this.currentChar = 0;
72
- this.lines = lines;
38
+ class YamlScanner {
39
+ constructor(input) {
40
+ this.input = input;
41
+ this.pos = 0;
42
+ this.tokens = [];
43
+ this.flowDepth = 0;
44
+ this.seenBlockColon = false;
73
45
  }
74
- getCurrentPosition() {
75
- return createPosition(this.currentLine, this.currentChar);
46
+ scan() {
47
+ while (this.pos < this.input.length) {
48
+ this.scanLine();
49
+ }
50
+ this.tokens.push(makeToken(TokenType.EOF, this.pos, this.pos));
51
+ return this.tokens;
76
52
  }
77
- getCurrentLineNumber() {
78
- return this.currentLine;
53
+ scanLine() {
54
+ this.seenBlockColon = false;
55
+ if (this.peekChar() === "\n") {
56
+ this.tokens.push(makeToken(TokenType.Newline, this.pos, this.pos + 1));
57
+ this.pos++;
58
+ return;
59
+ }
60
+ if (this.peekChar() === "\r") {
61
+ const end = this.pos + (this.input[this.pos + 1] === "\n" ? 2 : 1);
62
+ this.tokens.push(makeToken(TokenType.Newline, this.pos, end));
63
+ this.pos = end;
64
+ return;
65
+ }
66
+ const indentStart = this.pos;
67
+ let indent = 0;
68
+ while (this.pos < this.input.length && (this.input[this.pos] === " " || this.input[this.pos] === "\t")) {
69
+ indent++;
70
+ this.pos++;
71
+ }
72
+ if (indent > 0) {
73
+ this.tokens.push(makeToken(TokenType.Indent, indentStart, this.pos, {
74
+ indent
75
+ }));
76
+ }
77
+ if (this.pos >= this.input.length || this.peekChar() === "\n" || this.peekChar() === "\r") {
78
+ if (this.pos < this.input.length) {
79
+ const nlStart = this.pos;
80
+ const end = this.peekChar() === "\r" && this.input[this.pos + 1] === "\n" ? this.pos + 2 : this.pos + 1;
81
+ this.tokens.push(makeToken(TokenType.Newline, nlStart, end));
82
+ this.pos = end;
83
+ }
84
+ return;
85
+ }
86
+ if (indent === 0 && this.input.length - this.pos >= 3) {
87
+ const c0 = this.input[this.pos];
88
+ const c1 = this.input[this.pos + 1];
89
+ const c2 = this.input[this.pos + 2];
90
+ const c3 = this.input[this.pos + 3];
91
+ const isTerminator = c3 === undefined || c3 === " " || c3 === "\t" || c3 === "\n" || c3 === "\r";
92
+ if (c0 === "-" && c1 === "-" && c2 === "-" && isTerminator) {
93
+ this.tokens.push(makeToken(TokenType.DocumentStart, this.pos, this.pos + 3));
94
+ this.pos += 3;
95
+ this.scanLineContent();
96
+ this.scanNewline();
97
+ return;
98
+ }
99
+ if (c0 === "." && c1 === "." && c2 === "." && isTerminator) {
100
+ this.tokens.push(makeToken(TokenType.DocumentEnd, this.pos, this.pos + 3));
101
+ this.pos += 3;
102
+ this.scanLineContent();
103
+ this.scanNewline();
104
+ return;
105
+ }
106
+ }
107
+ if (this.peekChar() === "#") {
108
+ this.scanComment();
109
+ this.scanNewline();
110
+ return;
111
+ }
112
+ if (this.peekChar() === "%") {
113
+ while (this.pos < this.input.length && this.input[this.pos] !== "\n" && this.input[this.pos] !== "\r") {
114
+ this.pos++;
115
+ }
116
+ this.scanNewline();
117
+ return;
118
+ }
119
+ this.scanLineContent();
120
+ this.scanNewline();
79
121
  }
80
- getCurrentCharNumber() {
81
- return this.currentChar;
122
+ scanLineContent() {
123
+ while (this.pos < this.input.length && this.peekChar() !== "\n" && this.peekChar() !== "\r") {
124
+ this.skipInlineWhitespace();
125
+ if (this.pos >= this.input.length || this.peekChar() === "\n" || this.peekChar() === "\r") {
126
+ break;
127
+ }
128
+ const ch = this.peekChar();
129
+ if (ch === "#") {
130
+ this.scanComment();
131
+ break;
132
+ } else if (ch === "{") {
133
+ this.flowDepth++;
134
+ this.tokens.push(makeToken(TokenType.FlowMapStart, this.pos, this.pos + 1));
135
+ this.pos++;
136
+ } else if (ch === "}" && this.flowDepth > 0) {
137
+ this.flowDepth--;
138
+ this.tokens.push(makeToken(TokenType.FlowMapEnd, this.pos, this.pos + 1));
139
+ this.pos++;
140
+ } else if (ch === "[") {
141
+ this.flowDepth++;
142
+ this.tokens.push(makeToken(TokenType.FlowSeqStart, this.pos, this.pos + 1));
143
+ this.pos++;
144
+ } else if (ch === "]" && this.flowDepth > 0) {
145
+ this.flowDepth--;
146
+ this.tokens.push(makeToken(TokenType.FlowSeqEnd, this.pos, this.pos + 1));
147
+ this.pos++;
148
+ } else if (ch === "," && this.flowDepth > 0) {
149
+ this.tokens.push(makeToken(TokenType.Comma, this.pos, this.pos + 1));
150
+ this.pos++;
151
+ } else if (ch === "-" && this.isBlockDash()) {
152
+ this.tokens.push(makeToken(TokenType.Dash, this.pos, this.pos + 1));
153
+ this.pos++;
154
+ } else if (ch === ":" && this.isBlockColon()) {
155
+ this.tokens.push(makeToken(TokenType.Colon, this.pos, this.pos + 1));
156
+ this.pos++;
157
+ if (this.flowDepth === 0) {
158
+ this.seenBlockColon = true;
159
+ }
160
+ } else if (ch === ":" && this.flowDepth > 0 && this.lastTokenIsJsonLike()) {
161
+ this.tokens.push(makeToken(TokenType.Colon, this.pos, this.pos + 1));
162
+ this.pos++;
163
+ } else if (ch === "'" || ch === "\"") {
164
+ this.scanQuotedScalar(ch);
165
+ } else if ((ch === "|" || ch === ">") && this.flowDepth === 0 && this.isBlockScalarStart()) {
166
+ this.scanBlockScalar(ch);
167
+ break;
168
+ } else {
169
+ this.scanUnquotedScalar();
170
+ }
171
+ }
82
172
  }
83
- getCurrentLineText() {
84
- return this.currentLine < this.lines.length ? this.lines[this.currentLine] : "";
173
+ isBlockDash() {
174
+ const next = this.input[this.pos + 1];
175
+ return next === undefined || next === " " || next === "\t" || next === "\n" || next === "\r";
85
176
  }
86
- savePosition() {
87
- return {
88
- line: this.currentLine,
89
- char: this.currentChar
90
- };
177
+ isBlockColon() {
178
+ if (this.seenBlockColon && this.flowDepth === 0) {
179
+ return false;
180
+ }
181
+ const next = this.input[this.pos + 1];
182
+ if (next === undefined || next === " " || next === "\t" || next === "\n" || next === "\r") {
183
+ return true;
184
+ }
185
+ if (this.flowDepth > 0 && (next === "," || next === "}" || next === "]")) {
186
+ return true;
187
+ }
188
+ return false;
91
189
  }
92
- restorePosition(pos) {
93
- this.currentLine = pos.line;
94
- this.currentChar = pos.char;
190
+ lastTokenIsJsonLike() {
191
+ for (let i = this.tokens.length - 1; i >= 0; i--) {
192
+ const t = this.tokens[i];
193
+ if (t.type === TokenType.Newline || t.type === TokenType.Indent || t.type === TokenType.Comment) {
194
+ continue;
195
+ }
196
+ if (t.type === TokenType.Scalar && t.format !== "none") {
197
+ return true;
198
+ }
199
+ if (t.type === TokenType.FlowMapEnd || t.type === TokenType.FlowSeqEnd) {
200
+ return true;
201
+ }
202
+ return false;
203
+ }
204
+ return false;
95
205
  }
96
- isAtEnd() {
97
- return this.currentLine >= this.lines.length;
206
+ scanQuotedScalar(quote) {
207
+ const start = this.pos;
208
+ this.pos++;
209
+ let value = "";
210
+ let trailingLiteralWs = 0;
211
+ while (this.pos < this.input.length) {
212
+ const ch = this.input[this.pos];
213
+ if (ch === quote) {
214
+ if (quote === "'" && this.input[this.pos + 1] === "'") {
215
+ value += "'";
216
+ this.pos += 2;
217
+ trailingLiteralWs = 0;
218
+ continue;
219
+ }
220
+ this.pos++;
221
+ const rawValue = this.input.substring(start, this.pos);
222
+ this.tokens.push(makeToken(TokenType.Scalar, start, this.pos, {
223
+ rawValue,
224
+ value,
225
+ format: quote === "'" ? "single" : "double"
226
+ }));
227
+ return;
228
+ }
229
+ if (quote === "\"" && ch === "\\") {
230
+ const next = this.input[this.pos + 1];
231
+ if (next === "\n" || next === "\r") {
232
+ this.pos++;
233
+ this.consumeNewline();
234
+ this.skipInlineWhitespace();
235
+ trailingLiteralWs = 0;
236
+ continue;
237
+ }
238
+ switch (next) {
239
+ case "n":
240
+ value += "\n";
241
+ break;
242
+ case "t":
243
+ value += "\t";
244
+ break;
245
+ case "\\":
246
+ value += "\\";
247
+ break;
248
+ case "\"":
249
+ value += "\"";
250
+ break;
251
+ case "/":
252
+ value += "/";
253
+ break;
254
+ case "r":
255
+ value += "\r";
256
+ break;
257
+ case "0":
258
+ value += "\u0000";
259
+ break;
260
+ case "a":
261
+ value += "\u0007";
262
+ break;
263
+ case "b":
264
+ value += "\b";
265
+ break;
266
+ case "e":
267
+ value += "\u001b";
268
+ break;
269
+ case "v":
270
+ value += "\u000b";
271
+ break;
272
+ case "f":
273
+ value += "\f";
274
+ break;
275
+ case " ":
276
+ value += " ";
277
+ break;
278
+ case "_":
279
+ value += " ";
280
+ break;
281
+ case "x":
282
+ {
283
+ const hex = this.input.substring(this.pos + 2, this.pos + 4);
284
+ const code = parseInt(hex, 16);
285
+ if (hex.length === 2 && !isNaN(code)) {
286
+ value += String.fromCharCode(code);
287
+ this.pos += 4;
288
+ } else {
289
+ value += "\\x";
290
+ this.pos += 2;
291
+ }
292
+ trailingLiteralWs = 0;
293
+ continue;
294
+ }
295
+ case "u":
296
+ {
297
+ const hex = this.input.substring(this.pos + 2, this.pos + 6);
298
+ const code = parseInt(hex, 16);
299
+ if (hex.length === 4 && !isNaN(code)) {
300
+ value += String.fromCodePoint(code);
301
+ this.pos += 6;
302
+ } else {
303
+ value += "\\u";
304
+ this.pos += 2;
305
+ }
306
+ trailingLiteralWs = 0;
307
+ continue;
308
+ }
309
+ case "U":
310
+ {
311
+ const hex = this.input.substring(this.pos + 2, this.pos + 10);
312
+ const code = parseInt(hex, 16);
313
+ if (hex.length === 8 && !isNaN(code)) {
314
+ value += String.fromCodePoint(code);
315
+ this.pos += 10;
316
+ } else {
317
+ value += "\\U";
318
+ this.pos += 2;
319
+ }
320
+ trailingLiteralWs = 0;
321
+ continue;
322
+ }
323
+ default:
324
+ value += "\\" + (next ?? "");
325
+ break;
326
+ }
327
+ this.pos += 2;
328
+ trailingLiteralWs = 0;
329
+ continue;
330
+ }
331
+ if (ch === "\n" || ch === "\r") {
332
+ if (trailingLiteralWs > 0) {
333
+ value = value.substring(0, value.length - trailingLiteralWs);
334
+ }
335
+ trailingLiteralWs = 0;
336
+ this.consumeNewline();
337
+ let emptyLineCount = 0;
338
+ while (this.pos < this.input.length) {
339
+ this.skipInlineWhitespace();
340
+ const c = this.input[this.pos];
341
+ if (c === "\n" || c === "\r") {
342
+ emptyLineCount++;
343
+ this.consumeNewline();
344
+ } else {
345
+ break;
346
+ }
347
+ }
348
+ if (emptyLineCount > 0) {
349
+ value += "\n".repeat(emptyLineCount);
350
+ } else {
351
+ value += " ";
352
+ }
353
+ continue;
354
+ }
355
+ if (ch === " " || ch === "\t") {
356
+ trailingLiteralWs++;
357
+ } else {
358
+ trailingLiteralWs = 0;
359
+ }
360
+ value += ch;
361
+ this.pos++;
362
+ }
363
+ const rawValue = this.input.substring(start, this.pos);
364
+ this.tokens.push(makeToken(TokenType.Scalar, start, this.pos, {
365
+ rawValue,
366
+ value,
367
+ format: quote === "'" ? "single" : "double"
368
+ }));
98
369
  }
99
- getCurrentChar() {
100
- if (this.isAtEnd() || this.currentChar >= this.lines[this.currentLine].length) {
101
- return "";
370
+ scanUnquotedScalar() {
371
+ const start = this.pos;
372
+ let end = this.pos;
373
+ while (this.pos < this.input.length) {
374
+ const ch = this.input[this.pos];
375
+ if (ch === "\n" || ch === "\r") {
376
+ break;
377
+ }
378
+ if (this.flowDepth > 0 && (ch === "," || ch === "}" || ch === "]")) {
379
+ break;
380
+ }
381
+ if (this.flowDepth > 0 && (ch === "{" || ch === "[")) {
382
+ break;
383
+ }
384
+ if (ch === ":" && this.isBlockColon()) {
385
+ break;
386
+ }
387
+ if (ch === "#" && this.pos > start && (this.input[this.pos - 1] === " " || this.input[this.pos - 1] === "\t")) {
388
+ break;
389
+ }
390
+ this.pos++;
391
+ if (ch !== " " && ch !== "\t") {
392
+ end = this.pos;
393
+ }
102
394
  }
103
- return this.lines[this.currentLine][this.currentChar];
395
+ const rawValue = this.input.substring(start, end);
396
+ this.tokens.push(makeToken(TokenType.Scalar, start, end, {
397
+ rawValue,
398
+ value: rawValue,
399
+ format: "none"
400
+ }));
104
401
  }
105
- peek(offset = 1) {
106
- const newChar = this.currentChar + offset;
107
- if (this.currentLine >= this.lines.length || newChar >= this.lines[this.currentLine].length) {
108
- return "";
402
+ isBlockScalarStart() {
403
+ let p = this.pos + 1;
404
+ while (p < this.input.length) {
405
+ const c = this.input[p];
406
+ if (c >= "1" && c <= "9") {
407
+ p++;
408
+ continue;
409
+ }
410
+ if (c === "+" || c === "-") {
411
+ p++;
412
+ continue;
413
+ }
414
+ break;
415
+ }
416
+ while (p < this.input.length && (this.input[p] === " " || this.input[p] === "\t")) {
417
+ p++;
109
418
  }
110
- return this.lines[this.currentLine][newChar];
419
+ if (p >= this.input.length) {
420
+ return true;
421
+ }
422
+ const c = this.input[p];
423
+ return c === "\n" || c === "\r" || c === "#";
111
424
  }
112
- advance() {
113
- const char = this.getCurrentChar();
114
- if (this.currentChar >= this.lines[this.currentLine].length && this.currentLine < this.lines.length - 1) {
115
- this.currentLine++;
116
- this.currentChar = 0;
425
+ scanBlockScalar(style) {
426
+ const start = this.pos;
427
+ this.pos++;
428
+ let explicitIndent = 0;
429
+ let chomping = "clip";
430
+ for (let i = 0; i < 2; i++) {
431
+ if (this.pos < this.input.length) {
432
+ const c = this.input[this.pos];
433
+ if (c >= "1" && c <= "9" && explicitIndent === 0) {
434
+ explicitIndent = parseInt(c, 10);
435
+ this.pos++;
436
+ } else if (c === "-" && chomping === "clip") {
437
+ chomping = "strip";
438
+ this.pos++;
439
+ } else if (c === "+" && chomping === "clip") {
440
+ chomping = "keep";
441
+ this.pos++;
442
+ }
443
+ }
444
+ }
445
+ while (this.pos < this.input.length && (this.input[this.pos] === " " || this.input[this.pos] === "\t")) {
446
+ this.pos++;
447
+ }
448
+ if (this.pos < this.input.length && this.input[this.pos] === "#") {
449
+ while (this.pos < this.input.length && this.input[this.pos] !== "\n" && this.input[this.pos] !== "\r") {
450
+ this.pos++;
451
+ }
452
+ }
453
+ this.consumeNewline();
454
+ const parentBlockIndent = this.getParentBlockIndent(start);
455
+ let contentIndent = explicitIndent > 0 ? parentBlockIndent + explicitIndent : 0;
456
+ const lines = [];
457
+ let trailingNewlines = 0;
458
+ while (this.pos < this.input.length) {
459
+ const lineStart = this.pos;
460
+ let lineIndent = 0;
461
+ while (this.pos < this.input.length && this.input[this.pos] === " ") {
462
+ lineIndent++;
463
+ this.pos++;
464
+ }
465
+ if (this.pos >= this.input.length || this.input[this.pos] === "\n" || this.input[this.pos] === "\r") {
466
+ if (contentIndent > 0 && lineIndent >= contentIndent) {
467
+ const preserved = this.input.substring(lineStart + contentIndent, this.pos);
468
+ lines.push(preserved);
469
+ if (preserved === "") {
470
+ trailingNewlines++;
471
+ } else {
472
+ trailingNewlines = 0;
473
+ }
474
+ } else {
475
+ lines.push("");
476
+ trailingNewlines++;
477
+ }
478
+ this.consumeNewline();
479
+ continue;
480
+ }
481
+ if (lineIndent === 0 && this.input.length - this.pos >= 3) {
482
+ const c0 = this.input[this.pos];
483
+ const c1 = this.input[this.pos + 1];
484
+ const c2 = this.input[this.pos + 2];
485
+ const c3 = this.input[this.pos + 3];
486
+ const isTerm = c3 === undefined || c3 === " " || c3 === "\t" || c3 === "\n" || c3 === "\r";
487
+ if ((c0 === "-" && c1 === "-" && c2 === "-" && isTerm) || (c0 === "." && c1 === "." && c2 === "." && isTerm)) {
488
+ this.pos = lineStart;
489
+ break;
490
+ }
491
+ }
492
+ if (contentIndent === 0) {
493
+ if (lineIndent <= parentBlockIndent) {
494
+ this.pos = lineStart;
495
+ break;
496
+ }
497
+ contentIndent = lineIndent;
498
+ }
499
+ if (lineIndent < contentIndent) {
500
+ this.pos = lineStart;
501
+ break;
502
+ }
503
+ const contentStart = lineStart + contentIndent;
504
+ while (this.pos < this.input.length && this.input[this.pos] !== "\n" && this.input[this.pos] !== "\r") {
505
+ this.pos++;
506
+ }
507
+ const lineContent = this.input.substring(contentStart, this.pos);
508
+ lines.push(lineContent);
509
+ trailingNewlines = 0;
510
+ this.consumeNewline();
511
+ }
512
+ let value;
513
+ if (style === "|") {
514
+ value = lines.join("\n");
117
515
  } else {
118
- this.currentChar++;
516
+ value = "";
517
+ let lastNonEmptyIsMoreIndented = false;
518
+ let inEmptyRun = false;
519
+ let seenNonEmpty = false;
520
+ for (let i = 0; i < lines.length; i++) {
521
+ const line = lines[i];
522
+ const isMoreIndented = line.length > 0 && (line[0] === " " || line[0] === "\t");
523
+ if (line === "") {
524
+ value += "\n";
525
+ inEmptyRun = true;
526
+ } else if (i === 0) {
527
+ value = line;
528
+ lastNonEmptyIsMoreIndented = isMoreIndented;
529
+ seenNonEmpty = true;
530
+ } else if (inEmptyRun) {
531
+ if ((lastNonEmptyIsMoreIndented || isMoreIndented) && seenNonEmpty) {
532
+ value += "\n" + line;
533
+ } else {
534
+ value += line;
535
+ }
536
+ lastNonEmptyIsMoreIndented = isMoreIndented;
537
+ inEmptyRun = false;
538
+ seenNonEmpty = true;
539
+ } else if (isMoreIndented || lastNonEmptyIsMoreIndented) {
540
+ value += "\n" + line;
541
+ lastNonEmptyIsMoreIndented = isMoreIndented;
542
+ seenNonEmpty = true;
543
+ } else {
544
+ value += " " + line;
545
+ lastNonEmptyIsMoreIndented = false;
546
+ seenNonEmpty = true;
547
+ }
548
+ }
549
+ }
550
+ if (trailingNewlines > 0) {
551
+ let end = value.length;
552
+ while (end > 0 && value[end - 1] === "\n") {
553
+ end--;
554
+ }
555
+ value = value.substring(0, end);
119
556
  }
120
- return char;
557
+ const hasContent = ( lines.some(l => l !== ""));
558
+ switch (chomping) {
559
+ case "clip":
560
+ if (hasContent) {
561
+ value += "\n";
562
+ }
563
+ break;
564
+ case "keep":
565
+ if (hasContent) {
566
+ value += "\n".repeat(trailingNewlines + 1);
567
+ } else {
568
+ value = "\n".repeat(trailingNewlines);
569
+ }
570
+ break;
571
+ }
572
+ const rawValue = this.input.substring(start, this.pos);
573
+ this.tokens.push(makeToken(TokenType.Scalar, start, this.pos, {
574
+ rawValue,
575
+ value,
576
+ format: style === "|" ? "literal" : "folded"
577
+ }));
121
578
  }
122
- advanceLine() {
123
- this.currentLine++;
124
- this.currentChar = 0;
579
+ getParentBlockIndent(blockScalarPos) {
580
+ for (let i = this.tokens.length - 1; i >= 0; i--) {
581
+ const t = this.tokens[i];
582
+ if (t.type === TokenType.Newline || t.type === TokenType.Comment || t.type === TokenType.Indent) {
583
+ continue;
584
+ }
585
+ if (t.type === TokenType.Colon) {
586
+ for (let j = i - 1; j >= 0; j--) {
587
+ const kt = this.tokens[j];
588
+ if (kt.type === TokenType.Newline || kt.type === TokenType.Comment || kt.type === TokenType.Indent) {
589
+ continue;
590
+ }
591
+ return this.getColumnAt(kt.startOffset);
592
+ }
593
+ return 0;
594
+ }
595
+ if (t.type === TokenType.Dash) {
596
+ return this.getColumnAt(t.startOffset);
597
+ }
598
+ if (t.type === TokenType.DocumentStart) {
599
+ return -1;
600
+ }
601
+ break;
602
+ }
603
+ return 0;
125
604
  }
126
- skipWhitespace() {
127
- while (!this.isAtEnd() && this.currentChar < this.lines[this.currentLine].length && isWhitespace(this.getCurrentChar())) {
128
- this.advance();
605
+ getColumnAt(offset) {
606
+ let col = 0;
607
+ let p = offset - 1;
608
+ while (p >= 0 && this.input[p] !== "\n" && this.input[p] !== "\r") {
609
+ col++;
610
+ p--;
129
611
  }
612
+ return col;
130
613
  }
131
- skipToEndOfLine() {
132
- this.currentChar = this.lines[this.currentLine].length;
614
+ scanComment() {
615
+ const start = this.pos;
616
+ while (this.pos < this.input.length && this.input[this.pos] !== "\n" && this.input[this.pos] !== "\r") {
617
+ this.pos++;
618
+ }
619
+ this.tokens.push(makeToken(TokenType.Comment, start, this.pos, {
620
+ rawValue: this.input.substring(start, this.pos),
621
+ value: this.input.substring(start, this.pos)
622
+ }));
133
623
  }
134
- getIndentation() {
135
- if (this.isAtEnd()) {
136
- return 0;
624
+ scanNewline() {
625
+ const start = this.pos;
626
+ if (this.consumeNewline()) {
627
+ this.tokens.push(makeToken(TokenType.Newline, start, this.pos));
137
628
  }
138
- let indent = 0;
139
- for (let i = 0; i < this.lines[this.currentLine].length; i++) {
140
- if (this.lines[this.currentLine][i] === " ") {
141
- indent++;
142
- } else if (this.lines[this.currentLine][i] === "\t") {
143
- indent += 4;
629
+ }
630
+ skipInlineWhitespace() {
631
+ while (this.pos < this.input.length) {
632
+ const ch = this.input[this.pos];
633
+ if (ch === " " || ch === "\t") {
634
+ this.pos++;
144
635
  } else {
145
636
  break;
146
637
  }
147
638
  }
148
- return indent;
149
639
  }
150
- moveToNextNonEmptyLine() {
151
- while (this.currentLine < this.lines.length) {
152
- if (this.currentChar < this.lines[this.currentLine].length) {
153
- const remainingLine = this.lines[this.currentLine].substring(this.currentChar).trim();
154
- if (remainingLine.length > 0 && !remainingLine.startsWith("#")) {
155
- this.skipWhitespace();
156
- return;
157
- }
158
- }
159
- this.currentLine++;
160
- this.currentChar = 0;
161
- if (this.currentLine < this.lines.length) {
162
- const line = this.lines[this.currentLine].trim();
163
- if (line.length > 0 && !line.startsWith("#")) {
164
- this.skipWhitespace();
165
- return;
166
- }
167
- }
640
+ consumeNewline() {
641
+ if (this.pos >= this.input.length) {
642
+ return false;
168
643
  }
644
+ if (this.input[this.pos] === "\r" && this.input[this.pos + 1] === "\n") {
645
+ this.pos += 2;
646
+ return true;
647
+ }
648
+ if (this.input[this.pos] === "\n" || this.input[this.pos] === "\r") {
649
+ this.pos++;
650
+ return true;
651
+ }
652
+ return false;
653
+ }
654
+ peekChar() {
655
+ return this.input[this.pos];
169
656
  }
170
657
  }
171
658
  class YamlParser {
172
- constructor(lines, errors, options) {
173
- this.flowLevel = 0;
174
- this.lexer = ( new YamlLexer(lines));
659
+ constructor(tokens, input, errors, options) {
660
+ this.tokens = tokens;
661
+ this.input = input;
175
662
  this.errors = errors;
176
663
  this.options = options;
664
+ this.pos = 0;
177
665
  }
178
- addError(message, code, start, end) {
179
- this.errors.push({
180
- message,
181
- code,
182
- start,
183
- end
184
- });
185
- }
186
- parseValue(expectedIndent) {
187
- this.lexer.skipWhitespace();
188
- if (this.lexer.isAtEnd()) {
189
- const pos = this.lexer.getCurrentPosition();
190
- return createStringNode("", pos, pos);
666
+ parse() {
667
+ this.skipNewlinesAndComments();
668
+ if (this.currentToken().type === TokenType.DocumentStart) {
669
+ this.advance();
670
+ this.skipNewlinesAndComments();
191
671
  }
192
- const char = this.lexer.getCurrentChar();
193
- if (char === "\"" || char === `'`) {
194
- return this.parseQuotedString(char);
672
+ if (this.currentToken().type === TokenType.EOF || this.currentToken().type === TokenType.DocumentEnd) {
673
+ return undefined;
195
674
  }
196
- if (char === "[") {
197
- return this.parseInlineArray();
675
+ const result = this.parseValue(-1);
676
+ return result;
677
+ }
678
+ currentToken() {
679
+ return this.tokens[this.pos];
680
+ }
681
+ peek(offset = 0) {
682
+ return this.tokens[Math.min(this.pos + offset, this.tokens.length - 1)];
683
+ }
684
+ advance() {
685
+ const t = this.tokens[this.pos];
686
+ if (t.type !== TokenType.EOF) {
687
+ this.pos++;
198
688
  }
199
- if (char === "{") {
200
- return this.parseInlineObject();
689
+ return t;
690
+ }
691
+ expect(type) {
692
+ const t = this.currentToken();
693
+ if (t.type === type) {
694
+ return this.advance();
201
695
  }
202
- return this.parseUnquotedValue();
696
+ return t;
203
697
  }
204
- parseQuotedString(quote) {
205
- const start = this.lexer.getCurrentPosition();
206
- this.lexer.advance();
207
- let value = "";
208
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "" && this.lexer.getCurrentChar() !== quote) {
209
- value += this.lexer.advance();
698
+ emitError(message, startOffset, endOffset, code) {
699
+ this.errors.push({
700
+ message,
701
+ startOffset,
702
+ endOffset,
703
+ code
704
+ });
705
+ }
706
+ skipNewlinesAndComments() {
707
+ while (this.currentToken().type === TokenType.Newline || this.currentToken().type === TokenType.Comment || (this.currentToken().type === TokenType.Indent && this.isFollowedByNewlineOrComment())) {
708
+ this.advance();
210
709
  }
211
- if (this.lexer.getCurrentChar() === quote) {
212
- this.lexer.advance();
710
+ }
711
+ isFollowedByNewlineOrComment() {
712
+ const next = this.peek(1);
713
+ return next.type === TokenType.Newline || next.type === TokenType.Comment || next.type === TokenType.EOF;
714
+ }
715
+ currentIndent() {
716
+ if (this.currentToken().type === TokenType.Indent) {
717
+ return this.currentToken().indent;
213
718
  }
214
- const end = this.lexer.getCurrentPosition();
215
- return createStringNode(value, start, end);
719
+ return 0;
216
720
  }
217
- parseUnquotedValue() {
218
- const start = this.lexer.getCurrentPosition();
219
- let value = "";
220
- let endPos = start;
221
- const isTerminator = char => {
222
- if (char === "#") {
223
- return true;
224
- }
225
- if (this.flowLevel > 0 && (char === "," || char === "]" || char === "}")) {
226
- return true;
227
- }
228
- return false;
229
- };
230
- const firstChar = this.lexer.getCurrentChar();
231
- if (firstChar === "\"" || firstChar === `'`) {
232
- value += this.lexer.advance();
233
- endPos = this.lexer.getCurrentPosition();
234
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "") {
235
- const char = this.lexer.getCurrentChar();
236
- if (char === firstChar || isTerminator(char)) {
237
- break;
238
- }
239
- value += this.lexer.advance();
240
- endPos = this.lexer.getCurrentPosition();
721
+ parseValue(parentIndent) {
722
+ this.skipNewlinesAndComments();
723
+ const token = this.currentToken();
724
+ const flowToken = token.type === TokenType.Indent ? this.peek(1) : token;
725
+ if (flowToken.type === TokenType.FlowMapStart || flowToken.type === TokenType.FlowSeqStart) {
726
+ if (token.type === TokenType.Indent) {
727
+ this.advance();
241
728
  }
242
- } else {
243
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "") {
244
- const char = this.lexer.getCurrentChar();
245
- if (isTerminator(char)) {
246
- break;
247
- }
248
- value += this.lexer.advance();
249
- endPos = this.lexer.getCurrentPosition();
729
+ if (flowToken.type === TokenType.FlowMapStart) {
730
+ return this.parseFlowMap();
250
731
  }
732
+ return this.parseFlowSeq();
251
733
  }
252
- const trimmed = value.trimEnd();
253
- const diff = value.length - trimmed.length;
254
- if (diff) {
255
- endPos = createPosition(start.line, endPos.character - diff);
734
+ const indent = this.currentIndent();
735
+ const firstContentToken = this.peekPastIndent();
736
+ if (firstContentToken.type === TokenType.Dash) {
737
+ return this.parseBlockSequence(indent);
256
738
  }
257
- const finalValue = (firstChar === "\"" || firstChar === `'`) ? trimmed.substring(1) : trimmed;
258
- return this.createValueNode(finalValue, start, endPos);
739
+ if (this.looksLikeMapping()) {
740
+ return this.parseBlockMapping(indent);
741
+ }
742
+ if (token.type === TokenType.Scalar || token.type === TokenType.Indent) {
743
+ return this.parseScalar(parentIndent);
744
+ }
745
+ return undefined;
259
746
  }
260
- createValueNode(value, start, end) {
261
- if (value === "") {
262
- return createStringNode("", start, start);
747
+ peekPastIndent() {
748
+ if (this.currentToken().type === TokenType.Indent) {
749
+ return this.peek(1);
263
750
  }
264
- if (value === "true") {
265
- return createBooleanNode(true, start, end);
751
+ return this.currentToken();
752
+ }
753
+ looksLikeMapping() {
754
+ let offset = 0;
755
+ if (this.peek(offset).type === TokenType.Indent) {
756
+ offset++;
266
757
  }
267
- if (value === "false") {
268
- return createBooleanNode(false, start, end);
758
+ if (this.peek(offset).type === TokenType.Scalar) {
759
+ offset++;
760
+ if (this.peek(offset).type === TokenType.Colon) {
761
+ return true;
762
+ }
269
763
  }
270
- if (value === "null" || value === "~") {
271
- return createNullNode(start, end);
764
+ return false;
765
+ }
766
+ parseScalar(parentIndent = -1) {
767
+ if (this.currentToken().type === TokenType.Indent) {
768
+ this.advance();
272
769
  }
273
- const numberValue = Number(value);
274
- if (!isNaN(numberValue) && isFinite(numberValue) && isValidNumber(value)) {
275
- return createNumberNode(numberValue, start, end);
770
+ const token = this.expect(TokenType.Scalar);
771
+ if (token.format !== "none") {
772
+ return this.scalarFromToken(token);
276
773
  }
277
- return createStringNode(value, start, end);
774
+ return this.parsePlainMultiline(token, parentIndent);
278
775
  }
279
- parseInlineArray() {
280
- const start = this.lexer.getCurrentPosition();
281
- this.lexer.advance();
282
- this.flowLevel++;
283
- const items = [];
284
- while (!this.lexer.isAtEnd()) {
285
- this.lexer.skipWhitespace();
286
- if (this.lexer.getCurrentChar() === "]") {
287
- this.lexer.advance();
776
+ parsePlainMultiline(firstToken, parentIndent) {
777
+ let value = firstToken.value;
778
+ let endOffset = firstToken.endOffset;
779
+ while (true) {
780
+ const savedPos = this.pos;
781
+ let emptyLineCount = 0;
782
+ let foundContent = false;
783
+ while (this.pos < this.tokens.length) {
784
+ const t = this.currentToken();
785
+ if (t.type === TokenType.Comment) {
786
+ break;
787
+ }
788
+ if (t.type === TokenType.Newline) {
789
+ this.advance();
790
+ const afterNewline = this.currentToken();
791
+ if (afterNewline.type === TokenType.Newline) {
792
+ emptyLineCount++;
793
+ continue;
794
+ }
795
+ if (afterNewline.type === TokenType.Indent) {
796
+ const afterIndent = this.peek(1);
797
+ if (afterIndent.type === TokenType.Newline || afterIndent.type === TokenType.EOF) {
798
+ emptyLineCount++;
799
+ this.advance();
800
+ continue;
801
+ }
802
+ if (afterIndent.type === TokenType.Comment) {
803
+ break;
804
+ }
805
+ if (afterNewline.indent > parentIndent) {
806
+ foundContent = true;
807
+ break;
808
+ } else {
809
+ break;
810
+ }
811
+ }
812
+ if (afterNewline.type === TokenType.EOF) {
813
+ break;
814
+ }
815
+ if (afterNewline.type === TokenType.DocumentStart || afterNewline.type === TokenType.DocumentEnd) {
816
+ break;
817
+ }
818
+ if (parentIndent < 0) {
819
+ foundContent = true;
820
+ break;
821
+ }
822
+ break;
823
+ }
824
+ if (t.type === TokenType.Indent) {
825
+ break;
826
+ }
288
827
  break;
289
828
  }
290
- if (this.lexer.getCurrentChar() === "") {
291
- this.lexer.advanceLine();
292
- continue;
293
- }
294
- if (this.lexer.getCurrentChar() === "#") {
295
- this.lexer.skipToEndOfLine();
296
- this.lexer.advanceLine();
297
- continue;
829
+ if (!foundContent) {
830
+ this.pos = savedPos;
831
+ break;
298
832
  }
299
- const positionBefore = this.lexer.savePosition();
300
- const item = this.parseValue();
301
- if (!(item.type === "string" && item.value === "" && item.start.line === item.end.line && item.start.character === item.end.character)) {
302
- items.push(item);
833
+ if (this.currentToken().type === TokenType.Indent) {
834
+ this.advance();
303
835
  }
304
- const positionAfter = this.lexer.savePosition();
305
- if (positionBefore.line === positionAfter.line && positionBefore.char === positionAfter.char) {
306
- if (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "") {
307
- this.lexer.advance();
308
- } else {
309
- break;
836
+ if (this.currentToken().type !== TokenType.Scalar) {
837
+ if (this.currentToken().type === TokenType.Dash) {
838
+ const dashToken = this.advance();
839
+ let lineText = "-";
840
+ if (this.currentToken().type === TokenType.Scalar) {
841
+ const restToken = this.advance();
842
+ lineText = "- " + restToken.value;
843
+ endOffset = restToken.endOffset;
844
+ } else {
845
+ endOffset = dashToken.endOffset;
846
+ }
847
+ if (emptyLineCount > 0) {
848
+ value += "\n".repeat(emptyLineCount);
849
+ } else {
850
+ value += " ";
851
+ }
852
+ value += lineText;
853
+ continue;
310
854
  }
855
+ this.pos = savedPos;
856
+ break;
857
+ }
858
+ if (this.peek(1).type === TokenType.Colon) {
859
+ this.pos = savedPos;
860
+ break;
311
861
  }
312
- this.lexer.skipWhitespace();
313
- if (this.lexer.getCurrentChar() === ",") {
314
- this.lexer.advance();
862
+ const contToken = this.advance();
863
+ if (emptyLineCount > 0) {
864
+ value += "\n".repeat(emptyLineCount);
865
+ } else {
866
+ value += " ";
315
867
  }
868
+ value += contToken.value;
869
+ endOffset = contToken.endOffset;
316
870
  }
317
- const end = this.lexer.getCurrentPosition();
318
- this.flowLevel--;
319
- return createArrayNode(items, start, end);
871
+ return {
872
+ type: "scalar",
873
+ value,
874
+ rawValue: this.input.substring(firstToken.startOffset, endOffset),
875
+ startOffset: firstToken.startOffset,
876
+ endOffset,
877
+ format: "none"
878
+ };
320
879
  }
321
- parseInlineObject() {
322
- const start = this.lexer.getCurrentPosition();
323
- this.lexer.advance();
324
- this.flowLevel++;
880
+ parseBlockMapping(baseIndent, inlineFirstEntry = false) {
881
+ const startOffset = this.currentToken().startOffset;
325
882
  const properties = [];
326
- while (!this.lexer.isAtEnd()) {
327
- this.lexer.skipWhitespace();
328
- if (this.lexer.getCurrentChar() === "}") {
329
- this.lexer.advance();
330
- break;
331
- }
332
- if (this.lexer.getCurrentChar() === "#") {
333
- this.lexer.skipToEndOfLine();
334
- this.lexer.advanceLine();
335
- continue;
883
+ const seenKeys = ( new Set());
884
+ if (inlineFirstEntry) {
885
+ const firstEntry = this.parseMappingEntry(baseIndent);
886
+ if (firstEntry) {
887
+ seenKeys.add(firstEntry.key.value);
888
+ properties.push(firstEntry);
336
889
  }
337
- const positionBefore = this.lexer.savePosition();
338
- const keyStart = this.lexer.getCurrentPosition();
339
- let keyValue = "";
340
- if (this.lexer.getCurrentChar() === "\"" || this.lexer.getCurrentChar() === `'`) {
341
- const quote = this.lexer.getCurrentChar();
342
- this.lexer.advance();
343
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "" && this.lexer.getCurrentChar() !== quote) {
344
- keyValue += this.lexer.advance();
345
- }
346
- if (this.lexer.getCurrentChar() === quote) {
347
- this.lexer.advance();
348
- }
349
- } else {
350
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "" && this.lexer.getCurrentChar() !== ":") {
351
- keyValue += this.lexer.advance();
352
- }
890
+ }
891
+ while (this.currentToken().type !== TokenType.EOF) {
892
+ this.skipNewlinesAndComments();
893
+ if (this.currentToken().type === TokenType.EOF) {
894
+ break;
353
895
  }
354
- keyValue = keyValue.trim();
355
- const keyEnd = this.lexer.getCurrentPosition();
356
- const key = createStringNode(keyValue, keyStart, keyEnd);
357
- this.lexer.skipWhitespace();
358
- if (this.lexer.getCurrentChar() === ":") {
359
- this.lexer.advance();
896
+ const indent = this.currentIndent();
897
+ if (indent < baseIndent) {
898
+ break;
360
899
  }
361
- this.lexer.skipWhitespace();
362
- const value = this.parseValue();
363
- properties.push({
364
- key,
365
- value
366
- });
367
- const positionAfter = this.lexer.savePosition();
368
- if (positionBefore.line === positionAfter.line && positionBefore.char === positionAfter.char) {
369
- if (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "") {
370
- this.lexer.advance();
900
+ if (indent !== baseIndent) {
901
+ if (indent > baseIndent) {
902
+ this.emitError(( localize(136, "Unexpected indentation (expected {0}, got {1})", baseIndent, indent)), this.currentToken().startOffset, this.currentToken().endOffset, "unexpected-indentation");
371
903
  } else {
372
904
  break;
373
905
  }
374
906
  }
375
- this.lexer.skipWhitespace();
376
- if (this.lexer.getCurrentChar() === ",") {
377
- this.lexer.advance();
907
+ if (!this.looksLikeMapping()) {
908
+ break;
909
+ }
910
+ const entry = this.parseMappingEntry(baseIndent);
911
+ if (!entry) {
912
+ break;
378
913
  }
914
+ if (!this.options.allowDuplicateKeys && ( seenKeys.has(entry.key.value))) {
915
+ this.emitError(( localize(137, "Duplicate key: \"{0}\"", entry.key.value)), entry.key.startOffset, entry.key.endOffset, "duplicate-key");
916
+ }
917
+ seenKeys.add(entry.key.value);
918
+ properties.push(entry);
379
919
  }
380
- const end = this.lexer.getCurrentPosition();
381
- this.flowLevel--;
382
- return createObjectNode(properties, start, end);
920
+ const endOffset = properties.length > 0 ? properties[properties.length - 1].value.endOffset : startOffset;
921
+ return {
922
+ type: "map",
923
+ properties,
924
+ style: "block",
925
+ startOffset,
926
+ endOffset
927
+ };
383
928
  }
384
- parseBlockArray(baseIndent) {
385
- const start = this.lexer.getCurrentPosition();
929
+ parseMappingEntry(baseIndent) {
930
+ if (this.currentToken().type === TokenType.Indent) {
931
+ this.advance();
932
+ }
933
+ const keyToken = this.expect(TokenType.Scalar);
934
+ const key = this.scalarFromToken(keyToken);
935
+ const colon = this.expect(TokenType.Colon);
936
+ if (colon.type !== TokenType.Colon) {
937
+ this.emitError(( localize(138, "Expected \":\"")), colon.startOffset, colon.endOffset, "expected-colon");
938
+ return undefined;
939
+ }
940
+ const value = this.parseMappingValue(baseIndent, colon);
941
+ return {
942
+ key,
943
+ value
944
+ };
945
+ }
946
+ parseMappingValue(baseIndent, colonToken) {
947
+ const next = this.currentToken();
948
+ if (next.type === TokenType.FlowMapStart) {
949
+ return this.parseFlowMap();
950
+ }
951
+ if (next.type === TokenType.FlowSeqStart) {
952
+ return this.parseFlowSeq();
953
+ }
954
+ if (next.type === TokenType.Scalar) {
955
+ if (this.currentToken().type === TokenType.Indent) {
956
+ this.advance();
957
+ }
958
+ const token = this.advance();
959
+ if (token.format !== "none") {
960
+ return this.scalarFromToken(token);
961
+ }
962
+ return this.parsePlainMultiline(token, baseIndent);
963
+ }
964
+ this.skipNewlinesAndComments();
965
+ const afterNewline = this.currentToken();
966
+ if (afterNewline.type === TokenType.EOF) {
967
+ this.emitError(( localize(139, "Missing value")), colonToken.startOffset, colonToken.endOffset, "missing-value");
968
+ return this.makeEmptyScalar(colonToken.endOffset);
969
+ }
970
+ const nextIndent = this.currentIndent();
971
+ if (nextIndent === baseIndent && this.peekPastIndent().type === TokenType.Dash) {
972
+ return this.parseValue(baseIndent) ?? this.makeEmptyScalar(colonToken.endOffset);
973
+ }
974
+ if (nextIndent <= baseIndent) {
975
+ this.emitError(( localize(139, "Missing value")), colonToken.startOffset, colonToken.endOffset, "missing-value");
976
+ return this.makeEmptyScalar(colonToken.endOffset);
977
+ }
978
+ return this.parseValue(baseIndent) ?? this.makeEmptyScalar(colonToken.endOffset);
979
+ }
980
+ parseBlockSequence(baseIndent) {
386
981
  const items = [];
387
- while (!this.lexer.isAtEnd()) {
388
- this.lexer.moveToNextNonEmptyLine();
389
- if (this.lexer.isAtEnd()) {
982
+ const startOffset = this.currentToken().startOffset;
983
+ let endOffset = startOffset;
984
+ let isFirstItem = true;
985
+ while (this.currentToken().type !== TokenType.EOF) {
986
+ this.skipNewlinesAndComments();
987
+ if (this.currentToken().type === TokenType.EOF) {
390
988
  break;
391
989
  }
392
- const currentIndent = this.lexer.getIndentation();
393
- if (currentIndent < baseIndent) {
990
+ let indent;
991
+ if (isFirstItem && this.currentToken().type === TokenType.Dash) {
992
+ indent = this.currentToken().startOffset - this.getLineStart(this.currentToken().startOffset);
993
+ } else {
994
+ indent = this.currentIndent();
995
+ }
996
+ isFirstItem = false;
997
+ if (indent < baseIndent) {
394
998
  break;
395
999
  }
396
- this.lexer.skipWhitespace();
397
- if (this.lexer.getCurrentChar() === "-") {
398
- this.lexer.advance();
399
- this.lexer.skipWhitespace();
400
- const itemStart = this.lexer.getCurrentPosition();
401
- if (this.lexer.getCurrentChar() === "" || this.lexer.getCurrentChar() === "#") {
402
- this.lexer.advanceLine();
403
- if (!this.lexer.isAtEnd()) {
404
- const nextIndent = this.lexer.getIndentation();
405
- if (nextIndent > currentIndent) {
406
- this.lexer.skipWhitespace();
407
- if (this.lexer.getCurrentChar() === "-") {
408
- const nestedArray = this.parseBlockArray(nextIndent);
409
- items.push(nestedArray);
410
- } else {
411
- const currentLine = this.lexer.getCurrentLineText();
412
- const currentPos = this.lexer.getCurrentCharNumber();
413
- const remainingLine = currentLine.substring(currentPos);
414
- if (remainingLine.includes(":") && !remainingLine.trim().startsWith("#")) {
415
- const nestedObject = this.parseBlockObject(nextIndent, this.lexer.getCurrentCharNumber());
416
- items.push(nestedObject);
417
- } else {
418
- items.push(createStringNode("", itemStart, itemStart));
419
- }
420
- }
421
- } else {
422
- items.push(createStringNode("", itemStart, itemStart));
423
- }
424
- } else {
425
- items.push(createStringNode("", itemStart, itemStart));
426
- }
1000
+ if (indent !== baseIndent) {
1001
+ if (indent > baseIndent) {
1002
+ this.emitError(( localize(136, "Unexpected indentation (expected {0}, got {1})", baseIndent, indent)), this.currentToken().startOffset, this.currentToken().endOffset, "unexpected-indentation");
427
1003
  } else {
428
- const currentLine = this.lexer.getCurrentLineText();
429
- const currentPos = this.lexer.getCurrentCharNumber();
430
- const remainingLine = currentLine.substring(currentPos);
431
- const hasColon = remainingLine.includes(":");
432
- if (hasColon) {
433
- const item = this.parseBlockObject(itemStart.character, itemStart.character);
434
- items.push(item);
435
- } else {
436
- const item = this.parseValue();
437
- items.push(item);
438
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "" && this.lexer.getCurrentChar() !== "#") {
439
- this.lexer.advance();
440
- }
441
- this.lexer.advanceLine();
442
- }
1004
+ break;
443
1005
  }
444
- } else {
1006
+ }
1007
+ const contentToken = this.peekPastIndent();
1008
+ if (contentToken.type !== TokenType.Dash) {
445
1009
  break;
446
1010
  }
1011
+ if (this.currentToken().type === TokenType.Indent) {
1012
+ this.advance();
1013
+ }
1014
+ const dashToken = this.advance();
1015
+ const itemValue = this.parseSequenceItemValue(baseIndent, dashToken);
1016
+ items.push(itemValue);
1017
+ endOffset = itemValue.endOffset;
447
1018
  }
448
- let end = start;
449
- if (items.length > 0) {
450
- const lastItem = items[items.length - 1];
451
- end = lastItem.end;
452
- } else {
453
- end = createPosition(start.line, start.character + 1);
1019
+ return {
1020
+ type: "sequence",
1021
+ items,
1022
+ style: "block",
1023
+ startOffset,
1024
+ endOffset
1025
+ };
1026
+ }
1027
+ parseSequenceItemValue(baseIndent, dashToken) {
1028
+ const next = this.currentToken();
1029
+ if (next.type === TokenType.Comment) {
1030
+ this.advance();
1031
+ }
1032
+ if (next.type === TokenType.FlowMapStart) {
1033
+ return this.parseFlowMap();
1034
+ }
1035
+ if (next.type === TokenType.FlowSeqStart) {
1036
+ return this.parseFlowSeq();
1037
+ }
1038
+ if (next.type === TokenType.Dash) {
1039
+ const nestedIndent = next.startOffset - this.getLineStart(next.startOffset);
1040
+ return this.parseBlockSequence(nestedIndent);
1041
+ }
1042
+ if (next.type === TokenType.Scalar) {
1043
+ if (this.peek(1).type === TokenType.Colon) {
1044
+ const itemIndent = next.startOffset - this.getLineStart(next.startOffset);
1045
+ return this.parseBlockMapping(itemIndent, true);
1046
+ }
1047
+ return this.parseScalar(baseIndent);
1048
+ }
1049
+ this.skipNewlinesAndComments();
1050
+ if (this.currentToken().type === TokenType.EOF) {
1051
+ this.emitError(( localize(140, "Missing sequence item value")), dashToken.startOffset, dashToken.endOffset, "missing-value");
1052
+ return this.makeEmptyScalar(dashToken.endOffset);
1053
+ }
1054
+ const nextIndent = this.currentIndent();
1055
+ if (nextIndent <= baseIndent) {
1056
+ this.emitError(( localize(140, "Missing sequence item value")), dashToken.startOffset, dashToken.endOffset, "missing-value");
1057
+ return this.makeEmptyScalar(dashToken.endOffset);
454
1058
  }
455
- return createArrayNode(items, start, end);
1059
+ return this.parseValue(baseIndent) ?? this.makeEmptyScalar(dashToken.endOffset);
456
1060
  }
457
- parseBlockObject(baseIndent, baseCharPosition) {
458
- const start = this.lexer.getCurrentPosition();
1061
+ getLineStart(offset) {
1062
+ let i = offset - 1;
1063
+ while (i >= 0 && this.input[i] !== "\n" && this.input[i] !== "\r") {
1064
+ i--;
1065
+ }
1066
+ return i + 1;
1067
+ }
1068
+ parseFlowMap() {
1069
+ const startToken = this.advance();
459
1070
  const properties = [];
460
- const localKeysSeen = ( new Set());
461
- const fromCurrentPosition = baseCharPosition !== undefined;
462
- let firstIteration = true;
463
- while (!this.lexer.isAtEnd()) {
464
- if (!firstIteration || !fromCurrentPosition) {
465
- this.lexer.moveToNextNonEmptyLine();
466
- }
467
- firstIteration = false;
468
- if (this.lexer.isAtEnd()) {
469
- break;
470
- }
471
- const currentIndent = this.lexer.getIndentation();
472
- if (fromCurrentPosition) {
473
- this.lexer.skipWhitespace();
474
- const currentCharPosition = this.lexer.getCurrentCharNumber();
475
- if (currentCharPosition < baseCharPosition) {
476
- break;
477
- }
1071
+ this.skipFlowWhitespace();
1072
+ while (this.currentToken().type !== TokenType.FlowMapEnd && this.currentToken().type !== TokenType.EOF) {
1073
+ let key;
1074
+ if (this.currentToken().type === TokenType.Scalar) {
1075
+ key = this.parseFlowScalar();
478
1076
  } else {
479
- if (currentIndent < baseIndent) {
480
- break;
481
- }
482
- if (currentIndent > baseIndent) {
483
- const lineStart = createPosition(this.lexer.getCurrentLineNumber(), 0);
484
- const lineEnd = createPosition(this.lexer.getCurrentLineNumber(), this.lexer.getCurrentLineText().length);
485
- this.addError("Unexpected indentation", "indentation", lineStart, lineEnd);
486
- this.lexer.skipWhitespace();
487
- } else {
488
- this.lexer.skipWhitespace();
489
- }
490
- }
491
- const keyStart = this.lexer.getCurrentPosition();
492
- let keyValue = "";
493
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "" && this.lexer.getCurrentChar() !== ":") {
494
- keyValue += this.lexer.advance();
495
- }
496
- keyValue = keyValue.trim();
497
- const keyEnd = this.lexer.getCurrentPosition();
498
- const key = createStringNode(keyValue, keyStart, keyEnd);
499
- if (!this.options.allowDuplicateKeys && ( localKeysSeen.has(keyValue))) {
500
- this.addError(`Duplicate key '${keyValue}'`, "duplicateKey", keyStart, keyEnd);
501
- }
502
- localKeysSeen.add(keyValue);
503
- if (this.lexer.getCurrentChar() === ":") {
504
- this.lexer.advance();
1077
+ this.emitError(( localize(141, "Expected mapping key")), this.currentToken().startOffset, this.currentToken().endOffset, "expected-key");
1078
+ break;
505
1079
  }
506
- this.lexer.skipWhitespace();
1080
+ this.skipFlowWhitespace();
507
1081
  let value;
508
- const valueStart = this.lexer.getCurrentPosition();
509
- if (this.lexer.getCurrentChar() === "" || this.lexer.getCurrentChar() === "#") {
510
- this.lexer.advanceLine();
511
- if (!this.lexer.isAtEnd()) {
512
- const nextIndent = this.lexer.getIndentation();
513
- if (nextIndent > currentIndent) {
514
- this.lexer.skipWhitespace();
515
- if (this.lexer.getCurrentChar() === "-") {
516
- value = this.parseBlockArray(nextIndent);
517
- } else {
518
- const currentLine = this.lexer.getCurrentLineText();
519
- const currentPos = this.lexer.getCurrentCharNumber();
520
- const remainingLine = currentLine.substring(currentPos);
521
- if (remainingLine.includes(":") && !remainingLine.trim().startsWith("#")) {
522
- value = this.parseBlockObject(nextIndent);
523
- } else {
524
- value = this.parseValue();
525
- }
526
- }
527
- } else if (!fromCurrentPosition && nextIndent === currentIndent) {
528
- this.lexer.skipWhitespace();
529
- if (this.lexer.getCurrentChar() === "-") {
530
- value = this.parseBlockArray(currentIndent);
531
- } else {
532
- value = createStringNode("", valueStart, valueStart);
533
- }
534
- } else {
535
- value = createStringNode("", valueStart, valueStart);
536
- }
537
- } else {
538
- value = createStringNode("", valueStart, valueStart);
539
- }
1082
+ if (this.currentToken().type === TokenType.Colon) {
1083
+ this.advance();
1084
+ this.skipFlowWhitespace();
1085
+ value = this.parseFlowValue();
540
1086
  } else {
541
- value = this.parseValue();
542
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== "" && this.lexer.getCurrentChar() !== "#") {
543
- if (isWhitespace(this.lexer.getCurrentChar())) {
544
- this.lexer.advance();
545
- } else {
546
- break;
547
- }
548
- }
549
- if (this.lexer.getCurrentChar() === "#") {
550
- this.lexer.skipToEndOfLine();
551
- }
552
- if (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() === "") {
553
- this.lexer.advanceLine();
554
- }
1087
+ value = this.makeEmptyScalar(key.endOffset);
555
1088
  }
556
1089
  properties.push({
557
1090
  key,
558
1091
  value
559
1092
  });
1093
+ this.skipFlowWhitespace();
1094
+ if (this.currentToken().type === TokenType.Comma) {
1095
+ this.advance();
1096
+ this.skipFlowWhitespace();
1097
+ }
560
1098
  }
561
- let end = start;
562
- if (properties.length > 0) {
563
- const lastProperty = properties[properties.length - 1];
564
- end = lastProperty.value.end;
1099
+ const endToken = this.currentToken();
1100
+ if (endToken.type === TokenType.FlowMapEnd) {
1101
+ this.advance();
1102
+ } else {
1103
+ this.emitError(( localize(142, "Expected \"}\"")), endToken.startOffset, endToken.endOffset, "expected-flow-map-end");
565
1104
  }
566
- return createObjectNode(properties, start, end);
1105
+ return {
1106
+ type: "map",
1107
+ properties,
1108
+ style: "flow",
1109
+ startOffset: startToken.startOffset,
1110
+ endOffset: endToken.type === TokenType.FlowMapEnd ? endToken.endOffset : endToken.startOffset
1111
+ };
567
1112
  }
568
- parse() {
569
- if (this.lexer.isAtEnd()) {
570
- return undefined;
571
- }
572
- this.lexer.moveToNextNonEmptyLine();
573
- if (this.lexer.isAtEnd()) {
574
- return undefined;
575
- }
576
- this.lexer.skipWhitespace();
577
- if (this.lexer.getCurrentChar() === "-") {
578
- const nextChar = this.lexer.peek();
579
- if (nextChar === " " || nextChar === "\t" || nextChar === "" || nextChar === "#") {
580
- return this.parseBlockArray(0);
1113
+ parseFlowSeq() {
1114
+ const startToken = this.advance();
1115
+ const items = [];
1116
+ this.skipFlowWhitespace();
1117
+ while (this.currentToken().type !== TokenType.FlowSeqEnd && this.currentToken().type !== TokenType.EOF) {
1118
+ let item;
1119
+ if (this.currentToken().type === TokenType.FlowMapStart) {
1120
+ item = this.parseFlowMap();
1121
+ } else if (this.currentToken().type === TokenType.FlowSeqStart) {
1122
+ item = this.parseFlowSeq();
1123
+ } else if (this.currentToken().type === TokenType.Scalar) {
1124
+ item = this.parseFlowScalar();
581
1125
  } else {
582
- return this.parseValue();
1126
+ this.emitError(( localize(143, "Unexpected token in flow sequence")), this.currentToken().startOffset, this.currentToken().endOffset, "unexpected-token");
1127
+ this.advance();
1128
+ continue;
1129
+ }
1130
+ items.push(item);
1131
+ this.skipFlowWhitespace();
1132
+ if (this.currentToken().type === TokenType.Comma) {
1133
+ this.advance();
1134
+ this.skipFlowWhitespace();
583
1135
  }
584
- } else if (this.lexer.getCurrentChar() === "[") {
585
- return this.parseInlineArray();
586
- } else if (this.lexer.getCurrentChar() === "{") {
587
- return this.parseInlineObject();
1136
+ }
1137
+ const endToken = this.currentToken();
1138
+ if (endToken.type === TokenType.FlowSeqEnd) {
1139
+ this.advance();
588
1140
  } else {
589
- const currentLine = this.lexer.getCurrentLineText();
590
- const currentPos = this.lexer.getCurrentCharNumber();
591
- const remainingLine = currentLine.substring(currentPos);
592
- let hasColon = false;
593
- let inQuotes = false;
594
- let quoteChar = "";
595
- for (let i = 0; i < remainingLine.length; i++) {
596
- const char = remainingLine[i];
597
- if (!inQuotes && (char === "\"" || char === `'`)) {
598
- inQuotes = true;
599
- quoteChar = char;
600
- } else if (inQuotes && char === quoteChar) {
601
- inQuotes = false;
602
- quoteChar = "";
603
- } else if (!inQuotes && char === ":") {
604
- hasColon = true;
605
- break;
606
- } else if (!inQuotes && char === "#") {
1141
+ this.emitError(( localize(144, "Expected \"]\"")), endToken.startOffset, endToken.endOffset, "expected-flow-seq-end");
1142
+ }
1143
+ return {
1144
+ type: "sequence",
1145
+ items,
1146
+ style: "flow",
1147
+ startOffset: startToken.startOffset,
1148
+ endOffset: endToken.type === TokenType.FlowSeqEnd ? endToken.endOffset : endToken.startOffset
1149
+ };
1150
+ }
1151
+ parseFlowScalar() {
1152
+ const token = this.advance();
1153
+ if (token.format !== "none") {
1154
+ return this.scalarFromToken(token);
1155
+ }
1156
+ let value = token.value;
1157
+ let endOffset = token.endOffset;
1158
+ while (true) {
1159
+ let hasNewline = false;
1160
+ let p = this.pos;
1161
+ while (p < this.tokens.length) {
1162
+ const t = this.tokens[p];
1163
+ if (t.type === TokenType.Newline) {
1164
+ hasNewline = true;
1165
+ p++;
1166
+ } else if (t.type === TokenType.Indent || t.type === TokenType.Comment) {
1167
+ p++;
1168
+ } else {
607
1169
  break;
608
1170
  }
609
1171
  }
610
- if (hasColon) {
611
- return this.parseBlockObject(0);
1172
+ if (!hasNewline || p >= this.tokens.length) {
1173
+ break;
1174
+ }
1175
+ const nextToken = this.tokens[p];
1176
+ if (nextToken.type === TokenType.Scalar && nextToken.format === "none") {
1177
+ this.pos = p + 1;
1178
+ value += " " + nextToken.value;
1179
+ endOffset = nextToken.endOffset;
612
1180
  } else {
613
- return this.parseValue();
1181
+ break;
614
1182
  }
615
1183
  }
1184
+ return {
1185
+ type: "scalar",
1186
+ value,
1187
+ rawValue: this.input.substring(token.startOffset, endOffset),
1188
+ startOffset: token.startOffset,
1189
+ endOffset,
1190
+ format: "none"
1191
+ };
1192
+ }
1193
+ parseFlowValue() {
1194
+ if (this.currentToken().type === TokenType.FlowMapStart) {
1195
+ return this.parseFlowMap();
1196
+ } else if (this.currentToken().type === TokenType.FlowSeqStart) {
1197
+ return this.parseFlowSeq();
1198
+ } else if (this.currentToken().type === TokenType.Scalar) {
1199
+ return this.parseFlowScalar();
1200
+ } else {
1201
+ return this.makeEmptyScalar(this.currentToken().startOffset);
1202
+ }
1203
+ }
1204
+ skipFlowWhitespace() {
1205
+ while (true) {
1206
+ const t = this.currentToken().type;
1207
+ if (t === TokenType.Newline || t === TokenType.Indent || t === TokenType.Comment) {
1208
+ this.advance();
1209
+ } else {
1210
+ break;
1211
+ }
1212
+ }
1213
+ }
1214
+ scalarFromToken(token) {
1215
+ return {
1216
+ type: "scalar",
1217
+ value: token.value,
1218
+ rawValue: token.rawValue,
1219
+ startOffset: token.startOffset,
1220
+ endOffset: token.endOffset,
1221
+ format: token.format
1222
+ };
1223
+ }
1224
+ makeEmptyScalar(offset) {
1225
+ return {
1226
+ type: "scalar",
1227
+ value: "",
1228
+ rawValue: "",
1229
+ startOffset: offset,
1230
+ endOffset: offset,
1231
+ format: "none"
1232
+ };
616
1233
  }
617
1234
  }
618
1235