@codingame/monaco-vscode-api 1.82.6 → 1.83.0-next.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 (199) hide show
  1. package/api.js +5 -5
  2. package/assets/index-no-csp.html +2 -1
  3. package/assets/index.html +3 -2
  4. package/extensions.js +17 -14
  5. package/external/xterm/typings/xterm.d.ts +171 -109
  6. package/missing-services.js +33 -22
  7. package/monaco-editor-treemending.patch +1745 -1628
  8. package/monaco-treemending.js +2 -2
  9. package/monaco.js +2 -2
  10. package/package.json +2 -2
  11. package/service-override/extensions.js +10 -11
  12. package/services.d.ts +1 -1
  13. package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
  14. package/vscode/src/vs/base/common/event.d.ts +13 -17
  15. package/vscode/src/vs/base/common/keyCodes.d.ts +18 -18
  16. package/vscode/src/vs/base/common/lifecycle.d.ts +9 -0
  17. package/vscode/src/vs/base/common/observableInternal/base.d.ts +2 -0
  18. package/vscode/src/vs/base/common/product.d.ts +1 -0
  19. package/vscode/src/vs/base/parts/ipc/common/ipc.js +6 -2
  20. package/vscode/src/vs/base/parts/storage/common/storage.d.ts +1 -0
  21. package/vscode/src/vs/editor/common/config/editorOptions.d.ts +12 -3
  22. package/vscode/src/vs/editor/common/core/lineRange.d.ts +0 -5
  23. package/vscode/src/vs/editor/common/core/offsetRange.d.ts +9 -2
  24. package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +6 -20
  25. package/vscode/src/vs/editor/common/diff/legacyLinesDiffComputer.d.ts +2 -2
  26. package/vscode/src/vs/editor/common/diff/linesDiffComputer.d.ts +5 -55
  27. package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +55 -0
  28. package/vscode/src/vs/editor/common/languages.d.ts +7 -10
  29. package/vscode/src/vs/editor/common/model.d.ts +1 -1
  30. package/vscode/src/vs/platform/actions/common/actions.d.ts +1 -0
  31. package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +5 -5
  32. package/vscode/src/vs/platform/files/common/fileService.js +46 -40
  33. package/vscode/src/vs/platform/files/common/files.d.ts +46 -1
  34. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +45 -0
  35. package/vscode/src/vs/platform/storage/common/storage.d.ts +5 -0
  36. package/vscode/src/vs/platform/storage/common/storage.js +4 -0
  37. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +4 -1
  38. package/vscode/src/vs/platform/terminal/common/terminal.js +1 -3
  39. package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +1 -1
  40. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +1 -0
  41. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +11 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +50 -0
  43. package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +3 -2
  44. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +16 -11
  45. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +20 -6
  46. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +2 -2
  47. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
  48. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +8 -8
  49. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +3 -2
  50. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +93 -0
  51. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -166
  52. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -0
  53. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +18 -11
  54. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +14 -9
  55. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -1
  56. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +11 -2
  57. package/vscode/src/vs/workbench/api/common/extHostChat.js +10 -1
  58. package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +62 -0
  59. package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +13 -4
  60. package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -4
  61. package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
  62. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +36 -4
  63. package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +6 -29
  64. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +24 -12
  65. package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +0 -2
  66. package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.js +0 -63
  67. package/vscode/src/vs/workbench/api/common/extHostSCM.js +80 -0
  68. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +24 -0
  69. package/vscode/src/vs/workbench/api/common/extHostTesting.js +14 -10
  70. package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +4 -4
  71. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +11 -7
  72. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +34 -16
  73. package/vscode/src/vs/workbench/api/common/extHostTypes.js +31 -13
  74. package/vscode/src/vs/workbench/api/common/extHostWebview.js +14 -2
  75. package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.js +11 -5
  76. package/vscode/src/vs/workbench/api/common/extensionHostMain.js +1 -1
  77. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +32 -9
  78. package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +3 -1
  79. package/vscode/src/vs/workbench/browser/codeeditor.js +1 -1
  80. package/vscode/src/vs/workbench/browser/dnd.js +7 -6
  81. package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
  82. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +7 -10
  83. package/vscode/src/vs/workbench/browser/parts/editor/editor.js +7 -1
  84. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +9 -3
  85. package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +1 -1
  86. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +9 -2
  87. package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +44 -14
  88. package/vscode/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +1 -1
  89. package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -19
  90. package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
  91. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -3
  92. package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +1 -1
  93. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +10 -9
  94. package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +2 -0
  95. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -2
  96. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -5
  97. package/vscode/src/vs/workbench/browser/web.api.d.ts +0 -6
  98. package/vscode/src/vs/workbench/browser/workbench.contribution.js +34 -3
  99. package/vscode/src/vs/workbench/common/contextkeys.js +2 -1
  100. package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +4 -4
  101. package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +0 -1
  102. package/vscode/src/vs/workbench/common/editor/editorInput.js +2 -4
  103. package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +0 -1
  104. package/vscode/src/vs/workbench/common/editor/editorModel.js +1 -3
  105. package/vscode/src/vs/workbench/common/editor.d.ts +2 -0
  106. package/vscode/src/vs/workbench/common/theme.js +21 -1
  107. package/vscode/src/vs/workbench/common/views.d.ts +1 -1
  108. package/vscode/src/vs/workbench/common/views.js +1 -2
  109. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +12 -4
  110. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +335 -0
  111. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +81 -27
  112. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
  113. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +22 -14
  114. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +2 -0
  115. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +136 -0
  116. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +14 -3
  117. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +78 -1
  118. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -17
  119. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +30 -26
  120. package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +1 -1
  121. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +23 -18
  122. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +8 -8
  123. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +55 -20
  124. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +26 -10
  125. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +7 -6
  126. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +58 -9
  127. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +9 -6
  128. package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +171 -0
  129. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +204 -33
  130. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +3 -7
  131. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +2 -2
  132. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
  133. package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +21 -4
  134. package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +22 -0
  135. package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +5 -2
  136. package/vscode/src/vs/workbench/contrib/debug/common/debugUtils.js +2 -1
  137. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -1
  138. package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +2 -2
  139. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +4 -4
  140. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
  141. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +7 -4
  142. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -1
  143. package/vscode/src/vs/workbench/contrib/files/common/files.js +7 -5
  144. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
  145. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +2 -2
  146. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +2 -1
  147. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +17 -17
  148. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +2 -2
  149. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +4 -1
  150. package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +22 -19
  151. package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +2 -38
  152. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +14 -1
  153. package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +3 -8
  154. package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +10 -12
  155. package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
  156. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +2 -2
  157. package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +0 -16
  158. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +2 -1
  159. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +8 -6
  160. package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +2 -4
  161. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +2 -4
  162. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +7 -3
  163. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +2 -6
  164. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -20
  165. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +9 -13
  166. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -1
  167. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +47 -15
  168. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +14 -4
  169. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +22 -3
  170. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
  171. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +15 -14
  172. package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +12 -7
  173. package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +10 -6
  174. package/vscode/src/vs/workbench/services/extensions/common/extensions.js +27 -11
  175. package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +2 -5
  176. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +7 -11
  177. package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +20 -4
  178. package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +24 -16
  179. package/vscode/src/vs/workbench/services/output/common/output.js +1 -2
  180. package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +6 -6
  181. package/vscode/src/vs/workbench/services/preferences/common/preferences.js +4 -3
  182. package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.d.ts +0 -1
  183. package/vscode/src/vs/workbench/services/search/common/fileSearchManager.js +3 -1
  184. package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
  185. package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +1 -2
  186. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +2 -2
  187. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileService.js +3 -8
  188. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +3 -4
  189. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +1 -0
  190. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +2 -1
  191. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.js +4 -2
  192. package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +0 -180
  193. package/vscode/src/vs/platform/credentials/common/credentials.d.ts +0 -13
  194. package/vscode/src/vs/platform/credentials/common/credentials.js +0 -3
  195. package/vscode/src/vs/workbench/api/browser/mainThreadKeytar.js +0 -31
  196. package/vscode/src/vs/workbench/browser/iframe.js +0 -16
  197. package/vscode/src/vs/workbench/browser/parts/editor/accessibilityStatus.js +0 -90
  198. package/vscode/src/vs/workbench/browser/parts/editor/tabFocus.js +0 -77
  199. package/vscode/src/vs/workbench/contrib/output/browser/logViewer.js +0 -67
@@ -9,7 +9,7 @@ import { URI } from '../../base/common/uri.js';
9
9
  import { ISingleEditOperation } from './core/editOperation.js';
10
10
  import { Position, IPosition } from './core/position.js';
11
11
  import { Range, IRange } from './core/range.js';
12
- import { Selection, ISelection } from './core/selection.js';
12
+ import { Selection } from './core/selection.js';
13
13
  import { LanguageId } from './encodedTokenAttributes.js';
14
14
  import { ITextModel, EndOfLineSequence } from './model.js';
15
15
  import { ExtensionIdentifier } from '../../platform/extensions/common/extensions.js';
@@ -865,10 +865,6 @@ interface FormattingOptions {
865
865
  * Prefer spaces over tabs.
866
866
  */
867
867
  insertSpaces: boolean;
868
- /**
869
- * The list of multiple ranges to format at once, if the provider supports it.
870
- */
871
- ranges?: Range[];
872
868
  }
873
869
  /**
874
870
  * The document formatting provider interface defines the contract between extensions and
@@ -1258,13 +1254,14 @@ interface DocumentOnDropEditProvider {
1258
1254
  readonly dropMimeTypes?: readonly string[];
1259
1255
  provideDocumentOnDropEdits(model: ITextModel, position: IPosition, dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): ProviderResult<DocumentOnDropEdit>;
1260
1256
  }
1261
- interface RelatedContextItem {
1257
+ interface DocumentContextItem {
1262
1258
  readonly uri: URI;
1263
- readonly range: IRange;
1259
+ readonly version: number;
1260
+ readonly ranges: IRange[];
1264
1261
  }
1265
1262
  interface MappedEditsContext {
1266
- selections: ISelection[];
1267
- related: RelatedContextItem[];
1263
+ /** The outer array is sorted by priority - from highest to lowest. The inner arrays contain elements of the same priority. */
1264
+ documents: DocumentContextItem[][];
1268
1265
  }
1269
1266
  interface MappedEditsProvider {
1270
1267
  /**
@@ -1280,4 +1277,4 @@ interface MappedEditsProvider {
1280
1277
  provideMappedEdits(document: ITextModel, codeBlocks: string[], context: MappedEditsContext, token: CancellationToken): Promise<WorkspaceEdit | null>;
1281
1278
  }
1282
1279
 
1283
- export { type CodeAction, type CodeActionContext, type CodeActionList, type CodeActionProvider, CodeActionTriggerType, type CodeLens, type CodeLensList, type CodeLensProvider, Command, type CompletionContext, type CompletionItem, CompletionItemInsertTextRule, CompletionItemKind, type CompletionItemLabel, type CompletionItemProvider, type CompletionItemRanges, CompletionItemTag, type CompletionList, CompletionTriggerKind, type DeclarationProvider, type Definition, type DefinitionProvider, type DocumentColorProvider, type DocumentFormattingEditProvider, type DocumentHighlight, DocumentHighlightKind, type DocumentHighlightProvider, type DocumentOnDropEdit, type DocumentOnDropEditProvider, type DocumentPasteEdit, type DocumentPasteEditProvider, type DocumentRangeFormattingEditProvider, type DocumentRangeSemanticTokensProvider, type DocumentSemanticTokensProvider, type DocumentSymbol, type DocumentSymbolProvider, type DropYieldTo, type EvaluatableExpression, type EvaluatableExpressionProvider, type FoldingContext, type FoldingRange, FoldingRangeKind, type FoldingRangeProvider, type FormattingOptions, type Hover, type HoverProvider, type IColor, type IColorInformation, type IColorPresentation, type IInplaceReplaceSupportResult, type ILanguageIdCodec, type ILink, type ILinksList, type IWorkspaceFileEdit, type IWorkspaceTextEdit, type ImplementationProvider, type InlayHint, InlayHintKind, type InlayHintLabelPart, type InlayHintList, type InlayHintsProvider, type InlineCompletion, type InlineCompletionContext, type InlineCompletionProviderGroupId, InlineCompletionTriggerKind, type InlineCompletions, type InlineCompletionsProvider, type InlineValue, type InlineValueContext, type InlineValueExpression, type InlineValueText, type InlineValueVariableLookup, type InlineValuesProvider, type LinkProvider, type LinkedEditingRangeProvider, type LinkedEditingRanges, type Location, type LocationLink, type MappedEditsContext, type MappedEditsProvider, type OnTypeFormattingEditProvider, type ParameterInformation, type ProviderResult, type ReferenceContext, type ReferenceProvider, type Rejection, type RelatedContextItem, type RenameLocation, type RenameProvider, SelectedSuggestionInfo, type SelectionRange, type SelectionRangeProvider, type SemanticTokens, type SemanticTokensEdit, type SemanticTokensEdits, type SemanticTokensLegend, type SignatureHelp, type SignatureHelpContext, type SignatureHelpProvider, type SignatureHelpResult, SignatureHelpTriggerKind, type SignatureInformation, SymbolKind, SymbolTag, TextEdit, type TypeDefinitionProvider, type WorkspaceEdit, type WorkspaceEditMetadata, type WorkspaceFileEditOptions };
1280
+ export { type CodeAction, type CodeActionContext, type CodeActionList, type CodeActionProvider, CodeActionTriggerType, type CodeLens, type CodeLensList, type CodeLensProvider, Command, type CompletionContext, type CompletionItem, CompletionItemInsertTextRule, CompletionItemKind, type CompletionItemLabel, type CompletionItemProvider, type CompletionItemRanges, CompletionItemTag, type CompletionList, CompletionTriggerKind, type DeclarationProvider, type Definition, type DefinitionProvider, type DocumentColorProvider, type DocumentContextItem, type DocumentFormattingEditProvider, type DocumentHighlight, DocumentHighlightKind, type DocumentHighlightProvider, type DocumentOnDropEdit, type DocumentOnDropEditProvider, type DocumentPasteEdit, type DocumentPasteEditProvider, type DocumentRangeFormattingEditProvider, type DocumentRangeSemanticTokensProvider, type DocumentSemanticTokensProvider, type DocumentSymbol, type DocumentSymbolProvider, type DropYieldTo, type EvaluatableExpression, type EvaluatableExpressionProvider, type FoldingContext, type FoldingRange, FoldingRangeKind, type FoldingRangeProvider, type FormattingOptions, type Hover, type HoverProvider, type IColor, type IColorInformation, type IColorPresentation, type IInplaceReplaceSupportResult, type ILanguageIdCodec, type ILink, type ILinksList, type IWorkspaceFileEdit, type IWorkspaceTextEdit, type ImplementationProvider, type InlayHint, InlayHintKind, type InlayHintLabelPart, type InlayHintList, type InlayHintsProvider, type InlineCompletion, type InlineCompletionContext, type InlineCompletionProviderGroupId, InlineCompletionTriggerKind, type InlineCompletions, type InlineCompletionsProvider, type InlineValue, type InlineValueContext, type InlineValueExpression, type InlineValueText, type InlineValueVariableLookup, type InlineValuesProvider, type LinkProvider, type LinkedEditingRangeProvider, type LinkedEditingRanges, type Location, type LocationLink, type MappedEditsContext, type MappedEditsProvider, type OnTypeFormattingEditProvider, type ParameterInformation, type ProviderResult, type ReferenceContext, type ReferenceProvider, type Rejection, type RenameLocation, type RenameProvider, SelectedSuggestionInfo, type SelectionRange, type SelectionRangeProvider, type SemanticTokens, type SemanticTokensEdit, type SemanticTokensEdits, type SemanticTokensLegend, type SignatureHelp, type SignatureHelpContext, type SignatureHelpProvider, type SignatureHelpResult, SignatureHelpTriggerKind, type SignatureInformation, SymbolKind, SymbolTag, TextEdit, type TypeDefinitionProvider, type WorkspaceEdit, type WorkspaceEditMetadata, type WorkspaceFileEditOptions };
@@ -499,7 +499,7 @@ declare class SearchData {
499
499
  /**
500
500
  * @internal
501
501
  */
502
- interface ITextBuffer extends IReadonlyTextBuffer {
502
+ interface ITextBuffer extends IReadonlyTextBuffer, IDisposable {
503
503
  setEOL(newEOL: '\r\n' | '\n'): void;
504
504
  applyEdits(rawOperations: ValidAnnotatedEditOperation[], recordTrimAutoWhitespace: boolean, computeUndoEdits: boolean): ApplyEditsResult;
505
505
  }
@@ -53,6 +53,7 @@ declare class MenuId {
53
53
  static readonly ExtensionContext: MenuId;
54
54
  static readonly GlobalActivity: MenuId;
55
55
  static readonly CommandCenter: MenuId;
56
+ static readonly CommandCenterCenter: MenuId;
56
57
  static readonly LayoutControlMenuSubmenu: MenuId;
57
58
  static readonly LayoutControlMenu: MenuId;
58
59
  static readonly MenubarMainMenu: MenuId;
@@ -1,15 +1,15 @@
1
1
  import { isString, isObject } from 'monaco-editor/esm/vs/base/common/types.js';
2
2
  import { localize } from 'monaco-editor/esm/vs/nls.js';
3
- function localizeManifest(extensionManifest, translations, fallbackTranslations) {
3
+ function localizeManifest(logger, extensionManifest, translations, fallbackTranslations) {
4
4
  try {
5
- replaceNLStrings(extensionManifest, translations, fallbackTranslations);
5
+ replaceNLStrings(logger, extensionManifest, translations, fallbackTranslations);
6
6
  }
7
7
  catch (error) {
8
- console.error(error?.message ?? error);
8
+ logger.error(error?.message ?? error);
9
9
  }
10
10
  return extensionManifest;
11
11
  }
12
- function replaceNLStrings(extensionManifest, messages, originalMessages) {
12
+ function replaceNLStrings(logger, extensionManifest, messages, originalMessages) {
13
13
  const processEntry = (obj, key, command) => {
14
14
  const value = obj[key];
15
15
  if (isString(value)) {
@@ -26,7 +26,7 @@ function replaceNLStrings(extensionManifest, messages, originalMessages) {
26
26
  const originalMessage = typeof original === 'string' ? original : original?.message;
27
27
  if (!message) {
28
28
  if (!originalMessage) {
29
- console.warn(`[${extensionManifest.name}]: ${( ( localize('missingNLSKey', "Couldn't find message for key {0}.", messageKey)))}`);
29
+ logger.warn(`[${extensionManifest.name}]: ${( ( localize('missingNLSKey', "Couldn't find message for key {0}.", messageKey)))}`);
30
30
  }
31
31
  return;
32
32
  }
@@ -10,10 +10,10 @@ import { Disposable, toDisposable, dispose, DisposableStore } from 'monaco-edito
10
10
  import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/ternarySearchTree.js';
11
11
  import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
12
12
  import { mark } from 'monaco-editor/esm/vs/base/common/performance.js';
13
- import { isAbsolutePath, joinPath, dirname, basename, extUri, extUriIgnorePathCase } from 'monaco-editor/esm/vs/base/common/resources.js';
13
+ import { isAbsolutePath, extUri, extUriIgnorePathCase } from 'monaco-editor/esm/vs/base/common/resources.js';
14
14
  import { isReadableStream, peekStream, peekReadable, consumeStream, transform, newWriteableStream, isReadableBufferedStream, listenStream } from 'monaco-editor/esm/vs/base/common/stream.js';
15
15
  import { localize } from 'monaco-editor/esm/vs/nls.js';
16
- import { FileChangesEvent, FileOperationError, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, ensureFileSystemProviderError, FileType, FilePermission, etag, FileOperationEvent, toFileOperationResult, ETAG_DISABLED, hasFileAtomicReadCapability, NotModifiedSinceFileOperationError, TooLargeFileOperationError, hasFileFolderCopyCapability, hasFileCloneCapability } from 'monaco-editor/esm/vs/platform/files/common/files.js';
16
+ import { FileChangesEvent, FileOperationError, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, ensureFileSystemProviderError, FileType, FilePermission, etag, FileOperationEvent, hasFileAtomicWriteCapability, toFileOperationResult, ETAG_DISABLED, hasFileAtomicReadCapability, NotModifiedSinceFileOperationError, TooLargeFileOperationError, hasFileFolderCopyCapability, hasFileAtomicDeleteCapability, hasFileCloneCapability } from 'monaco-editor/esm/vs/platform/files/common/files.js';
17
17
  import { readFileIntoStream } from './io.js';
18
18
  import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
19
19
  import { ErrorNoTelemetry } from 'monaco-editor/esm/vs/base/common/errors.js';
@@ -246,8 +246,15 @@ let FileService = class FileService extends Disposable {
246
246
  async writeFile(resource, bufferOrReadableOrStream, options) {
247
247
  const provider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(resource), resource);
248
248
  const { providerExtUri } = this.getExtUri(provider);
249
+ let writeFileOptions = options;
250
+ if (hasFileAtomicWriteCapability(provider) && !writeFileOptions?.atomic) {
251
+ const enforcedAtomicWrite = provider.enforceAtomicWriteFile?.(resource);
252
+ if (enforcedAtomicWrite) {
253
+ writeFileOptions = { ...options, atomic: enforcedAtomicWrite };
254
+ }
255
+ }
249
256
  try {
250
- const stat = await this.validateWriteFile(provider, resource, options);
257
+ const stat = await this.validateWriteFile(provider, resource, writeFileOptions);
251
258
  if (!stat) {
252
259
  await this.mkdirp(provider, providerExtUri.dirname(resource));
253
260
  }
@@ -269,22 +276,19 @@ let FileService = class FileService extends Disposable {
269
276
  else {
270
277
  bufferOrReadableOrStreamOrBufferedStream = bufferOrReadableOrStream;
271
278
  }
272
- if (!hasOpenReadWriteCloseCapability(provider) || (hasReadWriteCapability(provider) && bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer)) {
273
- await this.doWriteUnbuffered(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream);
279
+ if (!hasOpenReadWriteCloseCapability(provider) ||
280
+ (hasReadWriteCapability(provider) && bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer) ||
281
+ (hasReadWriteCapability(provider) && hasFileAtomicWriteCapability(provider) && writeFileOptions?.atomic)
282
+ ) {
283
+ await this.doWriteUnbuffered(provider, resource, writeFileOptions, bufferOrReadableOrStreamOrBufferedStream);
274
284
  }
275
285
  else {
276
- const contents = bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer ? bufferToReadable(bufferOrReadableOrStreamOrBufferedStream) : bufferOrReadableOrStreamOrBufferedStream;
277
- if (options?.atomic !== false && options?.atomic?.postfix) {
278
- await this.doWriteBufferedAtomic(provider, resource, joinPath(dirname(resource), `${basename(resource)}${options.atomic.postfix}`), options, contents);
279
- }
280
- else {
281
- await this.doWriteBuffered(provider, resource, options, contents);
282
- }
286
+ await this.doWriteBuffered(provider, resource, writeFileOptions, bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer ? bufferToReadable(bufferOrReadableOrStreamOrBufferedStream) : bufferOrReadableOrStreamOrBufferedStream);
283
287
  }
284
288
  this._onDidRunOperation.fire(( new FileOperationEvent(resource, 4 )));
285
289
  }
286
290
  catch (error) {
287
- throw new FileOperationError(localize('err.write', "Unable to write file '{0}' ({1})", this.resourceForError(resource), ensureFileSystemProviderError(error).toString()), toFileOperationResult(error), options);
291
+ throw new FileOperationError(localize('err.write', "Unable to write file '{0}' ({1})", this.resourceForError(resource), ensureFileSystemProviderError(error).toString()), toFileOperationResult(error), writeFileOptions);
288
292
  }
289
293
  return this.resolve(resource, { resolveMetadata: true });
290
294
  }
@@ -296,7 +300,10 @@ let FileService = class FileService extends Disposable {
296
300
  const atomic = !!options?.atomic;
297
301
  if (atomic) {
298
302
  if (!((provider.capabilities & 32768) )) {
299
- throw new Error(localize('writeFailedAtomicUnsupported', "Unable to atomically write file '{0}' because provider does not support it.", this.resourceForError(resource)));
303
+ throw new Error(localize('writeFailedAtomicUnsupported1', "Unable to atomically write file '{0}' because provider does not support it.", this.resourceForError(resource)));
304
+ }
305
+ if (!((provider.capabilities & 2) )) {
306
+ throw new Error(localize('writeFailedAtomicUnsupported2', "Unable to atomically write file '{0}' because provider does not support unbuffered writes.", this.resourceForError(resource)));
300
307
  }
301
308
  if (unlock) {
302
309
  throw new Error(localize('writeFailedAtomicUnlock', "Unable to unlock file '{0}' because atomic write is enabled.", this.resourceForError(resource)));
@@ -356,27 +363,33 @@ let FileService = class FileService extends Disposable {
356
363
  }
357
364
  async doReadFileStream(provider, resource, options, token) {
358
365
  const cancellableSource = ( new CancellationTokenSource(token));
359
- const statPromise = this.validateReadFile(resource, options).then(stat => stat, error => {
360
- cancellableSource.cancel();
366
+ let readFileOptions = options;
367
+ if (hasFileAtomicReadCapability(provider) && provider.enforceAtomicReadFile?.(resource)) {
368
+ readFileOptions = { ...options, atomic: true };
369
+ }
370
+ const statPromise = this.validateReadFile(resource, readFileOptions).then(stat => stat, error => {
371
+ cancellableSource.dispose(true);
361
372
  throw error;
362
373
  });
363
374
  let fileStream = undefined;
364
375
  try {
365
- if (typeof options?.etag === 'string' && options.etag !== ETAG_DISABLED) {
376
+ if (typeof readFileOptions?.etag === 'string' && readFileOptions.etag !== ETAG_DISABLED) {
366
377
  await statPromise;
367
378
  }
368
- if ((options?.atomic && hasFileAtomicReadCapability(provider)) ||
379
+ if ((readFileOptions?.atomic && hasFileAtomicReadCapability(provider)) ||
369
380
  !(hasOpenReadWriteCloseCapability(provider) || hasFileReadStreamCapability(provider)) ||
370
- (hasReadWriteCapability(provider) && options?.preferUnbuffered)
381
+ (hasReadWriteCapability(provider) && readFileOptions?.preferUnbuffered)
371
382
  ) {
372
- fileStream = this.readFileUnbuffered(provider, resource, options);
383
+ fileStream = this.readFileUnbuffered(provider, resource, readFileOptions);
373
384
  }
374
385
  else if (hasFileReadStreamCapability(provider)) {
375
- fileStream = this.readFileStreamed(provider, resource, cancellableSource.token, options);
386
+ fileStream = this.readFileStreamed(provider, resource, cancellableSource.token, readFileOptions);
376
387
  }
377
388
  else {
378
- fileStream = this.readFileBuffered(provider, resource, cancellableSource.token, options);
389
+ fileStream = this.readFileBuffered(provider, resource, cancellableSource.token, readFileOptions);
379
390
  }
391
+ fileStream.on('end', () => cancellableSource.dispose());
392
+ fileStream.on('error', () => cancellableSource.dispose());
380
393
  const fileStat = await statPromise;
381
394
  return {
382
395
  ...fileStat,
@@ -387,7 +400,7 @@ let FileService = class FileService extends Disposable {
387
400
  if (fileStream) {
388
401
  await consumeStream(fileStream);
389
402
  }
390
- throw this.restoreReadError(error, resource, options);
403
+ throw this.restoreReadError(error, resource, readFileOptions);
391
404
  }
392
405
  }
393
406
  restoreReadError(error, resource, options) {
@@ -692,9 +705,16 @@ let FileService = class FileService extends Disposable {
692
705
  }
693
706
  async del(resource, options) {
694
707
  const provider = await this.doValidateDelete(resource, options);
695
- const useTrash = !!options?.useTrash;
696
- const recursive = !!options?.recursive;
697
- const atomic = options?.atomic ?? false;
708
+ let deleteFileOptions = options;
709
+ if (hasFileAtomicDeleteCapability(provider) && !deleteFileOptions?.atomic) {
710
+ const enforcedAtomicDelete = provider.enforceAtomicDelete?.(resource);
711
+ if (enforcedAtomicDelete) {
712
+ deleteFileOptions = { ...options, atomic: enforcedAtomicDelete };
713
+ }
714
+ }
715
+ const useTrash = !!deleteFileOptions?.useTrash;
716
+ const recursive = !!deleteFileOptions?.recursive;
717
+ const atomic = deleteFileOptions?.atomic ?? false;
698
718
  await provider.delete(resource, { recursive, useTrash, atomic });
699
719
  this._onDidRunOperation.fire(( new FileOperationEvent(resource, 1 )));
700
720
  }
@@ -764,20 +784,6 @@ let FileService = class FileService extends Disposable {
764
784
  }
765
785
  this.activeWatchers.clear();
766
786
  }
767
- async doWriteBufferedAtomic(provider, resource, tempResource, options, readableOrStreamOrBufferedStream) {
768
- await this.doWriteBuffered(provider, tempResource, options, readableOrStreamOrBufferedStream);
769
- try {
770
- await provider.rename(tempResource, resource, { overwrite: true });
771
- }
772
- catch (error) {
773
- try {
774
- await provider.delete(tempResource, { recursive: false, useTrash: false, atomic: false });
775
- }
776
- catch (error) {
777
- }
778
- throw error;
779
- }
780
- }
781
787
  async doWriteBuffered(provider, resource, options, readableOrStreamOrBufferedStream) {
782
788
  return this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => {
783
789
  const handle = await provider.open(resource, { create: true, unlock: options?.unlock ?? false });
@@ -222,6 +222,24 @@ interface IFileUnlockOptions {
222
222
  */
223
223
  readonly unlock: boolean;
224
224
  }
225
+ interface IFileAtomicReadOptions {
226
+ /**
227
+ * The optional `atomic` flag can be used to make sure
228
+ * the `readFile` method is not running in parallel with
229
+ * any `write` operations in the same process.
230
+ *
231
+ * Typically you should not need to use this flag but if
232
+ * for example you are quickly reading a file right after
233
+ * a file event occurred and the file changes a lot, there
234
+ * is a chance that a read returns an empty or partial file
235
+ * because a pending write has not finished yet.
236
+ *
237
+ * Note: this does not prevent the file from being written
238
+ * to from a different process. If you need such atomic
239
+ * operations, you better use a real database as storage.
240
+ */
241
+ readonly atomic: boolean;
242
+ }
225
243
  interface IFileAtomicOptions {
226
244
  /**
227
245
  * The postfix is used to create a temporary file based
@@ -244,6 +262,15 @@ interface IFileAtomicWriteOptions {
244
262
  */
245
263
  readonly atomic: IFileAtomicOptions | false;
246
264
  }
265
+ interface IFileAtomicDeleteOptions {
266
+ /**
267
+ * The optional `atomic` flag can be used to make sure
268
+ * the `delete` method deletes the target atomically by
269
+ * first renaming it to a temporary resource in the same
270
+ * folder and then deleting it.
271
+ */
272
+ readonly atomic: IFileAtomicOptions | false;
273
+ }
247
274
  interface IFileReadLimits {
248
275
  /**
249
276
  * If the file exceeds the given size, an error of kind
@@ -473,9 +500,27 @@ interface IFileSystemProviderWithFileReadWriteCapability extends IFileSystemProv
473
500
  readFile(resource: URI): Promise<Uint8Array>;
474
501
  writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
475
502
  }
503
+ interface IFileSystemProviderWithOpenReadWriteCloseCapability extends IFileSystemProvider {
504
+ open(resource: URI, opts: IFileOpenOptions): Promise<number>;
505
+ close(fd: number): Promise<void>;
506
+ read(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
507
+ write(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
508
+ }
476
509
  interface IFileSystemProviderWithFileReadStreamCapability extends IFileSystemProvider {
477
510
  readFileStream(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>;
478
511
  }
512
+ interface IFileSystemProviderWithFileAtomicReadCapability extends IFileSystemProvider {
513
+ readFile(resource: URI, opts?: IFileAtomicReadOptions): Promise<Uint8Array>;
514
+ enforceAtomicReadFile?(resource: URI): boolean;
515
+ }
516
+ interface IFileSystemProviderWithFileAtomicWriteCapability extends IFileSystemProvider {
517
+ writeFile(resource: URI, contents: Uint8Array, opts?: IFileAtomicWriteOptions): Promise<void>;
518
+ enforceAtomicWriteFile?(resource: URI): IFileAtomicOptions | false;
519
+ }
520
+ interface IFileSystemProviderWithFileAtomicDeleteCapability extends IFileSystemProvider {
521
+ delete(resource: URI, opts: IFileAtomicDeleteOptions): Promise<void>;
522
+ enforceAtomicDelete?(resource: URI): IFileAtomicOptions | false;
523
+ }
479
524
  declare enum FileSystemProviderErrorCode {
480
525
  FileExists = "EntryExists",
481
526
  FileNotFound = "EntryNotFound",
@@ -789,4 +834,4 @@ interface ICreateFileOptions {
789
834
  readonly overwrite?: boolean;
790
835
  }
791
836
 
792
- export { FileChangeType, FileChangesEvent, FileOperation, FileOperationEvent, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, type IBaseFileStat, type IBaseFileStatWithMetadata, type IBaseReadFileOptions, type ICreateFileOptions, type IFileAtomicOptions, type IFileAtomicWriteOptions, type IFileChange, type IFileContent, type IFileDeleteOptions, type IFileOpenForReadOptions, type IFileOpenForWriteOptions, type IFileOpenOptions, type IFileOperationEvent, type IFileOperationEventWithMetadata, type IFileOverwriteOptions, type IFileReadLimits, type IFileReadStreamOptions, IFileService, type IFileStat, type IFileStatResult, type IFileStatWithMetadata, type IFileStatWithPartialMetadata, type IFileStreamContent, type IFileSystemProvider, type IFileSystemProviderActivationEvent, type IFileSystemProviderCapabilitiesChangeEvent, type IFileSystemProviderError, type IFileSystemProviderRegistrationEvent, type IFileSystemProviderWithFileReadStreamCapability, type IFileSystemProviderWithFileReadWriteCapability, type IFileUnlockOptions, type IFileWriteOptions, type IReadFileOptions, type IReadFileStreamOptions, type IResolveFileOptions, type IResolveMetadataFileOptions, type IStat, type IWatchOptions, type IWriteFileOptions };
837
+ export { FileChangeType, FileChangesEvent, FileOperation, FileOperationEvent, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, type IBaseFileStat, type IBaseFileStatWithMetadata, type IBaseReadFileOptions, type ICreateFileOptions, type IFileAtomicDeleteOptions, type IFileAtomicOptions, type IFileAtomicReadOptions, type IFileAtomicWriteOptions, type IFileChange, type IFileContent, type IFileDeleteOptions, type IFileOpenForReadOptions, type IFileOpenForWriteOptions, type IFileOpenOptions, type IFileOperationEvent, type IFileOperationEventWithMetadata, type IFileOverwriteOptions, type IFileReadLimits, type IFileReadStreamOptions, IFileService, type IFileStat, type IFileStatResult, type IFileStatWithMetadata, type IFileStatWithPartialMetadata, type IFileStreamContent, type IFileSystemProvider, type IFileSystemProviderActivationEvent, type IFileSystemProviderCapabilitiesChangeEvent, type IFileSystemProviderError, type IFileSystemProviderRegistrationEvent, type IFileSystemProviderWithFileAtomicDeleteCapability, type IFileSystemProviderWithFileAtomicReadCapability, type IFileSystemProviderWithFileAtomicWriteCapability, type IFileSystemProviderWithFileReadStreamCapability, type IFileSystemProviderWithFileReadWriteCapability, type IFileSystemProviderWithOpenReadWriteCloseCapability, type IFileUnlockOptions, type IFileWriteOptions, type IReadFileOptions, type IReadFileStreamOptions, type IResolveFileOptions, type IResolveMetadataFileOptions, type IStat, type IWatchOptions, type IWriteFileOptions };
@@ -1,6 +1,8 @@
1
+ import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
1
2
  import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
2
3
  import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
4
  import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
5
+ import { newWriteableStream } from 'monaco-editor/esm/vs/base/common/stream.js';
4
6
  import { createFileSystemProviderError, FileSystemProviderErrorCode, FileType } from 'monaco-editor/esm/vs/platform/files/common/files.js';
5
7
  class File {
6
8
  constructor(name) {
@@ -24,6 +26,8 @@ class Directory {
24
26
  class InMemoryFileSystemProvider extends Disposable {
25
27
  constructor() {
26
28
  super(...arguments);
29
+ this.memoryFdCounter = 0;
30
+ this.fdMemory = ( new Map());
27
31
  this._onDidChangeCapabilities = this._register(( new Emitter()));
28
32
  this.onDidChangeCapabilities = this._onDidChangeCapabilities.event;
29
33
  this._capabilities = 2 | 1024 ;
@@ -57,6 +61,12 @@ class InMemoryFileSystemProvider extends Disposable {
57
61
  }
58
62
  throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
59
63
  }
64
+ readFileStream(resource) {
65
+ const data = this._lookupAsFile(resource, false).data;
66
+ const stream = newWriteableStream(data => VSBuffer.concat(( data.map(data => VSBuffer.wrap(data)))).buffer);
67
+ stream.end(data);
68
+ return stream;
69
+ }
60
70
  async writeFile(resource, content, opts) {
61
71
  const basename = resources.basename(resource);
62
72
  const parent = this._lookupParentDirectory(resource);
@@ -80,6 +90,37 @@ class InMemoryFileSystemProvider extends Disposable {
80
90
  entry.data = content;
81
91
  this._fireSoon({ type: 0 , resource });
82
92
  }
93
+ open(resource, opts) {
94
+ const data = this._lookupAsFile(resource, false).data;
95
+ if (data) {
96
+ const fd = this.memoryFdCounter++;
97
+ this.fdMemory.set(fd, data);
98
+ return Promise.resolve(fd);
99
+ }
100
+ throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
101
+ }
102
+ close(fd) {
103
+ this.fdMemory.delete(fd);
104
+ return Promise.resolve();
105
+ }
106
+ read(fd, pos, data, offset, length) {
107
+ const memory = this.fdMemory.get(fd);
108
+ if (!memory) {
109
+ throw createFileSystemProviderError(`No file with that descriptor open`, FileSystemProviderErrorCode.Unavailable);
110
+ }
111
+ const toWrite = VSBuffer.wrap(memory).slice(pos, pos + length);
112
+ data.set(toWrite.buffer, offset);
113
+ return Promise.resolve(toWrite.byteLength);
114
+ }
115
+ write(fd, pos, data, offset, length) {
116
+ const memory = this.fdMemory.get(fd);
117
+ if (!memory) {
118
+ throw createFileSystemProviderError(`No file with that descriptor open`, FileSystemProviderErrorCode.Unavailable);
119
+ }
120
+ const toWrite = VSBuffer.wrap(data).slice(offset, offset + length);
121
+ memory.set(toWrite.buffer, pos);
122
+ return Promise.resolve(toWrite.byteLength);
123
+ }
83
124
  async rename(from, to, opts) {
84
125
  if (!opts.overwrite && this._lookup(to, true)) {
85
126
  throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
@@ -171,5 +212,9 @@ class InMemoryFileSystemProvider extends Disposable {
171
212
  this._bufferedChanges.length = 0;
172
213
  }, 5);
173
214
  }
215
+ dispose() {
216
+ super.dispose();
217
+ this.fdMemory.clear();
218
+ }
174
219
  }
175
220
  export { InMemoryFileSystemProvider };
@@ -167,6 +167,10 @@ interface IStorageService {
167
167
  * existed before.
168
168
  */
169
169
  isNew(scope: StorageScope): boolean;
170
+ /**
171
+ * Attempts to reduce the DB size via optimization commands if supported.
172
+ */
173
+ optimize(scope: StorageScope): Promise<void>;
170
174
  /**
171
175
  * Allows to flush state, e.g. in cases where a shutdown is
172
176
  * imminent. This will send out the `onWillSaveState` to ask
@@ -284,6 +288,7 @@ declare abstract class AbstractStorageService extends Disposable implements ISto
284
288
  isNew(scope: StorageScope): boolean;
285
289
  flush(reason?: WillSaveStateReason): Promise<void>;
286
290
  log(): Promise<void>;
291
+ optimize(scope: StorageScope): Promise<void>;
287
292
  switch(to: IAnyWorkspaceIdentifier | IUserDataProfile, preserveData: boolean): Promise<void>;
288
293
  protected canSwitchProfile(from: IUserDataProfile, to: IUserDataProfile): boolean;
289
294
  protected switchData(oldStorage: Map<string, string>, newStorage: IStorage, scope: StorageScope): void;
@@ -239,6 +239,10 @@ class AbstractStorageService extends Disposable {
239
239
  const workspaceItems = this.getStorage(1 )?.items ?? ( new Map());
240
240
  return logStorage(applicationItems, profileItems, workspaceItems, this.getLogDetails(-1 ) ?? '', this.getLogDetails(0 ) ?? '', this.getLogDetails(1 ) ?? '');
241
241
  }
242
+ async optimize(scope) {
243
+ await this.flush();
244
+ return this.getStorage(scope)?.optimize();
245
+ }
242
246
  async switch(to, preserveData) {
243
247
  this.emitWillSaveState(WillSaveStateReason.NONE);
244
248
  if (isUserDataProfile(to)) {
@@ -18,9 +18,12 @@ function supportsTelemetry(productService, environmentService) {
18
18
  if (!environmentService.isBuilt && !environmentService.disableTelemetry) {
19
19
  return true;
20
20
  }
21
- return !(environmentService.disableTelemetry || !productService.enableTelemetry || environmentService.extensionTestsLocationURI);
21
+ return !(environmentService.disableTelemetry || !productService.enableTelemetry);
22
22
  }
23
23
  function isLoggingOnly(productService, environmentService) {
24
+ if (environmentService.extensionTestsLocationURI) {
25
+ return true;
26
+ }
24
27
  if (environmentService.isBuilt) {
25
28
  return false;
26
29
  }
@@ -1,7 +1,5 @@
1
1
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
- import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
3
2
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
4
- const terminalTabFocusModeContextKey = ( new RawContextKey('terminalTabFocusMode', false, true));
5
3
  var TitleEventSource;
6
4
  ( (function(TitleEventSource) {
7
5
  TitleEventSource[TitleEventSource["Api"] = 0] = "Api";
@@ -46,4 +44,4 @@ class TerminalBackendRegistry {
46
44
  }
47
45
  Registry.add(TerminalExtensions.Backend, ( new TerminalBackendRegistry()));
48
46
  const ITerminalLogService = ( createDecorator('terminalLogService'));
49
- export { ITerminalLogService, TerminalExitReason, TerminalExtensions, TerminalLocation, TitleEventSource, terminalTabFocusModeContextKey };
47
+ export { ITerminalLogService, TerminalExitReason, TerminalExtensions, TerminalLocation, TitleEventSource };
@@ -12,7 +12,7 @@ interface TunnelOptions {
12
12
  protocol?: string;
13
13
  }
14
14
  declare enum TunnelPrivacyId {
15
- ConstantPrivate = "constantPrivate",
15
+ ConstantPrivate = "constantPrivate",// private, and changing is unsupported
16
16
  Private = "private",
17
17
  Public = "public"
18
18
  }
@@ -19,6 +19,7 @@ interface IUserDataProfile {
19
19
  readonly isDefault: boolean;
20
20
  readonly name: string;
21
21
  readonly shortName?: string;
22
+ readonly icon?: string;
22
23
  readonly location: URI;
23
24
  readonly globalStorageHome: URI;
24
25
  readonly settingsResource: URI;
@@ -134,6 +134,17 @@ let MainThreadChat = class MainThreadChat extends Disposable {
134
134
  if (isCompleteInteractiveProgressTreeData(progress)) {
135
135
  return;
136
136
  }
137
+ if ('documents' in progress) {
138
+ const usedContext = {
139
+ documents: ( progress.documents.map(({ uri, version, ranges }) => ({
140
+ uri: URI.revive(uri),
141
+ version,
142
+ ranges,
143
+ }))),
144
+ };
145
+ this._activeRequestProgressCallbacks.get(id)?.(usedContext);
146
+ return;
147
+ }
137
148
  this._activeRequestProgressCallbacks.get(id)?.(progress);
138
149
  }
139
150
  async $acceptChatState(sessionId, state) {
@@ -0,0 +1,50 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
4
+ import { ExtHostContext, MainContext } from '../common/extHost.protocol.js';
5
+ import { IChatAgentService } from '../../contrib/chat/common/chatAgents.js';
6
+ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
7
+ let MainThreadChatAgents = class MainThreadChatAgents {
8
+ constructor(extHostContext, _chatAgentService) {
9
+ this._chatAgentService = _chatAgentService;
10
+ this._agents = ( new DisposableMap());
11
+ this._pendingProgress = ( new Map());
12
+ this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents));
13
+ }
14
+ $unregisterAgent(handle) {
15
+ this._agents.deleteAndDispose(handle);
16
+ }
17
+ dispose() {
18
+ this._agents.clearAndDisposeAll();
19
+ }
20
+ $registerAgent(handle, name, metadata) {
21
+ if (!this._chatAgentService.hasAgent(name)) {
22
+ this._chatAgentService.registerAgentData({
23
+ id: name,
24
+ metadata: revive(metadata)
25
+ });
26
+ }
27
+ const d = this._chatAgentService.registerAgentCallback(name, async (prompt, progress, history, token) => {
28
+ const requestId = Math.random();
29
+ this._pendingProgress.set(requestId, progress);
30
+ try {
31
+ return await this._proxy.$invokeAgent(handle, requestId, prompt, { history }, token);
32
+ }
33
+ finally {
34
+ this._pendingProgress.delete(requestId);
35
+ }
36
+ });
37
+ this._agents.set(handle, d);
38
+ }
39
+ async $handleProgressChunk(requestId, chunk) {
40
+ this._pendingProgress.get(requestId)?.report(revive(chunk));
41
+ }
42
+ $unregisterCommand(handle) {
43
+ this._agents.deleteAndDispose(handle);
44
+ }
45
+ };
46
+ MainThreadChatAgents = __decorate([
47
+ extHostNamedCustomer(MainContext.MainThreadChatAgents),
48
+ ( __param(1, IChatAgentService))
49
+ ], MainThreadChatAgents);
50
+ export { MainThreadChatAgents };
@@ -1,5 +1,6 @@
1
1
  import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
2
  import { DisposableMap } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
3
4
  import { ExtHostContext, MainContext } from '../common/extHost.protocol.js';
4
5
  import { IChatSlashCommandService } from '../../contrib/chat/common/chatSlashCommands.js';
5
6
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
@@ -24,7 +25,7 @@ let MainThreadChatSlashCommands = class MainThreadChatSlashCommands {
24
25
  const requestId = Math.random();
25
26
  this._pendingProgress.set(requestId, progress);
26
27
  try {
27
- await this._proxy.$executeCommand(handle, requestId, prompt, { history }, token);
28
+ return await this._proxy.$executeCommand(handle, requestId, prompt, { history }, token);
28
29
  }
29
30
  finally {
30
31
  this._pendingProgress.delete(requestId);
@@ -33,7 +34,7 @@ let MainThreadChatSlashCommands = class MainThreadChatSlashCommands {
33
34
  this._commands.set(handle, d);
34
35
  }
35
36
  async $handleProgressChunk(requestId, chunk) {
36
- this._pendingProgress.get(requestId)?.report(chunk);
37
+ this._pendingProgress.get(requestId)?.report(revive(chunk));
37
38
  }
38
39
  $unregisterCommand(handle) {
39
40
  this._commands.deleteAndDispose(handle);