@codingame/monaco-vscode-api 1.78.4 → 1.78.5-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 (799) hide show
  1. package/README.md +28 -9
  2. package/dist/api.js +192 -2
  3. package/dist/assets/breakpointWidget.css +31 -0
  4. package/dist/assets/callStackEditorContribution.css +12 -0
  5. package/dist/assets/debug.contribution.css +138 -0
  6. package/dist/assets/debugHover.css +80 -0
  7. package/dist/assets/debugToolBar.css +49 -0
  8. package/dist/assets/editorquickaccess.css +8 -0
  9. package/dist/assets/editorstatus.css +51 -0
  10. package/dist/assets/exceptionWidget.css +52 -0
  11. package/dist/assets/notificationsActions.css +14 -0
  12. package/dist/assets/notificationsCenter.css +69 -0
  13. package/dist/assets/notificationsList.css +152 -0
  14. package/dist/assets/notificationsToasts.css +63 -0
  15. package/dist/assets/panelpart.css +75 -0
  16. package/dist/assets/paneview.css +148 -0
  17. package/dist/assets/paneviewlet.css +79 -0
  18. package/dist/assets/sidebysideeditor.css +9 -0
  19. package/dist/assets.js +15 -0
  20. package/dist/default-extensions/bat.js +6 -6
  21. package/dist/default-extensions/clojure.js +5 -5
  22. package/dist/default-extensions/coffeescript.js +6 -6
  23. package/dist/default-extensions/cpp.js +11 -11
  24. package/dist/default-extensions/csharp.js +6 -6
  25. package/dist/default-extensions/css.js +5 -5
  26. package/dist/default-extensions/dart.js +5 -5
  27. package/dist/default-extensions/diff.js +5 -5
  28. package/dist/default-extensions/docker.js +5 -5
  29. package/dist/default-extensions/fsharp.js +6 -6
  30. package/dist/default-extensions/go.js +5 -5
  31. package/dist/default-extensions/groovy.js +6 -6
  32. package/dist/default-extensions/handlebars.js +5 -5
  33. package/dist/default-extensions/hlsl.js +5 -5
  34. package/dist/default-extensions/html.js +7 -7
  35. package/dist/default-extensions/ini.js +6 -6
  36. package/dist/default-extensions/java.js +6 -6
  37. package/dist/default-extensions/javascript.js +9 -9
  38. package/dist/default-extensions/json.js +6 -6
  39. package/dist/default-extensions/julia.js +5 -5
  40. package/dist/default-extensions/latex.js +11 -11
  41. package/dist/default-extensions/less.js +5 -5
  42. package/dist/default-extensions/log.js +4 -4
  43. package/dist/default-extensions/lua.js +5 -5
  44. package/dist/default-extensions/make.js +5 -5
  45. package/dist/default-extensions/markdown-basics.js +6 -6
  46. package/dist/default-extensions/objective-c.js +6 -6
  47. package/dist/default-extensions/perl.js +7 -7
  48. package/dist/default-extensions/php.js +7 -7
  49. package/dist/default-extensions/powershell.js +5 -5
  50. package/dist/default-extensions/pug.js +5 -5
  51. package/dist/default-extensions/python.js +6 -6
  52. package/dist/default-extensions/r.js +5 -5
  53. package/dist/default-extensions/razor.js +5 -5
  54. package/dist/default-extensions/ruby.js +5 -5
  55. package/dist/default-extensions/rust.js +5 -5
  56. package/dist/default-extensions/scss.js +6 -6
  57. package/dist/default-extensions/shaderlab.js +5 -5
  58. package/dist/default-extensions/shellscript.js +5 -5
  59. package/dist/default-extensions/sql.js +5 -5
  60. package/dist/default-extensions/swift.js +6 -6
  61. package/dist/default-extensions/theme-abyss.js +4 -4
  62. package/dist/default-extensions/theme-defaults.js +12 -12
  63. package/dist/default-extensions/theme-kimbie-dark.js +4 -4
  64. package/dist/default-extensions/theme-monokai-dimmed.js +4 -4
  65. package/dist/default-extensions/theme-monokai.js +4 -4
  66. package/dist/default-extensions/theme-quietlight.js +4 -4
  67. package/dist/default-extensions/theme-red.js +4 -4
  68. package/dist/default-extensions/theme-seti.js +4 -4
  69. package/dist/default-extensions/theme-solarized-dark.js +4 -4
  70. package/dist/default-extensions/theme-solarized-light.js +4 -4
  71. package/dist/default-extensions/theme-tomorrow-night-blue.js +4 -4
  72. package/dist/default-extensions/typescript-basics.js +9 -9
  73. package/dist/default-extensions/typescript-language-features.js +3 -3
  74. package/dist/default-extensions/vb.js +6 -6
  75. package/dist/default-extensions/xml.js +7 -7
  76. package/dist/default-extensions/yaml.js +5 -5
  77. package/dist/{extension-tools-b2d018a3.js → extension-tools-b68a64de.js} +2 -15
  78. package/dist/extensions.js +150 -4
  79. package/dist/json.js +92 -0
  80. package/dist/monaco-treemending.js +882 -0
  81. package/dist/monaco.js +24 -458
  82. package/dist/node_modules/tslib/tslib.es6.js +21 -0
  83. package/dist/override/vs/workbench/browser/parts/editor/textEditor.js +2 -0
  84. package/dist/rollup-extension-directory-plugin.js +1 -1
  85. package/dist/rollup-vsix-plugin.js +1 -1
  86. package/dist/service-override/_46__46__47__46__46__47_vscode_47_vs_47_platform_47_audioCues_47_browser_47_media_47__42__46_mp3.js +11 -0
  87. package/dist/service-override/audioCue.js +13 -0
  88. package/dist/service-override/configuration.js +100 -0
  89. package/dist/service-override/debug.js +23 -0
  90. package/dist/service-override/dialogs.js +13 -0
  91. package/dist/service-override/files.js +244 -0
  92. package/dist/service-override/keybindings.js +100 -0
  93. package/dist/service-override/languages.js +27 -0
  94. package/dist/service-override/layout.js +41 -0
  95. package/dist/service-override/modelEditor.js +128 -0
  96. package/dist/service-override/notifications.js +34 -0
  97. package/dist/service-override/preferences.js +10 -0
  98. package/dist/{snippets.js → service-override/snippets.js} +5 -3
  99. package/dist/service-override/textmate.js +36 -0
  100. package/dist/service-override/theme.js +26 -0
  101. package/dist/services.d.ts +118 -1
  102. package/dist/services.js +59 -3
  103. package/dist/tools.js +20 -0
  104. package/dist/vscode/vs/base/browser/ui/splitview/paneview.js +289 -0
  105. package/dist/vscode/vs/base/common/console.js +58 -0
  106. package/dist/vscode/vs/base/common/date.js +204 -0
  107. package/dist/vscode/vs/base/common/json.js +713 -0
  108. package/dist/vscode/vs/base/common/jsonEdit.js +164 -0
  109. package/dist/vscode/vs/base/common/jsonFormatter.js +187 -0
  110. package/dist/vscode/vs/base/common/keybindingParser.js +87 -0
  111. package/dist/vscode/vs/base/common/performance.js +18 -0
  112. package/dist/vscode/vs/base/common/skipList.js +160 -0
  113. package/dist/vscode/vs/base/common/stream.js +300 -0
  114. package/dist/vscode/vs/base/common/uriIpc.js +32 -0
  115. package/dist/vscode/vs/base/parts/ipc/common/ipc.net.js +45 -0
  116. package/dist/vscode/vs/base/parts/request/browser/request.js +60 -0
  117. package/dist/vscode/vs/base/parts/request/common/request.js +8 -0
  118. package/dist/vscode/vs/editor/browser/config/editorConfiguration.js +91 -0
  119. package/dist/vscode/vs/editor/common/services/languageFeaturesService.js +41 -0
  120. package/dist/vscode/vs/editor/common/services/modelUndoRedoParticipant.js +56 -0
  121. package/dist/vscode/vs/editor/common/services/textResourceConfigurationService.js +112 -0
  122. package/dist/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +112 -0
  123. package/dist/vscode/vs/platform/debug/common/extensionHostDebug.js +3 -0
  124. package/dist/{extensionManagement.js → vscode/vs/platform/extensionManagement/common/extensionManagement.js} +2 -1
  125. package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +14 -0
  126. package/dist/vscode/vs/platform/extensionManagement/common/extensionNls.js +66 -0
  127. package/dist/vscode/vs/platform/extensionManagement/common/implicitActivationEvents.js +53 -0
  128. package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +69 -0
  129. package/dist/vscode/vs/platform/externalServices/common/serviceMachineId.js +27 -0
  130. package/dist/vscode/vs/platform/files/common/fileService.js +920 -0
  131. package/dist/vscode/vs/platform/files/common/inMemoryFilesystemProvider.js +175 -0
  132. package/dist/vscode/vs/platform/files/common/io.js +80 -0
  133. package/dist/vscode/vs/platform/files/common/watcher.js +69 -0
  134. package/dist/vscode/vs/platform/keyboardLayout/common/keyboardConfig.js +42 -0
  135. package/dist/vscode/vs/platform/keyboardLayout/common/keyboardLayout.js +12 -0
  136. package/dist/vscode/vs/platform/keyboardLayout/common/keyboardMapper.js +23 -0
  137. package/dist/vscode/vs/platform/product/common/productService.js +4 -0
  138. package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +17 -0
  139. package/dist/vscode/vs/platform/remote/common/remoteHosts.js +18 -0
  140. package/dist/vscode/vs/platform/request/browser/requestService.js +25 -0
  141. package/dist/vscode/vs/platform/request/common/request.js +50 -0
  142. package/dist/vscode/vs/platform/telemetry/common/telemetryUtils.js +119 -0
  143. package/dist/{tokenClassificationRegistry.js → vscode/vs/platform/theme/common/tokenClassificationRegistry.js} +82 -136
  144. package/dist/vscode/vs/platform/tunnel/common/tunnel.js +3 -0
  145. package/dist/vscode/vs/platform/uriIdentity/common/uriIdentity.js +3 -0
  146. package/dist/vscode/vs/platform/uriIdentity/common/uriIdentityService.js +80 -0
  147. package/dist/vscode/vs/platform/userDataProfile/common/userDataProfile.js +427 -0
  148. package/dist/vscode/vs/platform/userDataSync/common/content.js +9 -0
  149. package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +299 -0
  150. package/dist/vscode/vs/platform/workspace/common/editSessions.js +3 -0
  151. package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +17 -0
  152. package/dist/vscode/vs/platform/workspaces/common/workspaces.js +195 -0
  153. package/dist/vscode/vs/workbench/api/browser/mainThreadBulkEdits.js +49 -0
  154. package/dist/vscode/vs/workbench/api/browser/mainThreadClipboard.js +22 -0
  155. package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +93 -0
  156. package/dist/vscode/vs/workbench/api/browser/mainThreadConfiguration.js +78 -0
  157. package/dist/vscode/vs/workbench/api/browser/mainThreadConsole.js +33 -0
  158. package/dist/vscode/vs/workbench/api/browser/mainThreadDebugService.js +347 -0
  159. package/dist/vscode/vs/workbench/api/browser/mainThreadDiagnostics.js +67 -0
  160. package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +73 -0
  161. package/dist/vscode/vs/workbench/api/browser/mainThreadDocuments.js +246 -0
  162. package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +379 -0
  163. package/dist/vscode/vs/workbench/api/browser/mainThreadEditor.js +410 -0
  164. package/dist/vscode/vs/workbench/api/browser/mainThreadEditors.js +223 -0
  165. package/dist/vscode/vs/workbench/api/browser/mainThreadExtensionService.js +213 -0
  166. package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystem.js +270 -0
  167. package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystemEventService.js +223 -0
  168. package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +909 -0
  169. package/dist/vscode/vs/workbench/api/browser/mainThreadLanguages.js +76 -0
  170. package/dist/vscode/vs/workbench/api/browser/mainThreadMessageService.js +114 -0
  171. package/dist/vscode/vs/workbench/api/browser/mainThreadOutputService.js +73 -0
  172. package/dist/vscode/vs/workbench/api/browser/mainThreadProgress.js +62 -0
  173. package/dist/vscode/vs/workbench/api/browser/mainThreadQuickOpen.js +183 -0
  174. package/dist/vscode/vs/workbench/api/browser/mainThreadSaveParticipant.js +43 -0
  175. package/dist/vscode/vs/workbench/api/browser/mainThreadTelemetry.js +50 -0
  176. package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +48 -0
  177. package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +227 -0
  178. package/dist/vscode/vs/workbench/api/common/cache.js +28 -0
  179. package/dist/vscode/vs/workbench/api/common/configurationExtensionPoint.js +450 -0
  180. package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +131 -0
  181. package/dist/vscode/vs/workbench/api/common/extHostApiCommands.js +656 -0
  182. package/dist/vscode/vs/workbench/api/common/extHostApiDeprecationService.js +35 -0
  183. package/dist/vscode/vs/workbench/api/common/extHostBulkEdits.js +21 -0
  184. package/dist/vscode/vs/workbench/api/common/extHostClipboard.js +15 -0
  185. package/dist/vscode/vs/workbench/api/common/extHostCommands.js +415 -0
  186. package/dist/vscode/vs/workbench/api/common/extHostConfiguration.js +264 -0
  187. package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +786 -0
  188. package/dist/vscode/vs/workbench/api/common/extHostDecorations.js +94 -0
  189. package/dist/vscode/vs/workbench/api/common/extHostDiagnostics.js +292 -0
  190. package/dist/vscode/vs/workbench/api/common/extHostDocumentContentProviders.js +65 -0
  191. package/dist/vscode/vs/workbench/api/common/extHostDocumentData.js +212 -0
  192. package/dist/vscode/vs/workbench/api/common/extHostDocumentSaveParticipant.js +126 -0
  193. package/dist/vscode/vs/workbench/api/common/extHostDocuments.js +144 -0
  194. package/dist/vscode/vs/workbench/api/common/extHostDocumentsAndEditors.js +147 -0
  195. package/dist/vscode/vs/workbench/api/common/extHostEditorTabs.js +328 -0
  196. package/dist/vscode/vs/workbench/api/common/extHostExtensionActivator.js +309 -0
  197. package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +814 -0
  198. package/dist/vscode/vs/workbench/api/common/extHostFileSystem.js +272 -0
  199. package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +153 -0
  200. package/dist/vscode/vs/workbench/api/common/extHostFileSystemEventService.js +193 -0
  201. package/dist/vscode/vs/workbench/api/common/extHostFileSystemInfo.js +35 -0
  202. package/dist/vscode/vs/workbench/api/common/extHostInitDataService.js +3 -0
  203. package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +2038 -0
  204. package/dist/vscode/vs/workbench/api/common/extHostLanguages.js +164 -0
  205. package/dist/vscode/vs/workbench/api/common/extHostLocalizationService.js +85 -0
  206. package/dist/vscode/vs/workbench/api/common/extHostMemento.js +74 -0
  207. package/dist/vscode/vs/workbench/api/common/extHostMessageService.js +55 -0
  208. package/dist/vscode/vs/workbench/api/common/extHostOutput.js +257 -0
  209. package/dist/vscode/vs/workbench/api/common/extHostProgress.js +80 -0
  210. package/dist/vscode/vs/workbench/api/common/extHostQuickOpen.js +580 -0
  211. package/dist/vscode/vs/workbench/api/common/extHostRpcService.js +12 -0
  212. package/dist/vscode/vs/workbench/api/common/extHostSecretState.js +24 -0
  213. package/dist/vscode/vs/workbench/api/common/extHostSecrets.js +29 -0
  214. package/dist/vscode/vs/workbench/api/common/extHostStorage.js +42 -0
  215. package/dist/vscode/vs/workbench/api/common/extHostStoragePaths.js +64 -0
  216. package/dist/vscode/vs/workbench/api/common/extHostTelemetry.js +266 -0
  217. package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +3 -0
  218. package/dist/vscode/vs/workbench/api/common/extHostTestItem.js +122 -0
  219. package/dist/vscode/vs/workbench/api/common/extHostTestingPrivateApi.js +15 -0
  220. package/dist/vscode/vs/workbench/api/common/extHostTextEditor.js +511 -0
  221. package/dist/vscode/vs/workbench/api/common/extHostTextEditors.js +128 -0
  222. package/dist/vscode/vs/workbench/api/common/extHostTunnelService.js +36 -0
  223. package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +1766 -0
  224. package/dist/vscode/vs/workbench/api/common/extHostTypes.js +2810 -0
  225. package/dist/vscode/vs/workbench/api/common/extHostUriTransformerService.js +19 -0
  226. package/dist/vscode/vs/workbench/api/common/extHostVariableResolverService.js +138 -0
  227. package/dist/vscode/vs/workbench/api/common/extHostWindow.js +59 -0
  228. package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +534 -0
  229. package/dist/vscode/vs/workbench/api/common/jsonValidationExtensionPoint.js +97 -0
  230. package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +36 -0
  231. package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +1201 -0
  232. package/dist/vscode/vs/workbench/browser/actions.js +77 -0
  233. package/dist/vscode/vs/workbench/browser/codeeditor.js +185 -0
  234. package/dist/vscode/vs/workbench/browser/composite.js +102 -0
  235. package/dist/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +146 -0
  236. package/dist/vscode/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +68 -0
  237. package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +124 -0
  238. package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +876 -0
  239. package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +4 -0
  240. package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +1946 -0
  241. package/dist/vscode/vs/workbench/browser/parts/editor/editorAutoSave.js +157 -0
  242. package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +1289 -0
  243. package/dist/vscode/vs/workbench/browser/parts/editor/editorPane.js +242 -0
  244. package/dist/vscode/vs/workbench/browser/parts/editor/editorQuickAccess.js +213 -0
  245. package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +460 -0
  246. package/dist/vscode/vs/workbench/browser/parts/editor/editorWithViewState.js +139 -0
  247. package/dist/vscode/vs/workbench/browser/parts/editor/sideBySideEditor.js +387 -0
  248. package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +289 -0
  249. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsActions.js +124 -0
  250. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsAlerts.js +58 -0
  251. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCenter.js +224 -0
  252. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCommands.js +241 -0
  253. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsList.js +185 -0
  254. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsTelemetry.js +35 -0
  255. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsToasts.js +417 -0
  256. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsViewer.js +392 -0
  257. package/dist/vscode/vs/workbench/browser/parts/panel/panelActions.js +422 -0
  258. package/dist/vscode/vs/workbench/browser/parts/views/viewPane.js +520 -0
  259. package/dist/vscode/vs/workbench/browser/quickaccess.js +17 -0
  260. package/dist/vscode/vs/workbench/common/component.js +23 -0
  261. package/dist/vscode/vs/workbench/common/configuration.js +8 -0
  262. package/dist/vscode/vs/workbench/common/contextkeys.js +170 -0
  263. package/dist/vscode/vs/workbench/common/contributions.js +111 -0
  264. package/dist/vscode/vs/workbench/common/dialogs.js +31 -0
  265. package/dist/vscode/vs/workbench/common/editor/binaryEditorModel.js +39 -0
  266. package/dist/vscode/vs/workbench/common/editor/diffEditorInput.js +164 -0
  267. package/dist/vscode/vs/workbench/common/editor/diffEditorModel.js +23 -0
  268. package/dist/vscode/vs/workbench/common/editor/editorInput.js +97 -0
  269. package/dist/vscode/vs/workbench/common/editor/editorModel.js +26 -0
  270. package/dist/vscode/vs/workbench/common/editor/editorOptions.js +48 -0
  271. package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +133 -0
  272. package/dist/vscode/vs/workbench/common/editor/sideBySideEditorInput.js +228 -0
  273. package/dist/vscode/vs/workbench/common/editor/textDiffEditorModel.js +42 -0
  274. package/dist/vscode/vs/workbench/common/editor/textEditorModel.js +165 -0
  275. package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +146 -0
  276. package/dist/vscode/vs/workbench/common/editor/textResourceEditorModel.js +24 -0
  277. package/dist/vscode/vs/workbench/common/editor.js +307 -0
  278. package/dist/{memento.js → vscode/vs/workbench/common/memento.js} +1 -1
  279. package/dist/vscode/vs/workbench/common/notifications.js +448 -0
  280. package/dist/vscode/vs/workbench/common/resources.js +86 -0
  281. package/dist/{theme2.js → vscode/vs/workbench/common/theme.js} +1 -168
  282. package/dist/vscode/vs/workbench/common/views.js +20 -0
  283. package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueDebuggerContribution.js +45 -0
  284. package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.js +170 -0
  285. package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCues.contribution.js +160 -0
  286. package/dist/vscode/vs/workbench/contrib/audioCues/browser/commands.js +49 -0
  287. package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits.js +25 -0
  288. package/dist/vscode/vs/workbench/contrib/callHierarchy/common/callHierarchy.js +126 -0
  289. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js +100 -0
  290. package/dist/{languages.js → vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js} +154 -180
  291. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer.js +35 -0
  292. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard.js +2 -0
  293. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.js +50 -0
  294. package/dist/vscode/vs/workbench/contrib/debug/browser/baseDebugView.js +192 -0
  295. package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +776 -0
  296. package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointWidget.js +378 -0
  297. package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointsView.js +714 -0
  298. package/dist/vscode/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +172 -0
  299. package/dist/vscode/vs/workbench/contrib/debug/browser/debug.contribution.js +451 -0
  300. package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +294 -0
  301. package/dist/vscode/vs/workbench/contrib/debug/browser/debugAdapterManager.js +397 -0
  302. package/dist/vscode/vs/workbench/contrib/debug/browser/debugColors.js +309 -0
  303. package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +749 -0
  304. package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +619 -0
  305. package/dist/vscode/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +58 -0
  306. package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +675 -0
  307. package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +317 -0
  308. package/dist/vscode/vs/workbench/contrib/debug/browser/debugIcons.js +135 -0
  309. package/dist/vscode/vs/workbench/contrib/debug/browser/debugMemory.js +204 -0
  310. package/dist/vscode/vs/workbench/contrib/debug/browser/debugQuickAccess.js +142 -0
  311. package/dist/vscode/vs/workbench/contrib/debug/browser/debugService.js +1171 -0
  312. package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1134 -0
  313. package/dist/vscode/vs/workbench/contrib/debug/browser/debugSessionPicker.js +104 -0
  314. package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +273 -0
  315. package/dist/vscode/vs/workbench/contrib/debug/browser/debugToolBar.js +312 -0
  316. package/dist/vscode/vs/workbench/contrib/debug/browser/exceptionWidget.js +103 -0
  317. package/dist/vscode/vs/workbench/contrib/debug/browser/linkDetector.js +229 -0
  318. package/dist/vscode/vs/workbench/contrib/debug/browser/rawDebugSession.js +666 -0
  319. package/dist/vscode/vs/workbench/contrib/debug/browser/variablesView.js +287 -0
  320. package/dist/vscode/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +150 -0
  321. package/dist/vscode/vs/workbench/contrib/debug/common/breakpoints.js +19 -0
  322. package/dist/vscode/vs/workbench/contrib/debug/common/debug.js +285 -0
  323. package/dist/vscode/vs/workbench/contrib/debug/common/debugCompoundRoot.js +15 -0
  324. package/dist/vscode/vs/workbench/contrib/debug/common/debugContentProvider.js +96 -0
  325. package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +1451 -0
  326. package/dist/vscode/vs/workbench/contrib/debug/common/debugSchemas.js +344 -0
  327. package/dist/vscode/vs/workbench/contrib/debug/common/debugSource.js +121 -0
  328. package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +148 -0
  329. package/dist/vscode/vs/workbench/contrib/debug/common/debugTelemetry.js +34 -0
  330. package/dist/vscode/vs/workbench/contrib/debug/common/debugUtils.js +292 -0
  331. package/dist/vscode/vs/workbench/contrib/debug/common/debugViewModel.js +107 -0
  332. package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +254 -0
  333. package/dist/vscode/vs/workbench/contrib/debug/common/disassemblyViewInput.js +25 -0
  334. package/dist/vscode/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +81 -0
  335. package/dist/vscode/vs/workbench/contrib/debug/common/replModel.js +230 -0
  336. package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +3 -0
  337. package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +321 -0
  338. package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +398 -0
  339. package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +389 -0
  340. package/dist/vscode/vs/workbench/contrib/files/browser/files.js +3 -0
  341. package/dist/vscode/vs/workbench/contrib/files/common/explorerFileNestingTrie.js +212 -0
  342. package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +369 -0
  343. package/dist/{files2.js → vscode/vs/workbench/contrib/files/common/files.js} +1 -1
  344. package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +20 -0
  345. package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -0
  346. package/dist/vscode/vs/workbench/contrib/output/browser/outputLinkProvider.js +74 -0
  347. package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +166 -0
  348. package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +317 -0
  349. package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModelService.js +31 -0
  350. package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +153 -0
  351. package/dist/vscode/vs/workbench/contrib/search/common/search.js +27 -0
  352. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +159 -0
  353. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.js +3 -0
  354. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetsFile.js +229 -0
  355. package/dist/{snippetsService.js → vscode/vs/workbench/contrib/snippets/browser/snippetsService.js} +28 -412
  356. package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +166 -0
  357. package/dist/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +161 -0
  358. package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +3 -0
  359. package/dist/vscode/vs/workbench/contrib/testing/common/testId.js +109 -0
  360. package/dist/vscode/vs/workbench/contrib/testing/common/testItemCollection.js +75 -0
  361. package/dist/vscode/vs/workbench/contrib/testing/common/testTypes.js +7 -0
  362. package/dist/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy.js +133 -0
  363. package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +829 -0
  364. package/dist/vscode/vs/workbench/services/activity/common/activity.js +22 -0
  365. package/dist/vscode/vs/workbench/services/configuration/browser/configuration.js +847 -0
  366. package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +1104 -0
  367. package/dist/{configuration2.js → vscode/vs/workbench/services/configuration/common/configuration.js} +1 -1
  368. package/dist/vscode/vs/workbench/services/configuration/common/configurationCache.js +80 -0
  369. package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +590 -0
  370. package/dist/vscode/vs/workbench/services/configuration/common/configurationModels.js +119 -0
  371. package/dist/vscode/vs/workbench/services/configuration/common/jsonEditing.js +9 -0
  372. package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +119 -0
  373. package/dist/vscode/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +303 -0
  374. package/dist/vscode/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +26 -0
  375. package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.js +36 -0
  376. package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +174 -0
  377. package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +10 -0
  378. package/dist/vscode/vs/workbench/services/configurationResolver/common/variableResolver.js +299 -0
  379. package/dist/vscode/vs/workbench/services/decorations/browser/decorationsService.js +312 -0
  380. package/dist/vscode/vs/workbench/services/decorations/common/decorations.js +3 -0
  381. package/dist/vscode/vs/workbench/services/dialogs/common/dialogService.js +65 -0
  382. package/dist/vscode/vs/workbench/services/editor/browser/codeEditorService.js +80 -0
  383. package/dist/vscode/vs/workbench/services/editor/common/editorGroupColumn.js +23 -0
  384. package/dist/vscode/vs/workbench/services/editor/common/editorGroupsService.js +14 -0
  385. package/dist/vscode/vs/workbench/services/editor/common/editorResolverService.js +31 -0
  386. package/dist/vscode/vs/workbench/services/editor/common/editorService.js +10 -0
  387. package/dist/vscode/vs/workbench/services/environment/browser/environmentService.js +4 -0
  388. package/dist/vscode/vs/workbench/services/environment/common/environmentService.js +4 -0
  389. package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +6 -0
  390. package/dist/vscode/vs/workbench/services/extensions/common/extHostCustomers.js +40 -0
  391. package/dist/vscode/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +189 -0
  392. package/dist/vscode/vs/workbench/services/extensions/common/extensionDevOptions.js +23 -0
  393. package/dist/vscode/vs/workbench/services/extensions/common/extensionHostProtocol.js +6 -0
  394. package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +57 -0
  395. package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +74 -0
  396. package/dist/{extensionsRegistry.js → vscode/vs/workbench/services/extensions/common/extensionsRegistry.js} +87 -208
  397. package/dist/vscode/vs/workbench/services/extensions/common/lazyPromise.js +70 -0
  398. package/dist/vscode/vs/workbench/services/extensions/common/proxyIdentifier.js +23 -0
  399. package/dist/vscode/vs/workbench/services/extensions/common/remoteConsoleUtil.js +47 -0
  400. package/dist/vscode/vs/workbench/services/extensions/common/rpcProtocol.js +762 -0
  401. package/dist/vscode/vs/workbench/services/extensions/common/workspaceContains.js +92 -0
  402. package/dist/vscode/vs/workbench/services/files/browser/elevatedFileService.js +9 -0
  403. package/dist/vscode/vs/workbench/services/files/common/elevatedFileService.js +3 -0
  404. package/dist/vscode/vs/workbench/services/files/common/files.js +4 -0
  405. package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +124 -0
  406. package/dist/vscode/vs/workbench/services/history/common/history.js +3 -0
  407. package/dist/vscode/vs/workbench/services/host/browser/host.js +3 -0
  408. package/dist/vscode/vs/workbench/services/keybinding/browser/keybindingService.js +855 -0
  409. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +490 -0
  410. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +162 -0
  411. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +162 -0
  412. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +125 -0
  413. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +180 -0
  414. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +162 -0
  415. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +162 -0
  416. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +125 -0
  417. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +162 -0
  418. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +125 -0
  419. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +162 -0
  420. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +125 -0
  421. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +162 -0
  422. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +125 -0
  423. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +162 -0
  424. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +133 -0
  425. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +182 -0
  426. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +167 -0
  427. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +162 -0
  428. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +125 -0
  429. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +180 -0
  430. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +162 -0
  431. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +125 -0
  432. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +180 -0
  433. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +162 -0
  434. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +162 -0
  435. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +125 -0
  436. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +162 -0
  437. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +125 -0
  438. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +125 -0
  439. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +125 -0
  440. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +17 -0
  441. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +6 -0
  442. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +23 -0
  443. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +162 -0
  444. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +125 -0
  445. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +162 -0
  446. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +162 -0
  447. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +125 -0
  448. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +162 -0
  449. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +125 -0
  450. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +180 -0
  451. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +162 -0
  452. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +164 -0
  453. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +162 -0
  454. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +162 -0
  455. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +125 -0
  456. package/dist/vscode/vs/workbench/services/keybinding/common/fallbackKeyboardMapper.js +28 -0
  457. package/dist/vscode/vs/workbench/services/keybinding/common/keybindingIO.js +72 -0
  458. package/dist/vscode/vs/workbench/services/keybinding/common/keymapInfo.js +108 -0
  459. package/dist/vscode/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +888 -0
  460. package/dist/vscode/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +350 -0
  461. package/dist/vscode/vs/workbench/services/label/common/labelService.js +302 -0
  462. package/dist/{languageService.js → vscode/vs/workbench/services/language/common/languageService.js} +8 -163
  463. package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +5 -0
  464. package/dist/vscode/vs/workbench/services/languageStatus/common/languageStatusService.js +3 -0
  465. package/dist/vscode/vs/workbench/services/layout/browser/layoutService.js +12 -0
  466. package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycle.js +11 -0
  467. package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycleService.js +85 -0
  468. package/dist/vscode/vs/workbench/services/notification/common/notificationService.js +186 -0
  469. package/dist/vscode/vs/workbench/services/output/common/output.js +51 -0
  470. package/dist/vscode/vs/workbench/services/panecomposite/browser/panecomposite.js +3 -0
  471. package/dist/vscode/vs/workbench/services/path/browser/pathService.js +34 -0
  472. package/dist/vscode/vs/workbench/services/path/common/pathService.js +107 -0
  473. package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +35 -0
  474. package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +555 -0
  475. package/dist/vscode/vs/workbench/services/preferences/browser/preferencesService.js +547 -0
  476. package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +20 -0
  477. package/dist/vscode/vs/workbench/services/preferences/common/preferencesEditorInput.js +37 -0
  478. package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +1031 -0
  479. package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +357 -0
  480. package/dist/vscode/vs/workbench/services/progress/browser/progressIndicator.js +174 -0
  481. package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +3 -0
  482. package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +428 -0
  483. package/dist/vscode/vs/workbench/services/search/common/search.js +158 -0
  484. package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
  485. package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
  486. package/dist/vscode/vs/workbench/services/textMate/browser/arrayOperation.js +62 -0
  487. package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeature.js +3 -0
  488. package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +422 -0
  489. package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.js +60 -0
  490. package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit.js +36 -0
  491. package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost.js +198 -0
  492. package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerTokenizerController.js +151 -0
  493. package/dist/vscode/vs/workbench/services/textMate/common/TMGrammarFactory.js +117 -0
  494. package/dist/vscode/vs/workbench/services/textMate/common/TMGrammars.js +93 -0
  495. package/dist/vscode/vs/workbench/services/textMate/common/TMScopeRegistry.js +24 -0
  496. package/dist/vscode/vs/workbench/services/textfile/browser/browserTextFileService.js +55 -0
  497. package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +578 -0
  498. package/dist/vscode/vs/workbench/services/textfile/common/encoding.js +493 -0
  499. package/dist/vscode/vs/workbench/services/textfile/common/textEditorService.js +150 -0
  500. package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +711 -0
  501. package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModelManager.js +401 -0
  502. package/dist/vscode/vs/workbench/services/textfile/common/textFileSaveParticipant.js +54 -0
  503. package/dist/vscode/vs/workbench/services/textfile/common/textfiles.js +45 -0
  504. package/dist/vscode/vs/workbench/services/textmodelResolver/common/textModelResolverService.js +187 -0
  505. package/dist/vscode/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +37 -0
  506. package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +353 -0
  507. package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +291 -0
  508. package/dist/vscode/vs/workbench/services/themes/browser/workbenchThemeService.js +736 -0
  509. package/dist/vscode/vs/workbench/services/themes/common/colorExtensionPoint.js +171 -0
  510. package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +864 -0
  511. package/dist/vscode/vs/workbench/services/themes/common/colorThemeSchema.js +265 -0
  512. package/dist/vscode/vs/workbench/services/themes/common/fileIconThemeSchema.js +303 -0
  513. package/dist/vscode/vs/workbench/services/themes/common/hostColorSchemeService.js +3 -0
  514. package/dist/vscode/vs/workbench/services/themes/common/plistParser.js +439 -0
  515. package/dist/vscode/vs/workbench/services/themes/common/productIconThemeSchema.js +94 -0
  516. package/dist/vscode/vs/workbench/services/themes/common/textMateScopeMatcher.js +120 -0
  517. package/dist/vscode/vs/workbench/services/themes/common/themeCompatibility.js +66 -0
  518. package/dist/vscode/vs/workbench/services/themes/common/themeConfiguration.js +374 -0
  519. package/dist/vscode/vs/workbench/services/themes/common/themeExtensionPoints.js +258 -0
  520. package/dist/vscode/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +268 -0
  521. package/dist/vscode/vs/workbench/services/themes/common/workbenchThemeService.js +46 -0
  522. package/dist/vscode/vs/workbench/services/timer/browser/timerService.js +3 -0
  523. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +122 -0
  524. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +240 -0
  525. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
  526. package/dist/vscode/vs/workbench/services/userData/browser/userDataInit.js +3 -0
  527. package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.js +7 -0
  528. package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfileService.js +52 -0
  529. package/dist/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +55 -0
  530. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopy.js +2 -0
  531. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.js +3 -0
  532. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +414 -0
  533. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +39 -0
  534. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.js +181 -0
  535. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +112 -0
  536. package/dist/vscode/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +325 -0
  537. package/dist/vscode/vs/workbench/services/workspaces/browser/workspaces.js +11 -0
  538. package/dist/vscode/vs/workbench/services/workspaces/browser/workspacesService.js +154 -0
  539. package/dist/vscode/vs/workbench/services/workspaces/common/workspaceEditing.js +3 -0
  540. package/dist/vscode-default-extensions/bat/package.json.js +2 -0
  541. package/dist/vscode-default-extensions/clojure/package.json.js +2 -0
  542. package/dist/vscode-default-extensions/coffeescript/package.json.js +2 -0
  543. package/dist/vscode-default-extensions/cpp/package.json.js +2 -0
  544. package/dist/vscode-default-extensions/csharp/package.json.js +2 -0
  545. package/dist/vscode-default-extensions/css/package.json.js +2 -0
  546. package/dist/vscode-default-extensions/dart/package.json.js +2 -0
  547. package/dist/vscode-default-extensions/diff/package.json.js +2 -0
  548. package/dist/vscode-default-extensions/docker/package.json.js +2 -0
  549. package/dist/vscode-default-extensions/fsharp/package.json.js +2 -0
  550. package/dist/vscode-default-extensions/go/package.json.js +2 -0
  551. package/dist/vscode-default-extensions/groovy/package.json.js +2 -0
  552. package/dist/vscode-default-extensions/handlebars/package.json.js +2 -0
  553. package/dist/vscode-default-extensions/hlsl/package.json.js +2 -0
  554. package/dist/vscode-default-extensions/html/package.json.js +2 -0
  555. package/dist/vscode-default-extensions/ini/package.json.js +2 -0
  556. package/dist/vscode-default-extensions/java/package.json.js +2 -0
  557. package/dist/vscode-default-extensions/javascript/package.json.js +2 -0
  558. package/dist/vscode-default-extensions/json/package.json.js +2 -0
  559. package/dist/vscode-default-extensions/julia/package.json.js +2 -0
  560. package/dist/vscode-default-extensions/latex/package.json.js +2 -0
  561. package/dist/vscode-default-extensions/less/package.json.js +2 -0
  562. package/dist/vscode-default-extensions/log/package.json.js +2 -0
  563. package/dist/vscode-default-extensions/lua/package.json.js +2 -0
  564. package/dist/vscode-default-extensions/make/package.json.js +2 -0
  565. package/dist/vscode-default-extensions/markdown-basics/package.json.js +2 -0
  566. package/dist/vscode-default-extensions/objective-c/package.json.js +2 -0
  567. package/dist/vscode-default-extensions/perl/package.json.js +2 -0
  568. package/dist/vscode-default-extensions/php/package.json.js +2 -0
  569. package/dist/vscode-default-extensions/powershell/package.json.js +2 -0
  570. package/dist/vscode-default-extensions/pug/package.json.js +2 -0
  571. package/dist/vscode-default-extensions/python/package.json.js +2 -0
  572. package/dist/vscode-default-extensions/r/package.json.js +2 -0
  573. package/dist/vscode-default-extensions/razor/package.json.js +2 -0
  574. package/dist/vscode-default-extensions/ruby/package.json.js +2 -0
  575. package/dist/vscode-default-extensions/rust/package.json.js +2 -0
  576. package/dist/vscode-default-extensions/scss/package.json.js +2 -0
  577. package/dist/vscode-default-extensions/shaderlab/package.json.js +2 -0
  578. package/dist/vscode-default-extensions/shellscript/package.json.js +2 -0
  579. package/dist/vscode-default-extensions/sql/package.json.js +2 -0
  580. package/dist/vscode-default-extensions/swift/package.json.js +2 -0
  581. package/dist/vscode-default-extensions/theme-abyss/package.json.js +2 -0
  582. package/dist/vscode-default-extensions/theme-defaults/package.json.js +2 -0
  583. package/dist/vscode-default-extensions/theme-kimbie-dark/package.json.js +2 -0
  584. package/dist/vscode-default-extensions/theme-monokai/package.json.js +2 -0
  585. package/dist/vscode-default-extensions/theme-monokai-dimmed/package.json.js +2 -0
  586. package/dist/vscode-default-extensions/theme-quietlight/package.json.js +2 -0
  587. package/dist/vscode-default-extensions/theme-red/package.json.js +2 -0
  588. package/dist/vscode-default-extensions/theme-seti/package.json.js +2 -0
  589. package/dist/vscode-default-extensions/theme-solarized-dark/package.json.js +2 -0
  590. package/dist/vscode-default-extensions/theme-solarized-light/package.json.js +2 -0
  591. package/dist/vscode-default-extensions/theme-tomorrow-night-blue/package.json.js +2 -0
  592. package/dist/vscode-default-extensions/typescript-basics/package.json.js +2 -0
  593. package/dist/vscode-default-extensions/typescript-language-features/package.json.js +2 -0
  594. package/dist/vscode-default-extensions/vb/package.json.js +2 -0
  595. package/dist/vscode-default-extensions/xml/package.json.js +2 -0
  596. package/dist/vscode-default-extensions/yaml/package.json.js +2 -0
  597. package/dist/vscode-services/commands.js +37 -0
  598. package/dist/vscode-services/debug.js +74 -0
  599. package/dist/vscode-services/env.js +69 -0
  600. package/dist/vscode-services/extHost.js +385 -0
  601. package/dist/vscode-services/extensions.js +46 -0
  602. package/dist/vscode-services/languages.js +203 -0
  603. package/dist/vscode-services/missing-services.js +959 -0
  604. package/dist/vscode-services/window.js +189 -0
  605. package/dist/vscode-services/workspace.js +164 -0
  606. package/monaco-editor-treemending.patch +23574 -0
  607. package/monaco-treemending.js +3 -0
  608. package/package.json +55 -59
  609. package/dist/api2.js +0 -1294
  610. package/dist/audioCue.js +0 -805
  611. package/dist/button.js +0 -352
  612. package/dist/configuration.js +0 -4438
  613. package/dist/debug.js +0 -15673
  614. package/dist/dialogs.js +0 -752
  615. package/dist/dom.js +0 -101
  616. package/dist/files.js +0 -3167
  617. package/dist/keybindings.js +0 -4310
  618. package/dist/layout.contribution.darwin.js +0 -1994
  619. package/dist/layout.contribution.linux.js +0 -899
  620. package/dist/layout.contribution.win.js +0 -3551
  621. package/dist/modelEditor.js +0 -8893
  622. package/dist/notifications.js +0 -2302
  623. package/dist/platform.js +0 -105
  624. package/dist/polyfill.js +0 -55651
  625. package/dist/preferences.js +0 -2532
  626. package/dist/textmate.js +0 -1428
  627. package/dist/theme.js +0 -4116
  628. package/dist/utils.js +0 -345
  629. package/dist/webpack-loader.cjs +0 -18
  630. package/dist/webpack-loader.d.ts +0 -4
  631. package/dist/{iconv.js → override/iconv.js} +0 -0
  632. package/dist/{jschardet.js → override/jschardet.js} +0 -0
  633. package/dist/{audioCue.d.ts → service-override/audioCue.d.ts} +0 -0
  634. package/dist/{configuration.d.ts → service-override/configuration.d.ts} +0 -0
  635. package/dist/{debug.d.ts → service-override/debug.d.ts} +0 -0
  636. package/dist/{dialogs.d.ts → service-override/dialogs.d.ts} +0 -0
  637. package/dist/{files.d.ts → service-override/files.d.ts} +0 -0
  638. package/dist/{keybindings.d.ts → service-override/keybindings.d.ts} +0 -0
  639. package/dist/{languages.d.ts → service-override/languages.d.ts} +0 -0
  640. package/dist/{modelEditor.d.ts → service-override/modelEditor.d.ts} +0 -0
  641. package/dist/{notifications.d.ts → service-override/notifications.d.ts} +0 -0
  642. package/dist/{preferences.d.ts → service-override/preferences.d.ts} +0 -0
  643. package/dist/{snippets.d.ts → service-override/snippets.d.ts} +0 -0
  644. package/dist/{textmate.d.ts → service-override/textmate.d.ts} +0 -0
  645. package/dist/{theme.d.ts → service-override/theme.d.ts} +0 -0
  646. package/dist/{injection.js → tools/injection.js} +0 -0
  647. package/dist/{jsonErrorMessages.js → vscode/vs/base/common/jsonErrorMessages.js} +0 -0
  648. package/dist/{_.contribution.js → vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js} +0 -0
  649. package/dist/{unboundCommands.js → vscode/vs/workbench/services/keybinding/browser/unboundCommands.js} +2 -2
  650. /package/dist/{language-configuration.js → vscode-default-extensions/bat/language-configuration.json.js} +0 -0
  651. /package/dist/{batchfile.js → vscode-default-extensions/bat/snippets/batchfile.code-snippets.js} +0 -0
  652. /package/dist/{batchfile.tmLanguage.js → vscode-default-extensions/bat/syntaxes/batchfile.tmLanguage.json.js} +0 -0
  653. /package/dist/{language-configuration2.js → vscode-default-extensions/clojure/language-configuration.json.js} +0 -0
  654. /package/dist/{clojure.tmLanguage.js → vscode-default-extensions/clojure/syntaxes/clojure.tmLanguage.json.js} +0 -0
  655. /package/dist/{language-configuration3.js → vscode-default-extensions/coffeescript/language-configuration.json.js} +0 -0
  656. /package/dist/{coffeescript.js → vscode-default-extensions/coffeescript/snippets/coffeescript.code-snippets.js} +0 -0
  657. /package/dist/{coffeescript.tmLanguage.js → vscode-default-extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json.js} +0 -0
  658. /package/dist/{language-configuration4.js → vscode-default-extensions/cpp/language-configuration.json.js} +0 -0
  659. /package/dist/{c.js → vscode-default-extensions/cpp/snippets/c.code-snippets.js} +0 -0
  660. /package/dist/{cpp.js → vscode-default-extensions/cpp/snippets/cpp.code-snippets.js} +0 -0
  661. /package/dist/{c.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/c.tmLanguage.json.js} +0 -0
  662. /package/dist/{cpp.embedded.macro.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json.js} +0 -0
  663. /package/dist/{cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.tmLanguage.json.js} +0 -0
  664. /package/dist/{cuda-cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cuda-cpp.tmLanguage.json.js} +0 -0
  665. /package/dist/{platform.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/platform.tmLanguage.json.js} +0 -0
  666. /package/dist/{language-configuration5.js → vscode-default-extensions/csharp/language-configuration.json.js} +0 -0
  667. /package/dist/{csharp.js → vscode-default-extensions/csharp/snippets/csharp.code-snippets.js} +0 -0
  668. /package/dist/{csharp.tmLanguage.js → vscode-default-extensions/csharp/syntaxes/csharp.tmLanguage.json.js} +0 -0
  669. /package/dist/{language-configuration6.js → vscode-default-extensions/css/language-configuration.json.js} +0 -0
  670. /package/dist/{css.tmLanguage.js → vscode-default-extensions/css/syntaxes/css.tmLanguage.json.js} +0 -0
  671. /package/dist/{language-configuration7.js → vscode-default-extensions/dart/language-configuration.json.js} +0 -0
  672. /package/dist/{dart.tmLanguage.js → vscode-default-extensions/dart/syntaxes/dart.tmLanguage.json.js} +0 -0
  673. /package/dist/{language-configuration8.js → vscode-default-extensions/diff/language-configuration.json.js} +0 -0
  674. /package/dist/{diff.tmLanguage.js → vscode-default-extensions/diff/syntaxes/diff.tmLanguage.json.js} +0 -0
  675. /package/dist/{language-configuration9.js → vscode-default-extensions/docker/language-configuration.json.js} +0 -0
  676. /package/dist/{docker.tmLanguage.js → vscode-default-extensions/docker/syntaxes/docker.tmLanguage.json.js} +0 -0
  677. /package/dist/{language-configuration10.js → vscode-default-extensions/fsharp/language-configuration.json.js} +0 -0
  678. /package/dist/{fsharp.js → vscode-default-extensions/fsharp/snippets/fsharp.code-snippets.js} +0 -0
  679. /package/dist/{fsharp.tmLanguage.js → vscode-default-extensions/fsharp/syntaxes/fsharp.tmLanguage.json.js} +0 -0
  680. /package/dist/{language-configuration11.js → vscode-default-extensions/go/language-configuration.json.js} +0 -0
  681. /package/dist/{go.tmLanguage.js → vscode-default-extensions/go/syntaxes/go.tmLanguage.json.js} +0 -0
  682. /package/dist/{language-configuration12.js → vscode-default-extensions/groovy/language-configuration.json.js} +0 -0
  683. /package/dist/{groovy.js → vscode-default-extensions/groovy/snippets/groovy.code-snippets.js} +0 -0
  684. /package/dist/{groovy.tmLanguage.js → vscode-default-extensions/groovy/syntaxes/groovy.tmLanguage.json.js} +0 -0
  685. /package/dist/{language-configuration13.js → vscode-default-extensions/handlebars/language-configuration.json.js} +0 -0
  686. /package/dist/{Handlebars.tmLanguage.js → vscode-default-extensions/handlebars/syntaxes/Handlebars.tmLanguage.json.js} +0 -0
  687. /package/dist/{language-configuration14.js → vscode-default-extensions/hlsl/language-configuration.json.js} +0 -0
  688. /package/dist/{hlsl.tmLanguage.js → vscode-default-extensions/hlsl/syntaxes/hlsl.tmLanguage.json.js} +0 -0
  689. /package/dist/{language-configuration15.js → vscode-default-extensions/html/language-configuration.json.js} +0 -0
  690. /package/dist/{html.js → vscode-default-extensions/html/snippets/html.code-snippets.js} +0 -0
  691. /package/dist/{html-derivative.tmLanguage.js → vscode-default-extensions/html/syntaxes/html-derivative.tmLanguage.json.js} +0 -0
  692. /package/dist/{html.tmLanguage.js → vscode-default-extensions/html/syntaxes/html.tmLanguage.json.js} +0 -0
  693. /package/dist/{ini.language-configuration.js → vscode-default-extensions/ini/ini.language-configuration.json.js} +0 -0
  694. /package/dist/{properties.language-configuration.js → vscode-default-extensions/ini/properties.language-configuration.json.js} +0 -0
  695. /package/dist/{ini.tmLanguage.js → vscode-default-extensions/ini/syntaxes/ini.tmLanguage.json.js} +0 -0
  696. /package/dist/{language-configuration16.js → vscode-default-extensions/java/language-configuration.json.js} +0 -0
  697. /package/dist/{java.js → vscode-default-extensions/java/snippets/java.code-snippets.js} +0 -0
  698. /package/dist/{java.tmLanguage.js → vscode-default-extensions/java/syntaxes/java.tmLanguage.json.js} +0 -0
  699. /package/dist/{javascript-language-configuration.js → vscode-default-extensions/javascript/javascript-language-configuration.json.js} +0 -0
  700. /package/dist/{javascript.js → vscode-default-extensions/javascript/snippets/javascript.code-snippets.js} +0 -0
  701. /package/dist/{JavaScript.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScript.tmLanguage.json.js} +0 -0
  702. /package/dist/{JavaScriptReact.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json.js} +0 -0
  703. /package/dist/{Regular Expressions (JavaScript).js → vscode-default-extensions/javascript/syntaxes/Regular Expressions (JavaScript).tmLanguage.js} +0 -0
  704. /package/dist/{tags-language-configuration.js → vscode-default-extensions/javascript/tags-language-configuration.json.js} +0 -0
  705. /package/dist/{language-configuration17.js → vscode-default-extensions/json/language-configuration.json.js} +0 -0
  706. /package/dist/{JSON.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSON.tmLanguage.json.js} +0 -0
  707. /package/dist/{JSONC.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.js} +0 -0
  708. /package/dist/{language-configuration18.js → vscode-default-extensions/julia/language-configuration.json.js} +0 -0
  709. /package/dist/{julia.tmLanguage.js → vscode-default-extensions/julia/syntaxes/julia.tmLanguage.json.js} +0 -0
  710. /package/dist/{latex-cpp-embedded-language-configuration.js → vscode-default-extensions/latex/latex-cpp-embedded-language-configuration.json.js} +0 -0
  711. /package/dist/{latex-language-configuration.js → vscode-default-extensions/latex/latex-language-configuration.json.js} +0 -0
  712. /package/dist/{markdown-latex-combined-language-configuration.js → vscode-default-extensions/latex/markdown-latex-combined-language-configuration.json.js} +0 -0
  713. /package/dist/{Bibtex.tmLanguage.js → vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.js} +0 -0
  714. /package/dist/{LaTeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.js} +0 -0
  715. /package/dist/{TeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.js} +0 -0
  716. /package/dist/{cpp-grammar-bailout.tmLanguage.js → vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.js} +0 -0
  717. /package/dist/{markdown-latex-combined.tmLanguage.js → vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.js} +0 -0
  718. /package/dist/{language-configuration19.js → vscode-default-extensions/less/language-configuration.json.js} +0 -0
  719. /package/dist/{less.tmLanguage.js → vscode-default-extensions/less/syntaxes/less.tmLanguage.json.js} +0 -0
  720. /package/dist/{log.tmLanguage.js → vscode-default-extensions/log/syntaxes/log.tmLanguage.json.js} +0 -0
  721. /package/dist/{language-configuration20.js → vscode-default-extensions/lua/language-configuration.json.js} +0 -0
  722. /package/dist/{lua.tmLanguage.js → vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.js} +0 -0
  723. /package/dist/{language-configuration21.js → vscode-default-extensions/make/language-configuration.json.js} +0 -0
  724. /package/dist/{make.tmLanguage.js → vscode-default-extensions/make/syntaxes/make.tmLanguage.json.js} +0 -0
  725. /package/dist/{language-configuration22.js → vscode-default-extensions/markdown-basics/language-configuration.json.js} +0 -0
  726. /package/dist/{markdown.js → vscode-default-extensions/markdown-basics/snippets/markdown.code-snippets.js} +0 -0
  727. /package/dist/{markdown.tmLanguage.js → vscode-default-extensions/markdown-basics/syntaxes/markdown.tmLanguage.json.js} +0 -0
  728. /package/dist/{language-configuration23.js → vscode-default-extensions/objective-c/language-configuration.json.js} +0 -0
  729. /package/dist/{objective-c.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c.tmLanguage.json.js} +0 -0
  730. /package/dist/{objective-c__.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c__.tmLanguage.json.js} +0 -0
  731. /package/dist/{perl.language-configuration.js → vscode-default-extensions/perl/perl.language-configuration.json.js} +0 -0
  732. /package/dist/{perl6.language-configuration.js → vscode-default-extensions/perl/perl6.language-configuration.json.js} +0 -0
  733. /package/dist/{perl.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl.tmLanguage.json.js} +0 -0
  734. /package/dist/{perl6.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl6.tmLanguage.json.js} +0 -0
  735. /package/dist/{language-configuration24.js → vscode-default-extensions/php/language-configuration.json.js} +0 -0
  736. /package/dist/{php.js → vscode-default-extensions/php/snippets/php.code-snippets.js} +0 -0
  737. /package/dist/{html.tmLanguage2.js → vscode-default-extensions/php/syntaxes/html.tmLanguage.json.js} +0 -0
  738. /package/dist/{php.tmLanguage.js → vscode-default-extensions/php/syntaxes/php.tmLanguage.json.js} +0 -0
  739. /package/dist/{language-configuration25.js → vscode-default-extensions/powershell/language-configuration.json.js} +0 -0
  740. /package/dist/{powershell.tmLanguage.js → vscode-default-extensions/powershell/syntaxes/powershell.tmLanguage.json.js} +0 -0
  741. /package/dist/{language-configuration26.js → vscode-default-extensions/pug/language-configuration.json.js} +0 -0
  742. /package/dist/{pug.tmLanguage.js → vscode-default-extensions/pug/syntaxes/pug.tmLanguage.json.js} +0 -0
  743. /package/dist/{language-configuration27.js → vscode-default-extensions/python/language-configuration.json.js} +0 -0
  744. /package/dist/{MagicPython.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicPython.tmLanguage.json.js} +0 -0
  745. /package/dist/{MagicRegExp.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicRegExp.tmLanguage.json.js} +0 -0
  746. /package/dist/{language-configuration28.js → vscode-default-extensions/r/language-configuration.json.js} +0 -0
  747. /package/dist/{r.tmLanguage.js → vscode-default-extensions/r/syntaxes/r.tmLanguage.json.js} +0 -0
  748. /package/dist/{language-configuration29.js → vscode-default-extensions/razor/language-configuration.json.js} +0 -0
  749. /package/dist/{cshtml.tmLanguage.js → vscode-default-extensions/razor/syntaxes/cshtml.tmLanguage.json.js} +0 -0
  750. /package/dist/{language-configuration30.js → vscode-default-extensions/ruby/language-configuration.json.js} +0 -0
  751. /package/dist/{ruby.tmLanguage.js → vscode-default-extensions/ruby/syntaxes/ruby.tmLanguage.json.js} +0 -0
  752. /package/dist/{language-configuration31.js → vscode-default-extensions/rust/language-configuration.json.js} +0 -0
  753. /package/dist/{rust.tmLanguage.js → vscode-default-extensions/rust/syntaxes/rust.tmLanguage.json.js} +0 -0
  754. /package/dist/{language-configuration32.js → vscode-default-extensions/scss/language-configuration.json.js} +0 -0
  755. /package/dist/{sassdoc.tmLanguage.js → vscode-default-extensions/scss/syntaxes/sassdoc.tmLanguage.json.js} +0 -0
  756. /package/dist/{scss.tmLanguage.js → vscode-default-extensions/scss/syntaxes/scss.tmLanguage.json.js} +0 -0
  757. /package/dist/{language-configuration33.js → vscode-default-extensions/shaderlab/language-configuration.json.js} +0 -0
  758. /package/dist/{shaderlab.tmLanguage.js → vscode-default-extensions/shaderlab/syntaxes/shaderlab.tmLanguage.json.js} +0 -0
  759. /package/dist/{language-configuration34.js → vscode-default-extensions/shellscript/language-configuration.json.js} +0 -0
  760. /package/dist/{shell-unix-bash.tmLanguage.js → vscode-default-extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json.js} +0 -0
  761. /package/dist/{language-configuration35.js → vscode-default-extensions/sql/language-configuration.json.js} +0 -0
  762. /package/dist/{sql.tmLanguage.js → vscode-default-extensions/sql/syntaxes/sql.tmLanguage.json.js} +0 -0
  763. /package/dist/{language-configuration36.js → vscode-default-extensions/swift/language-configuration.json.js} +0 -0
  764. /package/dist/{swift.js → vscode-default-extensions/swift/snippets/swift.code-snippets.js} +0 -0
  765. /package/dist/{swift.tmLanguage.js → vscode-default-extensions/swift/syntaxes/swift.tmLanguage.json.js} +0 -0
  766. /package/dist/{abyss-color-theme.js → vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.js} +0 -0
  767. /package/dist/{vs_minimal-icon-theme.js → vscode-default-extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json.js} +0 -0
  768. /package/dist/{dark_plus.js → vscode-default-extensions/theme-defaults/themes/dark_plus.json.js} +0 -0
  769. /package/dist/{dark_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.js} +0 -0
  770. /package/dist/{dark_vs.js → vscode-default-extensions/theme-defaults/themes/dark_vs.json.js} +0 -0
  771. /package/dist/{hc_black.js → vscode-default-extensions/theme-defaults/themes/hc_black.json.js} +0 -0
  772. /package/dist/{hc_light.js → vscode-default-extensions/theme-defaults/themes/hc_light.json.js} +0 -0
  773. /package/dist/{light_plus.js → vscode-default-extensions/theme-defaults/themes/light_plus.json.js} +0 -0
  774. /package/dist/{light_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.js} +0 -0
  775. /package/dist/{light_vs.js → vscode-default-extensions/theme-defaults/themes/light_vs.json.js} +0 -0
  776. /package/dist/{kimbie-dark-color-theme.js → vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.js} +0 -0
  777. /package/dist/{monokai-color-theme.js → vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.js} +0 -0
  778. /package/dist/{dimmed-monokai-color-theme.js → vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.js} +0 -0
  779. /package/dist/{quietlight-color-theme.js → vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.js} +0 -0
  780. /package/dist/{Red-color-theme.js → vscode-default-extensions/theme-red/themes/Red-color-theme.json.js} +0 -0
  781. /package/dist/{vs-seti-icon-theme.js → vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.js} +0 -0
  782. /package/dist/{solarized-dark-color-theme.js → vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.js} +0 -0
  783. /package/dist/{solarized-light-color-theme.js → vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.js} +0 -0
  784. /package/dist/{tomorrow-night-blue-color-theme.js → vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.js} +0 -0
  785. /package/dist/{language-configuration37.js → vscode-default-extensions/typescript-basics/language-configuration.json.js} +0 -0
  786. /package/dist/{typescript.js → vscode-default-extensions/typescript-basics/snippets/typescript.code-snippets.js} +0 -0
  787. /package/dist/{TypeScript.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json.js} +0 -0
  788. /package/dist/{TypeScriptReact.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json.js} +0 -0
  789. /package/dist/{jsdoc.js.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.js.injection.tmLanguage.json.js} +0 -0
  790. /package/dist/{jsdoc.ts.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.ts.injection.tmLanguage.json.js} +0 -0
  791. /package/dist/{language-configuration38.js → vscode-default-extensions/vb/language-configuration.json.js} +0 -0
  792. /package/dist/{vb.js → vscode-default-extensions/vb/snippets/vb.code-snippets.js} +0 -0
  793. /package/dist/{asp-vb-net.tmlanguage.js → vscode-default-extensions/vb/syntaxes/asp-vb-net.tmlanguage.json.js} +0 -0
  794. /package/dist/{xml.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xml.tmLanguage.json.js} +0 -0
  795. /package/dist/{xsl.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xsl.tmLanguage.json.js} +0 -0
  796. /package/dist/{xml.language-configuration.js → vscode-default-extensions/xml/xml.language-configuration.json.js} +0 -0
  797. /package/dist/{xsl.language-configuration.js → vscode-default-extensions/xml/xsl.language-configuration.json.js} +0 -0
  798. /package/dist/{language-configuration39.js → vscode-default-extensions/yaml/language-configuration.json.js} +0 -0
  799. /package/dist/{yaml.tmLanguage.js → vscode-default-extensions/yaml/syntaxes/yaml.tmLanguage.json.js} +0 -0
@@ -1,4438 +0,0 @@
1
- import { __decorate, memoizedConstructor, isEmptyObject, configurationDefaultsSchemaId, __param, Extensions$2, Emitter, isTemporaryWorkspace, restoreRecentlyOpened, isRecentFolder, isRecentWorkspace, isRecentFile, toStoreData, getStoredWorkspaceFolder, ExtensionIdentifierMap, IUserDataProfilesService, IFileService, IWorkspaceEditingService, IWorkspacesService, IWorkbenchEnvironmentService, IExtensionService, ILifecycleService, Position$2, getPathLabel, isWorkspace, isUntitledWorkspace, tildify, IPathService, IRemoteAgentService, IUriIdentityService, IUserDataProfileService, IPolicyService, registerServiceInitializeParticipant, Barrier, NullPolicyService, NullPolicyConfiguration, PolicyConfiguration, Queue, isStoredWorkspaceFolder, toWorkspaceFolders, IJSONEditingService, isWorkspaceFolder$1, mark, toWorkspaceFolder, delta$1, mergeChanges, keyFromOverrideIdentifiers, mnemonicButtonLabel, hasWorkspaceFileExtension, isSavedWorkspace, rewriteWorkspaceFileForNewLocation, ITextFileService, IFileDialogService, IHostService, parse$1, setProperty, applyEdits, visit, Selection$2, withUndefinedAsNull, IPreferencesService, IEditorService, UserSettings, whenProviderRegistered, Range$2, getErrorMessage, withFormatting, getEOL } from './polyfill.js';
2
- export { ConfigurationScope } from './polyfill.js';
3
- import { ConfigurationModel, Configuration as Configuration$1, ConfigurationModelParser, ConfigurationChangeEvent } from 'monaco-editor/esm/vs/platform/configuration/common/configurationModels.js';
4
- import { firstOrDefault, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
5
- import { isObject, withNullAsUndefined, isBoolean } from 'monaco-editor/esm/vs/base/common/types.js';
6
- import { IConfigurationService, toValuesTree } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
7
- import { deepClone, equals } from 'monaco-editor/esm/vs/base/common/objects.js';
8
- import { workspaceSettingsSchemaId, launchSchemaId, tasksSchemaId, defaultSettingsSchemaId, userSettingsSchemaId, profileSettingsSchemaId, machineSettingsSchemaId, folderSettingsSchemaId, FOLDER_CONFIG_FOLDER_NAME, IWorkbenchConfigurationService, TASKS_CONFIGURATION_KEY, LAUNCH_CONFIGURATION_KEY, TASKS_DEFAULT, FOLDER_SCOPES, FOLDER_SETTINGS_PATH, REMOTE_MACHINE_SCOPES, WORKSPACE_SCOPES, FOLDER_SETTINGS_NAME, LOCAL_MACHINE_SCOPES, LOCAL_MACHINE_PROFILE_SCOPES, PROFILE_SCOPES, USER_STANDALONE_CONFIGURATIONS, WORKSPACE_STANDALONE_CONFIGURATIONS } from './configuration2.js';
9
- import { EditOperation } from 'monaco-editor/esm/vs/editor/common/core/editOperation.js';
10
- import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
11
- import { localize } from 'monaco-editor/esm/vs/nls.js';
12
- import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
13
- import { Extensions, OVERRIDE_PROPERTY_REGEX, applicationSettings, windowSettings, resourceSettings, allSettings, machineSettings, machineOverridableSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, validateProperty } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
14
- import { WORKSPACE_EXTENSION, IWorkspaceContextService, toWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, WORKSPACE_FILTER, Workspace as Workspace$1 } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
15
- import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
16
- import { DefaultConfiguration as DefaultConfiguration$1 } from 'monaco-editor/esm/vs/platform/configuration/common/configurations.js';
17
- import { Disposable, DisposableStore, MutableDisposable, combinedDisposable, toDisposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
18
- import { Delayer, Promises, runWhenIdle, RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
19
- import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
20
- import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
21
- import { joinPath, basenameOrAuthority, basename, dirname, isEqualAuthority, isEqual, removeTrailingPathSeparator } from 'monaco-editor/esm/vs/base/common/resources.js';
22
- import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
23
- import { ResourceMap } from 'monaco-editor/esm/vs/base/common/map.js';
24
- import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
25
- import { toErrorMessage } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
26
- import { IWorkspaceTrustManagementService } from 'monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js';
27
- import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
28
- import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
29
- import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
30
- import { Memento } from './memento.js';
31
- import { OS } from 'monaco-editor/esm/vs/base/common/platform.js';
32
- import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
33
- import { match } from 'monaco-editor/esm/vs/base/common/glob.js';
34
- import { posix, win32 } from 'monaco-editor/esm/vs/base/common/path.js';
35
- import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
36
- import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
37
- import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
38
- import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
39
- import { ExtensionsRegistry } from './extensionsRegistry.js';
40
- import getServiceOverride$1 from './files.js';
41
- import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
42
- import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
43
- import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
44
- import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
45
- import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
46
- import { generateUuid } from 'monaco-editor/esm/vs/base/common/uuid.js';
47
- function isConfigurationOverrides(thing) {
48
- return thing
49
- && typeof thing === 'object'
50
- && (!thing.overrideIdentifier || typeof thing.overrideIdentifier === 'string')
51
- && (!thing.resource || thing.resource instanceof URI);
52
- }
53
- function isConfigurationUpdateOverrides(thing) {
54
- return thing
55
- && typeof thing === 'object'
56
- && (!thing.overrideIdentifiers || Array.isArray(thing.overrideIdentifiers))
57
- && !thing.overrideIdentifier
58
- && (!thing.resource || thing.resource instanceof URI);
59
- }
60
- function ConfigurationTargetToString(configurationTarget) {
61
- switch (configurationTarget) {
62
- case 1 : return 'APPLICATION';
63
- case 2 : return 'USER';
64
- case 3 : return 'USER_LOCAL';
65
- case 4 : return 'USER_REMOTE';
66
- case 5 : return 'WORKSPACE';
67
- case 6 : return 'WORKSPACE_FOLDER';
68
- case 7 : return 'DEFAULT';
69
- case 8 : return 'MEMORY';
70
- }
71
- }
72
- function edit(content, originalPath, value, formattingOptions) {
73
- const edit = setProperty(content, originalPath, value, formattingOptions)[0];
74
- if (edit) {
75
- content = content.substring(0, edit.offset) + edit.content + content.substring(edit.offset + edit.length);
76
- }
77
- return content;
78
- }
79
- function updateIgnoredSettings(targetContent, sourceContent, ignoredSettings, formattingOptions) {
80
- if (ignoredSettings.length) {
81
- const sourceTree = parseSettings(sourceContent);
82
- const source = parse$1(sourceContent) || {};
83
- const target = parse$1(targetContent);
84
- if (!target) {
85
- return targetContent;
86
- }
87
- const settingsToAdd = [];
88
- for (const key of ignoredSettings) {
89
- const sourceValue = source[key];
90
- const targetValue = target[key];
91
- if (sourceValue === undefined) {
92
- targetContent = edit(targetContent, [key], undefined, formattingOptions);
93
- }
94
- else if (targetValue !== undefined) {
95
- targetContent = edit(targetContent, [key], sourceValue, formattingOptions);
96
- }
97
- else {
98
- settingsToAdd.push(findSettingNode(key, sourceTree));
99
- }
100
- }
101
- settingsToAdd.sort((a, b) => a.startOffset - b.startOffset);
102
- settingsToAdd.forEach(s => targetContent = addSetting(s.setting.key, sourceContent, targetContent, formattingOptions));
103
- }
104
- return targetContent;
105
- }
106
- function addSetting(key, sourceContent, targetContent, formattingOptions) {
107
- const source = parse$1(sourceContent);
108
- const sourceTree = parseSettings(sourceContent);
109
- const targetTree = parseSettings(targetContent);
110
- const insertLocation = getInsertLocation(key, sourceTree, targetTree);
111
- return insertAtLocation(targetContent, key, source[key], insertLocation, targetTree, formattingOptions);
112
- }
113
- function getInsertLocation(key, sourceTree, targetTree) {
114
- const sourceNodeIndex = sourceTree.findIndex(node => node.setting?.key === key);
115
- const sourcePreviousNode = sourceTree[sourceNodeIndex - 1];
116
- if (sourcePreviousNode) {
117
- if (sourcePreviousNode.setting) {
118
- const targetPreviousSetting = findSettingNode(sourcePreviousNode.setting.key, targetTree);
119
- if (targetPreviousSetting) {
120
- return { index: targetTree.indexOf(targetPreviousSetting), insertAfter: true };
121
- }
122
- }
123
- else {
124
- const sourcePreviousSettingNode = findPreviousSettingNode(sourceNodeIndex, sourceTree);
125
- if (sourcePreviousSettingNode) {
126
- const targetPreviousSetting = findSettingNode(sourcePreviousSettingNode.setting.key, targetTree);
127
- if (targetPreviousSetting) {
128
- const targetNextSetting = findNextSettingNode(targetTree.indexOf(targetPreviousSetting), targetTree);
129
- const sourceCommentNodes = findNodesBetween(sourceTree, sourcePreviousSettingNode, sourceTree[sourceNodeIndex]);
130
- if (targetNextSetting) {
131
- const targetCommentNodes = findNodesBetween(targetTree, targetPreviousSetting, targetNextSetting);
132
- const targetCommentNode = findLastMatchingTargetCommentNode(sourceCommentNodes, targetCommentNodes);
133
- if (targetCommentNode) {
134
- return { index: targetTree.indexOf(targetCommentNode), insertAfter: true };
135
- }
136
- else {
137
- return { index: targetTree.indexOf(targetNextSetting), insertAfter: false };
138
- }
139
- }
140
- else {
141
- const targetCommentNodes = findNodesBetween(targetTree, targetPreviousSetting, targetTree[targetTree.length - 1]);
142
- const targetCommentNode = findLastMatchingTargetCommentNode(sourceCommentNodes, targetCommentNodes);
143
- if (targetCommentNode) {
144
- return { index: targetTree.indexOf(targetCommentNode), insertAfter: true };
145
- }
146
- else {
147
- return { index: targetTree.length - 1, insertAfter: true };
148
- }
149
- }
150
- }
151
- }
152
- }
153
- const sourceNextNode = sourceTree[sourceNodeIndex + 1];
154
- if (sourceNextNode) {
155
- if (sourceNextNode.setting) {
156
- const targetNextSetting = findSettingNode(sourceNextNode.setting.key, targetTree);
157
- if (targetNextSetting) {
158
- return { index: targetTree.indexOf(targetNextSetting), insertAfter: false };
159
- }
160
- }
161
- else {
162
- const sourceNextSettingNode = findNextSettingNode(sourceNodeIndex, sourceTree);
163
- if (sourceNextSettingNode) {
164
- const targetNextSetting = findSettingNode(sourceNextSettingNode.setting.key, targetTree);
165
- if (targetNextSetting) {
166
- const targetPreviousSetting = findPreviousSettingNode(targetTree.indexOf(targetNextSetting), targetTree);
167
- const sourceCommentNodes = findNodesBetween(sourceTree, sourceTree[sourceNodeIndex], sourceNextSettingNode);
168
- if (targetPreviousSetting) {
169
- const targetCommentNodes = findNodesBetween(targetTree, targetPreviousSetting, targetNextSetting);
170
- const targetCommentNode = findLastMatchingTargetCommentNode(sourceCommentNodes.reverse(), targetCommentNodes.reverse());
171
- if (targetCommentNode) {
172
- return { index: targetTree.indexOf(targetCommentNode), insertAfter: false };
173
- }
174
- else {
175
- return { index: targetTree.indexOf(targetPreviousSetting), insertAfter: true };
176
- }
177
- }
178
- else {
179
- const targetCommentNodes = findNodesBetween(targetTree, targetTree[0], targetNextSetting);
180
- const targetCommentNode = findLastMatchingTargetCommentNode(sourceCommentNodes.reverse(), targetCommentNodes.reverse());
181
- if (targetCommentNode) {
182
- return { index: targetTree.indexOf(targetCommentNode), insertAfter: false };
183
- }
184
- else {
185
- return { index: 0, insertAfter: false };
186
- }
187
- }
188
- }
189
- }
190
- }
191
- }
192
- }
193
- return { index: targetTree.length - 1, insertAfter: true };
194
- }
195
- function insertAtLocation(content, key, value, location, tree, formattingOptions) {
196
- let edits;
197
- if (location.index === -1) {
198
- edits = setProperty(content, [key], value, formattingOptions);
199
- }
200
- else {
201
- edits = ( (getEditToInsertAtLocation(content, key, value, location, tree, formattingOptions).map(edit => withFormatting(content, edit, formattingOptions)[0])));
202
- }
203
- return applyEdits(content, edits);
204
- }
205
- function getEditToInsertAtLocation(content, key, value, location, tree, formattingOptions) {
206
- const newProperty = `${JSON.stringify(key)}: ${JSON.stringify(value)}`;
207
- const eol = getEOL(formattingOptions, content);
208
- const node = tree[location.index];
209
- if (location.insertAfter) {
210
- const edits = [];
211
- if (node.setting) {
212
- edits.push({ offset: node.endOffset, length: 0, content: ',' + newProperty });
213
- }
214
- else {
215
- const nextSettingNode = findNextSettingNode(location.index, tree);
216
- const previousSettingNode = findPreviousSettingNode(location.index, tree);
217
- const previousSettingCommaOffset = previousSettingNode?.setting?.commaOffset;
218
- if (previousSettingNode && previousSettingCommaOffset === undefined) {
219
- edits.push({ offset: previousSettingNode.endOffset, length: 0, content: ',' });
220
- }
221
- const isPreviouisSettingIncludesComment = previousSettingCommaOffset !== undefined && previousSettingCommaOffset > node.endOffset;
222
- edits.push({
223
- offset: isPreviouisSettingIncludesComment ? previousSettingCommaOffset + 1 : node.endOffset,
224
- length: 0,
225
- content: nextSettingNode ? eol + newProperty + ',' : eol + newProperty
226
- });
227
- }
228
- return edits;
229
- }
230
- else {
231
- if (node.setting) {
232
- return [{ offset: node.startOffset, length: 0, content: newProperty + ',' }];
233
- }
234
- const content = (tree[location.index - 1] && !tree[location.index - 1].setting ? eol : '')
235
- + newProperty
236
- + (findNextSettingNode(location.index, tree) ? ',' : '')
237
- + eol;
238
- return [{ offset: node.startOffset, length: 0, content }];
239
- }
240
- }
241
- function findSettingNode(key, tree) {
242
- return tree.filter(node => node.setting?.key === key)[0];
243
- }
244
- function findPreviousSettingNode(index, tree) {
245
- for (let i = index - 1; i >= 0; i--) {
246
- if (tree[i].setting) {
247
- return tree[i];
248
- }
249
- }
250
- return undefined;
251
- }
252
- function findNextSettingNode(index, tree) {
253
- for (let i = index + 1; i < tree.length; i++) {
254
- if (tree[i].setting) {
255
- return tree[i];
256
- }
257
- }
258
- return undefined;
259
- }
260
- function findNodesBetween(nodes, from, till) {
261
- const fromIndex = nodes.indexOf(from);
262
- const tillIndex = nodes.indexOf(till);
263
- return nodes.filter((node, index) => fromIndex < index && index < tillIndex);
264
- }
265
- function findLastMatchingTargetCommentNode(sourceComments, targetComments) {
266
- if (sourceComments.length && targetComments.length) {
267
- let index = 0;
268
- for (; index < targetComments.length && index < sourceComments.length; index++) {
269
- if (sourceComments[index].value !== targetComments[index].value) {
270
- return targetComments[index - 1];
271
- }
272
- }
273
- return targetComments[index - 1];
274
- }
275
- return undefined;
276
- }
277
- function parseSettings(content) {
278
- const nodes = [];
279
- let hierarchyLevel = -1;
280
- let startOffset;
281
- let key;
282
- const visitor = {
283
- onObjectBegin: (offset) => {
284
- hierarchyLevel++;
285
- },
286
- onObjectProperty: (name, offset, length) => {
287
- if (hierarchyLevel === 0) {
288
- startOffset = offset;
289
- key = name;
290
- }
291
- },
292
- onObjectEnd: (offset, length) => {
293
- hierarchyLevel--;
294
- if (hierarchyLevel === 0) {
295
- nodes.push({
296
- startOffset,
297
- endOffset: offset + length,
298
- value: content.substring(startOffset, offset + length),
299
- setting: {
300
- key,
301
- commaOffset: undefined
302
- }
303
- });
304
- }
305
- },
306
- onArrayBegin: (offset, length) => {
307
- hierarchyLevel++;
308
- },
309
- onArrayEnd: (offset, length) => {
310
- hierarchyLevel--;
311
- if (hierarchyLevel === 0) {
312
- nodes.push({
313
- startOffset,
314
- endOffset: offset + length,
315
- value: content.substring(startOffset, offset + length),
316
- setting: {
317
- key,
318
- commaOffset: undefined
319
- }
320
- });
321
- }
322
- },
323
- onLiteralValue: (value, offset, length) => {
324
- if (hierarchyLevel === 0) {
325
- nodes.push({
326
- startOffset,
327
- endOffset: offset + length,
328
- value: content.substring(startOffset, offset + length),
329
- setting: {
330
- key,
331
- commaOffset: undefined
332
- }
333
- });
334
- }
335
- },
336
- onSeparator: (sep, offset, length) => {
337
- if (hierarchyLevel === 0) {
338
- if (sep === ',') {
339
- let index = nodes.length - 1;
340
- for (; index >= 0; index--) {
341
- if (nodes[index].setting) {
342
- break;
343
- }
344
- }
345
- const node = nodes[index];
346
- if (node) {
347
- nodes.splice(index, 1, {
348
- startOffset: node.startOffset,
349
- endOffset: node.endOffset,
350
- value: node.value,
351
- setting: {
352
- key: node.setting.key,
353
- commaOffset: offset
354
- }
355
- });
356
- }
357
- }
358
- }
359
- },
360
- onComment: (offset, length) => {
361
- if (hierarchyLevel === 0) {
362
- nodes.push({
363
- startOffset: offset,
364
- endOffset: offset + length,
365
- value: content.substring(offset, offset + length),
366
- });
367
- }
368
- }
369
- };
370
- visit(content, visitor);
371
- return nodes;
372
- }
373
- class WorkspaceConfigurationModelParser extends ConfigurationModelParser {
374
- constructor(name) {
375
- super(name);
376
- this._folders = [];
377
- this._transient = false;
378
- this._settingsModelParser = ( (new ConfigurationModelParser(name)));
379
- this._launchModel = ( (new ConfigurationModel()));
380
- this._tasksModel = ( (new ConfigurationModel()));
381
- }
382
- get folders() {
383
- return this._folders;
384
- }
385
- get transient() {
386
- return this._transient;
387
- }
388
- get settingsModel() {
389
- return this._settingsModelParser.configurationModel;
390
- }
391
- get launchModel() {
392
- return this._launchModel;
393
- }
394
- get tasksModel() {
395
- return this._tasksModel;
396
- }
397
- reparseWorkspaceSettings(configurationParseOptions) {
398
- this._settingsModelParser.reparse(configurationParseOptions);
399
- }
400
- getRestrictedWorkspaceSettings() {
401
- return this._settingsModelParser.restrictedConfigurations;
402
- }
403
- doParseRaw(raw, configurationParseOptions) {
404
- this._folders = (raw['folders'] || []);
405
- this._transient = isBoolean(raw['transient']) && raw['transient'];
406
- this._settingsModelParser.parseRaw(raw['settings'], configurationParseOptions);
407
- this._launchModel = this.createConfigurationModelFrom(raw, 'launch');
408
- this._tasksModel = this.createConfigurationModelFrom(raw, 'tasks');
409
- return super.doParseRaw(raw, configurationParseOptions);
410
- }
411
- createConfigurationModelFrom(raw, key) {
412
- const data = raw[key];
413
- if (data) {
414
- const contents = toValuesTree(data, message => console.error(`Conflict in settings file ${this._name}: ${message}`));
415
- const scopedContents = Object.create(null);
416
- scopedContents[key] = contents;
417
- const keys = ( (( (Object.keys(data))).map(k => `${key}.${k}`)));
418
- return (
419
- (new ConfigurationModel(scopedContents, keys, []))
420
- );
421
- }
422
- return (
423
- (new ConfigurationModel())
424
- );
425
- }
426
- }
427
- class StandaloneConfigurationModelParser extends ConfigurationModelParser {
428
- constructor(name, scope) {
429
- super(name);
430
- this.scope = scope;
431
- }
432
- doParseRaw(raw, configurationParseOptions) {
433
- const contents = toValuesTree(raw, message => console.error(`Conflict in settings file ${this._name}: ${message}`));
434
- const scopedContents = Object.create(null);
435
- scopedContents[this.scope] = contents;
436
- const keys = ( (( (Object.keys(raw))).map(key => `${this.scope}.${key}`)));
437
- return { contents: scopedContents, keys, overrides: [] };
438
- }
439
- }
440
- class Configuration extends Configuration$1 {
441
- constructor(defaults, policy, application, localUser, remoteUser, workspaceConfiguration, folders, memoryConfiguration, memoryConfigurationByResource, _workspace) {
442
- super(defaults, policy, application, localUser, remoteUser, workspaceConfiguration, folders, memoryConfiguration, memoryConfigurationByResource);
443
- this._workspace = _workspace;
444
- }
445
- getValue(key, overrides = {}) {
446
- return super.getValue(key, overrides, this._workspace);
447
- }
448
- inspect(key, overrides = {}) {
449
- return super.inspect(key, overrides, this._workspace);
450
- }
451
- keys() {
452
- return (
453
- (super.keys(this._workspace))
454
- );
455
- }
456
- compareAndDeleteFolderConfiguration(folder) {
457
- if (this._workspace && this._workspace.folders.length > 0 && ( (this._workspace.folders[0].uri.toString())) === ( (folder.toString()))) {
458
- return { keys: [], overrides: [] };
459
- }
460
- return super.compareAndDeleteFolderConfiguration(folder);
461
- }
462
- compare(other) {
463
- const compare = (fromKeys, toKeys, overrideIdentifier) => {
464
- const keys = [];
465
- keys.push(...toKeys.filter(key => fromKeys.indexOf(key) === -1));
466
- keys.push(...fromKeys.filter(key => toKeys.indexOf(key) === -1));
467
- keys.push(...fromKeys.filter(key => {
468
- if (toKeys.indexOf(key) === -1) {
469
- return false;
470
- }
471
- if (!equals(this.getValue(key, { overrideIdentifier }), other.getValue(key, { overrideIdentifier }))) {
472
- return true;
473
- }
474
- return this._workspace && this._workspace.folders.some(folder => !equals(this.getValue(key, { resource: folder.uri, overrideIdentifier }), other.getValue(key, { resource: folder.uri, overrideIdentifier })));
475
- }));
476
- return keys;
477
- };
478
- const keys = compare(this.allKeys(), other.allKeys());
479
- const overrides = [];
480
- const allOverrideIdentifiers = distinct([...this.allOverrideIdentifiers(), ...other.allOverrideIdentifiers()]);
481
- for (const overrideIdentifier of allOverrideIdentifiers) {
482
- const keys = compare(this.getAllKeysForOverrideIdentifier(overrideIdentifier), other.getAllKeysForOverrideIdentifier(overrideIdentifier), overrideIdentifier);
483
- if (keys.length) {
484
- overrides.push([overrideIdentifier, keys]);
485
- }
486
- }
487
- return { keys, overrides };
488
- }
489
- }
490
- class ConfigurationEditingError extends Error {
491
- constructor(message, code) {
492
- super(message);
493
- this.code = code;
494
- }
495
- }
496
- let ConfigurationEditing = class ConfigurationEditing {
497
- constructor(remoteSettingsResource, configurationService, contextService, userDataProfileService, userDataProfilesService, fileService, textModelResolverService, textFileService, notificationService, preferencesService, editorService, uriIdentityService) {
498
- this.remoteSettingsResource = remoteSettingsResource;
499
- this.configurationService = configurationService;
500
- this.contextService = contextService;
501
- this.userDataProfileService = userDataProfileService;
502
- this.userDataProfilesService = userDataProfilesService;
503
- this.fileService = fileService;
504
- this.textModelResolverService = textModelResolverService;
505
- this.textFileService = textFileService;
506
- this.notificationService = notificationService;
507
- this.preferencesService = preferencesService;
508
- this.editorService = editorService;
509
- this.uriIdentityService = uriIdentityService;
510
- this.queue = ( (new Queue()));
511
- }
512
- async writeConfiguration(target, value, options = {}) {
513
- const operation = this.getConfigurationEditOperation(target, value, options.scopes || {});
514
- return this.queue.queue(async () => {
515
- try {
516
- await this.doWriteConfiguration(operation, options);
517
- }
518
- catch (error) {
519
- if (options.donotNotifyError) {
520
- throw error;
521
- }
522
- await this.onError(error, operation, options.scopes);
523
- }
524
- });
525
- }
526
- async doWriteConfiguration(operation, options) {
527
- await this.validate(operation.target, operation, !options.handleDirtyFile, options.scopes || {});
528
- const resource = operation.resource;
529
- const reference = await this.resolveModelReference(resource);
530
- try {
531
- const formattingOptions = this.getFormattingOptions(reference.object.textEditorModel);
532
- await this.updateConfiguration(operation, reference.object.textEditorModel, formattingOptions, options);
533
- }
534
- finally {
535
- reference.dispose();
536
- }
537
- }
538
- async updateConfiguration(operation, model, formattingOptions, options) {
539
- if (this.hasParseErrors(model.getValue(), operation)) {
540
- throw this.toConfigurationEditingError(11 , operation.target, operation);
541
- }
542
- if (this.textFileService.isDirty(model.uri) && options.handleDirtyFile) {
543
- switch (options.handleDirtyFile) {
544
- case 'save':
545
- await this.save(model, operation);
546
- break;
547
- case 'revert':
548
- await this.textFileService.revert(model.uri);
549
- break;
550
- }
551
- }
552
- const edit = this.getEdits(operation, model.getValue(), formattingOptions)[0];
553
- if (edit && this.applyEditsToBuffer(edit, model)) {
554
- await this.save(model, operation);
555
- }
556
- }
557
- async save(model, operation) {
558
- try {
559
- await this.textFileService.save(model.uri, { ignoreErrorHandler: true });
560
- }
561
- catch (error) {
562
- if (error.fileOperationResult === 3 ) {
563
- throw this.toConfigurationEditingError(10 , operation.target, operation);
564
- }
565
- throw this.toConfigurationEditingError(13 , operation.target, operation);
566
- }
567
- }
568
- applyEditsToBuffer(edit, model) {
569
- const startPosition = model.getPositionAt(edit.offset);
570
- const endPosition = model.getPositionAt(edit.offset + edit.length);
571
- const range = ( (new Range$2(
572
- startPosition.lineNumber,
573
- startPosition.column,
574
- endPosition.lineNumber,
575
- endPosition.column
576
- )));
577
- const currentText = model.getValueInRange(range);
578
- if (edit.content !== currentText) {
579
- const editOperation = currentText ? EditOperation.replace(range, edit.content) : EditOperation.insert(startPosition, edit.content);
580
- model.pushEditOperations([( (new Selection$2(
581
- startPosition.lineNumber,
582
- startPosition.column,
583
- startPosition.lineNumber,
584
- startPosition.column
585
- )))], [editOperation], () => []);
586
- return true;
587
- }
588
- return false;
589
- }
590
- getEdits({ value, jsonPath }, modelContent, formattingOptions) {
591
- if (jsonPath.length) {
592
- return setProperty(modelContent, jsonPath, value, formattingOptions);
593
- }
594
- const content = JSON.stringify(value, null, formattingOptions.insertSpaces && formattingOptions.tabSize ? ' '.repeat(formattingOptions.tabSize) : '\t');
595
- return [{
596
- content,
597
- length: modelContent.length,
598
- offset: 0
599
- }];
600
- }
601
- getFormattingOptions(model) {
602
- const { insertSpaces, tabSize } = model.getOptions();
603
- const eol = model.getEOL();
604
- return { insertSpaces, tabSize, eol };
605
- }
606
- async onError(error, operation, scopes) {
607
- switch (error.code) {
608
- case 11 :
609
- this.onInvalidConfigurationError(error, operation);
610
- break;
611
- case 9 :
612
- this.onConfigurationFileDirtyError(error, operation, scopes);
613
- break;
614
- case 10 :
615
- return this.doWriteConfiguration(operation, { scopes, handleDirtyFile: 'revert' });
616
- default:
617
- this.notificationService.error(error.message);
618
- }
619
- }
620
- onInvalidConfigurationError(error, operation) {
621
- const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( (localize('openTasksConfiguration', "Open Tasks Configuration")))
622
- : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( (localize('openLaunchConfiguration', "Open Launch Configuration")))
623
- : null;
624
- if (openStandAloneConfigurationActionLabel) {
625
- this.notificationService.prompt(Severity.Error, error.message, [{
626
- label: openStandAloneConfigurationActionLabel,
627
- run: () => this.openFile(operation.resource)
628
- }]);
629
- }
630
- else {
631
- this.notificationService.prompt(Severity.Error, error.message, [{
632
- label: ( (localize('open', "Open Settings"))),
633
- run: () => this.openSettings(operation)
634
- }]);
635
- }
636
- }
637
- onConfigurationFileDirtyError(error, operation, scopes) {
638
- const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( (localize('openTasksConfiguration', "Open Tasks Configuration")))
639
- : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( (localize('openLaunchConfiguration', "Open Launch Configuration")))
640
- : null;
641
- if (openStandAloneConfigurationActionLabel) {
642
- this.notificationService.prompt(Severity.Error, error.message, [{
643
- label: ( (localize('saveAndRetry', "Save and Retry"))),
644
- run: () => {
645
- const key = operation.key ? `${operation.workspaceStandAloneConfigurationKey}.${operation.key}` : operation.workspaceStandAloneConfigurationKey;
646
- this.writeConfiguration(operation.target, { key, value: operation.value }, { handleDirtyFile: 'save', scopes });
647
- }
648
- },
649
- {
650
- label: openStandAloneConfigurationActionLabel,
651
- run: () => this.openFile(operation.resource)
652
- }]);
653
- }
654
- else {
655
- this.notificationService.prompt(Severity.Error, error.message, [{
656
- label: ( (localize('saveAndRetry', "Save and Retry"))),
657
- run: () => this.writeConfiguration(operation.target, { key: operation.key, value: operation.value }, { handleDirtyFile: 'save', scopes })
658
- },
659
- {
660
- label: ( (localize('open', "Open Settings"))),
661
- run: () => this.openSettings(operation)
662
- }]);
663
- }
664
- }
665
- openSettings(operation) {
666
- const options = { jsonEditor: true };
667
- switch (operation.target) {
668
- case 1 :
669
- this.preferencesService.openUserSettings(options);
670
- break;
671
- case 2 :
672
- this.preferencesService.openRemoteSettings(options);
673
- break;
674
- case 3 :
675
- this.preferencesService.openWorkspaceSettings(options);
676
- break;
677
- case 4 :
678
- if (operation.resource) {
679
- const workspaceFolder = this.contextService.getWorkspaceFolder(operation.resource);
680
- if (workspaceFolder) {
681
- this.preferencesService.openFolderSettings({ folderUri: workspaceFolder.uri, jsonEditor: true });
682
- }
683
- }
684
- break;
685
- }
686
- }
687
- openFile(resource) {
688
- this.editorService.openEditor({ resource, options: { pinned: true } });
689
- }
690
- toConfigurationEditingError(code, target, operation) {
691
- const message = this.toErrorMessage(code, target, operation);
692
- return (
693
- (new ConfigurationEditingError(message, code))
694
- );
695
- }
696
- toErrorMessage(error, target, operation) {
697
- switch (error) {
698
- case 12 : return (
699
- (localize(
700
- 'errorPolicyConfiguration',
701
- "Unable to write {0} because it is configured in system policy.",
702
- operation.key
703
- ))
704
- );
705
- case 0 : return (
706
- (localize(
707
- 'errorUnknownKey',
708
- "Unable to write to {0} because {1} is not a registered configuration.",
709
- this.stringifyTarget(target),
710
- operation.key
711
- ))
712
- );
713
- case 1 : return (
714
- (localize(
715
- 'errorInvalidWorkspaceConfigurationApplication',
716
- "Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
717
- operation.key
718
- ))
719
- );
720
- case 2 : return (
721
- (localize(
722
- 'errorInvalidWorkspaceConfigurationMachine',
723
- "Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
724
- operation.key
725
- ))
726
- );
727
- case 3 : return (
728
- (localize(
729
- 'errorInvalidFolderConfiguration',
730
- "Unable to write to Folder Settings because {0} does not support the folder resource scope.",
731
- operation.key
732
- ))
733
- );
734
- case 4 : return (
735
- (localize(
736
- 'errorInvalidUserTarget',
737
- "Unable to write to User Settings because {0} does not support for global scope.",
738
- operation.key
739
- ))
740
- );
741
- case 5 : return (
742
- (localize(
743
- 'errorInvalidWorkspaceTarget',
744
- "Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",
745
- operation.key
746
- ))
747
- );
748
- case 6 : return (
749
- (localize(
750
- 'errorInvalidFolderTarget',
751
- "Unable to write to Folder Settings because no resource is provided."
752
- ))
753
- );
754
- case 7 : return (
755
- (localize(
756
- 'errorInvalidResourceLanguageConfiguration',
757
- "Unable to write to Language Settings because {0} is not a resource language setting.",
758
- operation.key
759
- ))
760
- );
761
- case 8 : return (
762
- (localize(
763
- 'errorNoWorkspaceOpened',
764
- "Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",
765
- this.stringifyTarget(target)
766
- ))
767
- );
768
- case 11 : {
769
- if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
770
- return (
771
- (localize(
772
- 'errorInvalidTaskConfiguration',
773
- "Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again."
774
- ))
775
- );
776
- }
777
- if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
778
- return (
779
- (localize(
780
- 'errorInvalidLaunchConfiguration',
781
- "Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again."
782
- ))
783
- );
784
- }
785
- switch (target) {
786
- case 1 :
787
- return (
788
- (localize(
789
- 'errorInvalidConfiguration',
790
- "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."
791
- ))
792
- );
793
- case 2 :
794
- return (
795
- (localize(
796
- 'errorInvalidRemoteConfiguration',
797
- "Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again."
798
- ))
799
- );
800
- case 3 :
801
- return (
802
- (localize(
803
- 'errorInvalidConfigurationWorkspace',
804
- "Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again."
805
- ))
806
- );
807
- case 4 : {
808
- let workspaceFolderName = '<<unknown>>';
809
- if (operation.resource) {
810
- const folder = this.contextService.getWorkspaceFolder(operation.resource);
811
- if (folder) {
812
- workspaceFolderName = folder.name;
813
- }
814
- }
815
- return (
816
- (localize(
817
- 'errorInvalidConfigurationFolder',
818
- "Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",
819
- workspaceFolderName
820
- ))
821
- );
822
- }
823
- default:
824
- return '';
825
- }
826
- }
827
- case 9 : {
828
- if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
829
- return (
830
- (localize(
831
- 'errorTasksConfigurationFileDirty',
832
- "Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again."
833
- ))
834
- );
835
- }
836
- if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
837
- return (
838
- (localize(
839
- 'errorLaunchConfigurationFileDirty',
840
- "Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again."
841
- ))
842
- );
843
- }
844
- switch (target) {
845
- case 1 :
846
- return (
847
- (localize(
848
- 'errorConfigurationFileDirty',
849
- "Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again."
850
- ))
851
- );
852
- case 2 :
853
- return (
854
- (localize(
855
- 'errorRemoteConfigurationFileDirty',
856
- "Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again."
857
- ))
858
- );
859
- case 3 :
860
- return (
861
- (localize(
862
- 'errorConfigurationFileDirtyWorkspace',
863
- "Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again."
864
- ))
865
- );
866
- case 4 : {
867
- let workspaceFolderName = '<<unknown>>';
868
- if (operation.resource) {
869
- const folder = this.contextService.getWorkspaceFolder(operation.resource);
870
- if (folder) {
871
- workspaceFolderName = folder.name;
872
- }
873
- }
874
- return (
875
- (localize(
876
- 'errorConfigurationFileDirtyFolder',
877
- "Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",
878
- workspaceFolderName
879
- ))
880
- );
881
- }
882
- default:
883
- return '';
884
- }
885
- }
886
- case 10 :
887
- if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
888
- return (
889
- (localize(
890
- 'errorTasksConfigurationFileModifiedSince',
891
- "Unable to write into tasks configuration file because the content of the file is newer."
892
- ))
893
- );
894
- }
895
- if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
896
- return (
897
- (localize(
898
- 'errorLaunchConfigurationFileModifiedSince',
899
- "Unable to write into launch configuration file because the content of the file is newer."
900
- ))
901
- );
902
- }
903
- switch (target) {
904
- case 1 :
905
- return (
906
- (localize(
907
- 'errorConfigurationFileModifiedSince',
908
- "Unable to write into user settings because the content of the file is newer."
909
- ))
910
- );
911
- case 2 :
912
- return (
913
- (localize(
914
- 'errorRemoteConfigurationFileModifiedSince',
915
- "Unable to write into remote user settings because the content of the file is newer."
916
- ))
917
- );
918
- case 3 :
919
- return (
920
- (localize(
921
- 'errorConfigurationFileModifiedSinceWorkspace',
922
- "Unable to write into workspace settings because the content of the file is newer."
923
- ))
924
- );
925
- case 4 :
926
- return (
927
- (localize(
928
- 'errorConfigurationFileModifiedSinceFolder',
929
- "Unable to write into folder settings because the content of the file is newer."
930
- ))
931
- );
932
- }
933
- case 13 : return (
934
- (localize(
935
- 'errorUnknown',
936
- "Unable to write to {0} because of an internal error.",
937
- this.stringifyTarget(target)
938
- ))
939
- );
940
- }
941
- }
942
- stringifyTarget(target) {
943
- switch (target) {
944
- case 1 :
945
- return (
946
- (localize('userTarget', "User Settings"))
947
- );
948
- case 2 :
949
- return (
950
- (localize('remoteUserTarget', "Remote User Settings"))
951
- );
952
- case 3 :
953
- return (
954
- (localize('workspaceTarget', "Workspace Settings"))
955
- );
956
- case 4 :
957
- return (
958
- (localize('folderTarget', "Folder Settings"))
959
- );
960
- default:
961
- return '';
962
- }
963
- }
964
- defaultResourceValue(resource) {
965
- const basename = this.uriIdentityService.extUri.basename(resource);
966
- const configurationValue = basename.substr(0, basename.length - this.uriIdentityService.extUri.extname(resource).length);
967
- switch (configurationValue) {
968
- case TASKS_CONFIGURATION_KEY: return TASKS_DEFAULT;
969
- default: return '{}';
970
- }
971
- }
972
- async resolveModelReference(resource) {
973
- const exists = await this.fileService.exists(resource);
974
- if (!exists) {
975
- await this.textFileService.write(resource, this.defaultResourceValue(resource), { encoding: 'utf8' });
976
- }
977
- return this.textModelResolverService.createModelReference(resource);
978
- }
979
- hasParseErrors(content, operation) {
980
- if (operation.workspaceStandAloneConfigurationKey && !operation.key) {
981
- return false;
982
- }
983
- const parseErrors = [];
984
- parse$1(content, parseErrors, { allowTrailingComma: true, allowEmptyContent: true });
985
- return parseErrors.length > 0;
986
- }
987
- async validate(target, operation, checkDirty, overrides) {
988
- if (this.configurationService.inspect(operation.key).policyValue !== undefined) {
989
- throw this.toConfigurationEditingError(12 , target, operation);
990
- }
991
- const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
992
- const configurationScope = configurationProperties[operation.key]?.scope;
993
- if (!operation.workspaceStandAloneConfigurationKey) {
994
- const validKeys = ( (this.configurationService.keys())).default;
995
- if (validKeys.indexOf(operation.key) < 0 && !OVERRIDE_PROPERTY_REGEX.test(operation.key) && operation.value !== undefined) {
996
- throw this.toConfigurationEditingError(0 , target, operation);
997
- }
998
- }
999
- if (operation.workspaceStandAloneConfigurationKey) {
1000
- if ((operation.workspaceStandAloneConfigurationKey !== TASKS_CONFIGURATION_KEY) && ((target === 1 || target === 2) )) {
1001
- throw this.toConfigurationEditingError(4 , target, operation);
1002
- }
1003
- }
1004
- if (((target === 3 || target === 4) ) && this.contextService.getWorkbenchState() === 1 ) {
1005
- throw this.toConfigurationEditingError(8 , target, operation);
1006
- }
1007
- if (target === 3 ) {
1008
- if (!operation.workspaceStandAloneConfigurationKey && !OVERRIDE_PROPERTY_REGEX.test(operation.key)) {
1009
- if (configurationScope === 1 ) {
1010
- throw this.toConfigurationEditingError(1 , target, operation);
1011
- }
1012
- if (configurationScope === 2 ) {
1013
- throw this.toConfigurationEditingError(2 , target, operation);
1014
- }
1015
- }
1016
- }
1017
- if (target === 4 ) {
1018
- if (!operation.resource) {
1019
- throw this.toConfigurationEditingError(6 , target, operation);
1020
- }
1021
- if (!operation.workspaceStandAloneConfigurationKey && !OVERRIDE_PROPERTY_REGEX.test(operation.key)) {
1022
- if (configurationScope !== undefined && !FOLDER_SCOPES.includes(configurationScope)) {
1023
- throw this.toConfigurationEditingError(3 , target, operation);
1024
- }
1025
- }
1026
- }
1027
- if (overrides.overrideIdentifiers?.length) {
1028
- if (configurationScope !== 5 ) {
1029
- throw this.toConfigurationEditingError(7 , target, operation);
1030
- }
1031
- }
1032
- if (!operation.resource) {
1033
- throw this.toConfigurationEditingError(6 , target, operation);
1034
- }
1035
- if (checkDirty && this.textFileService.isDirty(operation.resource)) {
1036
- throw this.toConfigurationEditingError(9 , target, operation);
1037
- }
1038
- }
1039
- getConfigurationEditOperation(target, config, overrides) {
1040
- if (config.key) {
1041
- const standaloneConfigurationMap = target === 1 ? USER_STANDALONE_CONFIGURATIONS : WORKSPACE_STANDALONE_CONFIGURATIONS;
1042
- const standaloneConfigurationKeys = ( (Object.keys(standaloneConfigurationMap)));
1043
- for (const key of standaloneConfigurationKeys) {
1044
- const resource = this.getConfigurationFileResource(target, key, standaloneConfigurationMap[key], overrides.resource, undefined);
1045
- if (config.key === key) {
1046
- const jsonPath = this.isWorkspaceConfigurationResource(resource) ? [key] : [];
1047
- return { key: jsonPath[jsonPath.length - 1], jsonPath, value: config.value, resource: withNullAsUndefined(resource), workspaceStandAloneConfigurationKey: key, target };
1048
- }
1049
- const keyPrefix = `${key}.`;
1050
- if (config.key.indexOf(keyPrefix) === 0) {
1051
- const jsonPath = this.isWorkspaceConfigurationResource(resource) ? [key, config.key.substr(keyPrefix.length)] : [config.key.substr(keyPrefix.length)];
1052
- return { key: jsonPath[jsonPath.length - 1], jsonPath, value: config.value, resource: withNullAsUndefined(resource), workspaceStandAloneConfigurationKey: key, target };
1053
- }
1054
- }
1055
- }
1056
- const key = config.key;
1057
- const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
1058
- const configurationScope = configurationProperties[key]?.scope;
1059
- let jsonPath = overrides.overrideIdentifiers?.length ? [keyFromOverrideIdentifiers(overrides.overrideIdentifiers), key] : [key];
1060
- if (target === 1 || target === 2 ) {
1061
- return { key, jsonPath, value: config.value, resource: withNullAsUndefined(this.getConfigurationFileResource(target, undefined, '', null, configurationScope)), target };
1062
- }
1063
- const resource = this.getConfigurationFileResource(target, undefined, FOLDER_SETTINGS_PATH, overrides.resource, configurationScope);
1064
- if (this.isWorkspaceConfigurationResource(resource)) {
1065
- jsonPath = ['settings', ...jsonPath];
1066
- }
1067
- return { key, jsonPath, value: config.value, resource: withNullAsUndefined(resource), target };
1068
- }
1069
- isWorkspaceConfigurationResource(resource) {
1070
- const workspace = this.contextService.getWorkspace();
1071
- return !!(workspace.configuration && resource && workspace.configuration.fsPath === resource.fsPath);
1072
- }
1073
- getConfigurationFileResource(target, standAloneConfigurationKey, relativePath, resource, scope) {
1074
- if (target === 1 ) {
1075
- if (standAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
1076
- return this.userDataProfileService.currentProfile.tasksResource;
1077
- }
1078
- else {
1079
- if (scope === 1 && !this.userDataProfileService.currentProfile.isDefault) {
1080
- return this.userDataProfilesService.defaultProfile.settingsResource;
1081
- }
1082
- return this.userDataProfileService.currentProfile.settingsResource;
1083
- }
1084
- }
1085
- if (target === 2 ) {
1086
- return this.remoteSettingsResource;
1087
- }
1088
- const workbenchState = this.contextService.getWorkbenchState();
1089
- if (workbenchState !== 1 ) {
1090
- const workspace = this.contextService.getWorkspace();
1091
- if (target === 3 ) {
1092
- if (workbenchState === 3 ) {
1093
- return withUndefinedAsNull(workspace.configuration);
1094
- }
1095
- if (workbenchState === 2 ) {
1096
- return workspace.folders[0].toResource(relativePath);
1097
- }
1098
- }
1099
- if (target === 4 ) {
1100
- if (resource) {
1101
- const folder = this.contextService.getWorkspaceFolder(resource);
1102
- if (folder) {
1103
- return folder.toResource(relativePath);
1104
- }
1105
- }
1106
- }
1107
- }
1108
- return null;
1109
- }
1110
- };
1111
- ConfigurationEditing = ( (__decorate([
1112
- ( (__param(1, IConfigurationService))),
1113
- ( (__param(2, IWorkspaceContextService))),
1114
- ( (__param(3, IUserDataProfileService))),
1115
- ( (__param(4, IUserDataProfilesService))),
1116
- ( (__param(5, IFileService))),
1117
- ( (__param(6, ITextModelService))),
1118
- ( (__param(7, ITextFileService))),
1119
- ( (__param(8, INotificationService))),
1120
- ( (__param(9, IPreferencesService))),
1121
- ( (__param(10, IEditorService))),
1122
- ( (__param(11, IUriIdentityService)))
1123
- ], ConfigurationEditing)));
1124
- class DefaultConfiguration extends DefaultConfiguration$1 {
1125
- constructor(configurationCache, environmentService) {
1126
- super();
1127
- this.configurationCache = configurationCache;
1128
- this.configurationRegistry = ( (Registry.as(Extensions.Configuration)));
1129
- this.cachedConfigurationDefaultsOverrides = {};
1130
- this.cacheKey = { type: 'defaults', key: 'configurationDefaultsOverrides' };
1131
- this.updateCache = false;
1132
- if (environmentService.options?.configurationDefaults) {
1133
- this.configurationRegistry.registerDefaultConfigurations([{ overrides: environmentService.options.configurationDefaults }]);
1134
- }
1135
- }
1136
- getConfigurationDefaultOverrides() {
1137
- return this.cachedConfigurationDefaultsOverrides;
1138
- }
1139
- async initialize() {
1140
- await this.initializeCachedConfigurationDefaultsOverrides();
1141
- return super.initialize();
1142
- }
1143
- reload() {
1144
- this.updateCache = true;
1145
- this.cachedConfigurationDefaultsOverrides = {};
1146
- this.updateCachedConfigurationDefaultsOverrides();
1147
- return super.reload();
1148
- }
1149
- hasCachedConfigurationDefaultsOverrides() {
1150
- return !isEmptyObject(this.cachedConfigurationDefaultsOverrides);
1151
- }
1152
- initializeCachedConfigurationDefaultsOverrides() {
1153
- if (!this.initiaizeCachedConfigurationDefaultsOverridesPromise) {
1154
- this.initiaizeCachedConfigurationDefaultsOverridesPromise = (async () => {
1155
- try {
1156
- if (window.localStorage.getItem(DefaultConfiguration.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)) {
1157
- const content = await this.configurationCache.read(this.cacheKey);
1158
- if (content) {
1159
- this.cachedConfigurationDefaultsOverrides = JSON.parse(content);
1160
- }
1161
- }
1162
- }
1163
- catch (error) { }
1164
- this.cachedConfigurationDefaultsOverrides = isObject(this.cachedConfigurationDefaultsOverrides) ? this.cachedConfigurationDefaultsOverrides : {};
1165
- })();
1166
- }
1167
- return this.initiaizeCachedConfigurationDefaultsOverridesPromise;
1168
- }
1169
- onDidUpdateConfiguration(properties, defaultsOverrides) {
1170
- super.onDidUpdateConfiguration(properties, defaultsOverrides);
1171
- if (defaultsOverrides) {
1172
- this.updateCachedConfigurationDefaultsOverrides();
1173
- }
1174
- }
1175
- async updateCachedConfigurationDefaultsOverrides() {
1176
- if (!this.updateCache) {
1177
- return;
1178
- }
1179
- const cachedConfigurationDefaultsOverrides = {};
1180
- const configurationDefaultsOverrides = this.configurationRegistry.getConfigurationDefaultsOverrides();
1181
- for (const [key, value] of configurationDefaultsOverrides) {
1182
- if (!OVERRIDE_PROPERTY_REGEX.test(key) && value.value !== undefined) {
1183
- cachedConfigurationDefaultsOverrides[key] = value.value;
1184
- }
1185
- }
1186
- try {
1187
- if (( (Object.keys(cachedConfigurationDefaultsOverrides))).length) {
1188
- window.localStorage.setItem(DefaultConfiguration.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY, 'yes');
1189
- await this.configurationCache.write(this.cacheKey, JSON.stringify(cachedConfigurationDefaultsOverrides));
1190
- }
1191
- else {
1192
- window.localStorage.removeItem(DefaultConfiguration.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY);
1193
- await this.configurationCache.remove(this.cacheKey);
1194
- }
1195
- }
1196
- catch (error) { }
1197
- }
1198
- }
1199
- DefaultConfiguration.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY = 'DefaultOverridesCacheExists';
1200
- class UserConfiguration extends Disposable {
1201
- get hasTasksLoaded() { return this.userConfiguration.value instanceof FileServiceBasedConfiguration; }
1202
- constructor(settingsResource, tasksResource, scopes, fileService, uriIdentityService, logService) {
1203
- super();
1204
- this.settingsResource = settingsResource;
1205
- this.tasksResource = tasksResource;
1206
- this.fileService = fileService;
1207
- this.uriIdentityService = uriIdentityService;
1208
- this.logService = logService;
1209
- this._onDidChangeConfiguration = this._register(( (new Emitter())));
1210
- this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
1211
- this.userConfiguration = this._register(( (new MutableDisposable())));
1212
- this.userConfigurationChangeDisposable = this._register(( (new MutableDisposable())));
1213
- this.configurationParseOptions = { scopes, skipRestricted: false };
1214
- this.userConfiguration.value = ( (new UserSettings(settingsResource, scopes, uriIdentityService.extUri, this.fileService)));
1215
- this.userConfigurationChangeDisposable.value = this.userConfiguration.value.onDidChange(() => this.reloadConfigurationScheduler.schedule());
1216
- this.reloadConfigurationScheduler = this._register(( (new RunOnceScheduler(
1217
- () => this.userConfiguration.value.loadConfiguration().then(configurationModel => this._onDidChangeConfiguration.fire(configurationModel)),
1218
- 50
1219
- ))));
1220
- }
1221
- async reset(settingsResource, tasksResource, scopes) {
1222
- this.settingsResource = settingsResource;
1223
- this.tasksResource = tasksResource;
1224
- this.configurationParseOptions = { scopes, skipRestricted: false };
1225
- const folder = this.uriIdentityService.extUri.dirname(this.settingsResource);
1226
- const standAloneConfigurationResources = this.tasksResource ? [[TASKS_CONFIGURATION_KEY, this.tasksResource]] : [];
1227
- const fileServiceBasedConfiguration = ( (new FileServiceBasedConfiguration(
1228
- (folder.toString()),
1229
- this.settingsResource,
1230
- standAloneConfigurationResources,
1231
- this.configurationParseOptions,
1232
- this.fileService,
1233
- this.uriIdentityService,
1234
- this.logService
1235
- )));
1236
- const configurationModel = await fileServiceBasedConfiguration.loadConfiguration();
1237
- this.userConfiguration.value = fileServiceBasedConfiguration;
1238
- if (this.userConfigurationChangeDisposable.value) {
1239
- this.userConfigurationChangeDisposable.value = this.userConfiguration.value.onDidChange(() => this.reloadConfigurationScheduler.schedule());
1240
- }
1241
- return configurationModel;
1242
- }
1243
- async initialize() {
1244
- return this.userConfiguration.value.loadConfiguration();
1245
- }
1246
- async reload() {
1247
- if (this.hasTasksLoaded) {
1248
- return this.userConfiguration.value.loadConfiguration();
1249
- }
1250
- return this.reset(this.settingsResource, this.tasksResource, this.configurationParseOptions.scopes);
1251
- }
1252
- reparse() {
1253
- return this.userConfiguration.value.reparse(this.configurationParseOptions);
1254
- }
1255
- getRestrictedSettings() {
1256
- return this.userConfiguration.value.getRestrictedSettings();
1257
- }
1258
- }
1259
- class FileServiceBasedConfiguration extends Disposable {
1260
- constructor(name, settingsResource, standAloneConfigurationResources, configurationParseOptions, fileService, uriIdentityService, logService) {
1261
- super();
1262
- this.settingsResource = settingsResource;
1263
- this.standAloneConfigurationResources = standAloneConfigurationResources;
1264
- this.fileService = fileService;
1265
- this.uriIdentityService = uriIdentityService;
1266
- this.logService = logService;
1267
- this._onDidChange = this._register(( (new Emitter())));
1268
- this.onDidChange = this._onDidChange.event;
1269
- this.allResources = [this.settingsResource, ...( (this.standAloneConfigurationResources.map(([, resource]) => resource)))];
1270
- this._register(combinedDisposable(...( (this.allResources.map(
1271
- resource => combinedDisposable(this.fileService.watch(uriIdentityService.extUri.dirname(resource)),
1272
- this.fileService.watch(resource))
1273
- )))));
1274
- this._folderSettingsModelParser = ( (new ConfigurationModelParser(name)));
1275
- this._folderSettingsParseOptions = configurationParseOptions;
1276
- this._standAloneConfigurations = [];
1277
- this._cache = ( (new ConfigurationModel()));
1278
- this._register(Event.debounce(Event.any(Event.filter(this.fileService.onDidFilesChange, e => this.handleFileChangesEvent(e)), Event.filter(this.fileService.onDidRunOperation, e => this.handleFileOperationEvent(e))), () => undefined, 100)(() => this._onDidChange.fire()));
1279
- }
1280
- async resolveContents() {
1281
- const resolveContents = async (resources) => {
1282
- return Promise.all(( (resources.map(async (resource) => {
1283
- try {
1284
- const content = ( ((await this.fileService.readFile(resource)).value.toString()));
1285
- return content;
1286
- }
1287
- catch (error) {
1288
- this.logService.trace(`Error while resolving configuration file '${( ( resource.toString()))}': ${getErrorMessage(error)}`);
1289
- if (error.fileOperationResult !== 1
1290
- && error.fileOperationResult !== 10 ) {
1291
- this.logService.error(error);
1292
- }
1293
- }
1294
- return '{}';
1295
- }))));
1296
- };
1297
- const [[settingsContent], standAloneConfigurationContents] = await Promise.all([
1298
- resolveContents([this.settingsResource]),
1299
- resolveContents(( (this.standAloneConfigurationResources.map(([, resource]) => resource)))),
1300
- ]);
1301
- return [settingsContent, ( (standAloneConfigurationContents.map(
1302
- (content, index) => ([this.standAloneConfigurationResources[index][0], content])
1303
- )))];
1304
- }
1305
- async loadConfiguration() {
1306
- const [settingsContent, standAloneConfigurationContents] = await this.resolveContents();
1307
- this._standAloneConfigurations = [];
1308
- this._folderSettingsModelParser.parse('', this._folderSettingsParseOptions);
1309
- if (settingsContent !== undefined) {
1310
- this._folderSettingsModelParser.parse(settingsContent, this._folderSettingsParseOptions);
1311
- }
1312
- for (let index = 0; index < standAloneConfigurationContents.length; index++) {
1313
- const contents = standAloneConfigurationContents[index][1];
1314
- if (contents !== undefined) {
1315
- const standAloneConfigurationModelParser = ( (new StandaloneConfigurationModelParser(
1316
- (this.standAloneConfigurationResources[index][1].toString()),
1317
- this.standAloneConfigurationResources[index][0]
1318
- )));
1319
- standAloneConfigurationModelParser.parse(contents);
1320
- this._standAloneConfigurations.push(standAloneConfigurationModelParser.configurationModel);
1321
- }
1322
- }
1323
- this.consolidate();
1324
- return this._cache;
1325
- }
1326
- getRestrictedSettings() {
1327
- return this._folderSettingsModelParser.restrictedConfigurations;
1328
- }
1329
- reparse(configurationParseOptions) {
1330
- const oldContents = this._folderSettingsModelParser.configurationModel.contents;
1331
- this._folderSettingsParseOptions = configurationParseOptions;
1332
- this._folderSettingsModelParser.reparse(this._folderSettingsParseOptions);
1333
- if (!equals(oldContents, this._folderSettingsModelParser.configurationModel.contents)) {
1334
- this.consolidate();
1335
- }
1336
- return this._cache;
1337
- }
1338
- consolidate() {
1339
- this._cache = this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations);
1340
- }
1341
- handleFileChangesEvent(event) {
1342
- if (this.allResources.some(resource => event.contains(resource))) {
1343
- return true;
1344
- }
1345
- if (this.allResources.some(resource => event.contains(this.uriIdentityService.extUri.dirname(resource), 2 ))) {
1346
- return true;
1347
- }
1348
- return false;
1349
- }
1350
- handleFileOperationEvent(event) {
1351
- if ((event.isOperation(0 ) || event.isOperation(3 ) || event.isOperation(1 ) || event.isOperation(4 ))
1352
- && this.allResources.some(resource => this.uriIdentityService.extUri.isEqual(event.resource, resource))) {
1353
- return true;
1354
- }
1355
- if (event.isOperation(1 ) && this.allResources.some(resource => this.uriIdentityService.extUri.isEqual(event.resource, this.uriIdentityService.extUri.dirname(resource)))) {
1356
- return true;
1357
- }
1358
- return false;
1359
- }
1360
- }
1361
- class RemoteUserConfiguration extends Disposable {
1362
- constructor(remoteAuthority, configurationCache, fileService, uriIdentityService, remoteAgentService) {
1363
- super();
1364
- this._userConfigurationInitializationPromise = null;
1365
- this._onDidChangeConfiguration = this._register(( (new Emitter())));
1366
- this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
1367
- this._onDidInitialize = this._register(( (new Emitter())));
1368
- this.onDidInitialize = this._onDidInitialize.event;
1369
- this._fileService = fileService;
1370
- this._userConfiguration = this._cachedConfiguration = ( (new CachedRemoteUserConfiguration(remoteAuthority, configurationCache, { scopes: REMOTE_MACHINE_SCOPES })));
1371
- remoteAgentService.getEnvironment().then(async (environment) => {
1372
- if (environment) {
1373
- const userConfiguration = this._register(( (new FileServiceBasedRemoteUserConfiguration(
1374
- environment.settingsPath,
1375
- { scopes: REMOTE_MACHINE_SCOPES },
1376
- this._fileService,
1377
- uriIdentityService
1378
- ))));
1379
- this._register(userConfiguration.onDidChangeConfiguration(configurationModel => this.onDidUserConfigurationChange(configurationModel)));
1380
- this._userConfigurationInitializationPromise = userConfiguration.initialize();
1381
- const configurationModel = await this._userConfigurationInitializationPromise;
1382
- this._userConfiguration.dispose();
1383
- this._userConfiguration = userConfiguration;
1384
- this.onDidUserConfigurationChange(configurationModel);
1385
- this._onDidInitialize.fire(configurationModel);
1386
- }
1387
- });
1388
- }
1389
- async initialize() {
1390
- if (this._userConfiguration instanceof FileServiceBasedRemoteUserConfiguration) {
1391
- return this._userConfiguration.initialize();
1392
- }
1393
- let configurationModel = await this._userConfiguration.initialize();
1394
- if (this._userConfigurationInitializationPromise) {
1395
- configurationModel = await this._userConfigurationInitializationPromise;
1396
- this._userConfigurationInitializationPromise = null;
1397
- }
1398
- return configurationModel;
1399
- }
1400
- reload() {
1401
- return this._userConfiguration.reload();
1402
- }
1403
- reparse() {
1404
- return this._userConfiguration.reparse({ scopes: REMOTE_MACHINE_SCOPES });
1405
- }
1406
- getRestrictedSettings() {
1407
- return this._userConfiguration.getRestrictedSettings();
1408
- }
1409
- onDidUserConfigurationChange(configurationModel) {
1410
- this.updateCache();
1411
- this._onDidChangeConfiguration.fire(configurationModel);
1412
- }
1413
- async updateCache() {
1414
- if (this._userConfiguration instanceof FileServiceBasedRemoteUserConfiguration) {
1415
- let content;
1416
- try {
1417
- content = await this._userConfiguration.resolveContent();
1418
- }
1419
- catch (error) {
1420
- if (error.fileOperationResult !== 1 ) {
1421
- return;
1422
- }
1423
- }
1424
- await this._cachedConfiguration.updateConfiguration(content);
1425
- }
1426
- }
1427
- }
1428
- class FileServiceBasedRemoteUserConfiguration extends Disposable {
1429
- constructor(configurationResource, configurationParseOptions, fileService, uriIdentityService) {
1430
- super();
1431
- this.configurationResource = configurationResource;
1432
- this.fileService = fileService;
1433
- this.uriIdentityService = uriIdentityService;
1434
- this._onDidChangeConfiguration = this._register(( (new Emitter())));
1435
- this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
1436
- this.fileWatcherDisposable = Disposable.None;
1437
- this.directoryWatcherDisposable = Disposable.None;
1438
- this.parser = ( (new ConfigurationModelParser( (this.configurationResource.toString()))));
1439
- this.parseOptions = configurationParseOptions;
1440
- this._register(fileService.onDidFilesChange(e => this.handleFileChangesEvent(e)));
1441
- this._register(fileService.onDidRunOperation(e => this.handleFileOperationEvent(e)));
1442
- this.reloadConfigurationScheduler = this._register(( (new RunOnceScheduler(
1443
- () => this.reload().then(configurationModel => this._onDidChangeConfiguration.fire(configurationModel)),
1444
- 50
1445
- ))));
1446
- this._register(toDisposable(() => {
1447
- this.stopWatchingResource();
1448
- this.stopWatchingDirectory();
1449
- }));
1450
- }
1451
- watchResource() {
1452
- this.fileWatcherDisposable = this.fileService.watch(this.configurationResource);
1453
- }
1454
- stopWatchingResource() {
1455
- this.fileWatcherDisposable.dispose();
1456
- this.fileWatcherDisposable = Disposable.None;
1457
- }
1458
- watchDirectory() {
1459
- const directory = this.uriIdentityService.extUri.dirname(this.configurationResource);
1460
- this.directoryWatcherDisposable = this.fileService.watch(directory);
1461
- }
1462
- stopWatchingDirectory() {
1463
- this.directoryWatcherDisposable.dispose();
1464
- this.directoryWatcherDisposable = Disposable.None;
1465
- }
1466
- async initialize() {
1467
- const exists = await this.fileService.exists(this.configurationResource);
1468
- this.onResourceExists(exists);
1469
- return this.reload();
1470
- }
1471
- async resolveContent() {
1472
- const content = await this.fileService.readFile(this.configurationResource);
1473
- return (
1474
- (content.value.toString())
1475
- );
1476
- }
1477
- async reload() {
1478
- try {
1479
- const content = await this.resolveContent();
1480
- this.parser.parse(content, this.parseOptions);
1481
- return this.parser.configurationModel;
1482
- }
1483
- catch (e) {
1484
- return (
1485
- (new ConfigurationModel())
1486
- );
1487
- }
1488
- }
1489
- reparse(configurationParseOptions) {
1490
- this.parseOptions = configurationParseOptions;
1491
- this.parser.reparse(this.parseOptions);
1492
- return this.parser.configurationModel;
1493
- }
1494
- getRestrictedSettings() {
1495
- return this.parser.restrictedConfigurations;
1496
- }
1497
- handleFileChangesEvent(event) {
1498
- let affectedByChanges = event.contains(this.configurationResource, 0 );
1499
- if (event.contains(this.configurationResource, 1 )) {
1500
- affectedByChanges = true;
1501
- this.onResourceExists(true);
1502
- }
1503
- else if (event.contains(this.configurationResource, 2 )) {
1504
- affectedByChanges = true;
1505
- this.onResourceExists(false);
1506
- }
1507
- if (affectedByChanges) {
1508
- this.reloadConfigurationScheduler.schedule();
1509
- }
1510
- }
1511
- handleFileOperationEvent(event) {
1512
- if ((event.isOperation(0 ) || event.isOperation(3 ) || event.isOperation(1 ) || event.isOperation(4 ))
1513
- && this.uriIdentityService.extUri.isEqual(event.resource, this.configurationResource)) {
1514
- this.reloadConfigurationScheduler.schedule();
1515
- }
1516
- }
1517
- onResourceExists(exists) {
1518
- if (exists) {
1519
- this.stopWatchingDirectory();
1520
- this.watchResource();
1521
- }
1522
- else {
1523
- this.stopWatchingResource();
1524
- this.watchDirectory();
1525
- }
1526
- }
1527
- }
1528
- class CachedRemoteUserConfiguration extends Disposable {
1529
- constructor(remoteAuthority, configurationCache, configurationParseOptions) {
1530
- super();
1531
- this.configurationCache = configurationCache;
1532
- this._onDidChange = this._register(( (new Emitter())));
1533
- this.onDidChange = this._onDidChange.event;
1534
- this.key = { type: 'user', key: remoteAuthority };
1535
- this.parser = ( (new ConfigurationModelParser('CachedRemoteUserConfiguration')));
1536
- this.parseOptions = configurationParseOptions;
1537
- this.configurationModel = ( (new ConfigurationModel()));
1538
- }
1539
- getConfigurationModel() {
1540
- return this.configurationModel;
1541
- }
1542
- initialize() {
1543
- return this.reload();
1544
- }
1545
- reparse(configurationParseOptions) {
1546
- this.parseOptions = configurationParseOptions;
1547
- this.parser.reparse(this.parseOptions);
1548
- this.configurationModel = this.parser.configurationModel;
1549
- return this.configurationModel;
1550
- }
1551
- getRestrictedSettings() {
1552
- return this.parser.restrictedConfigurations;
1553
- }
1554
- async reload() {
1555
- try {
1556
- const content = await this.configurationCache.read(this.key);
1557
- const parsed = JSON.parse(content);
1558
- if (parsed.content) {
1559
- this.parser.parse(parsed.content, this.parseOptions);
1560
- this.configurationModel = this.parser.configurationModel;
1561
- }
1562
- }
1563
- catch (e) { }
1564
- return this.configurationModel;
1565
- }
1566
- async updateConfiguration(content) {
1567
- if (content) {
1568
- return this.configurationCache.write(this.key, JSON.stringify({ content }));
1569
- }
1570
- else {
1571
- return this.configurationCache.remove(this.key);
1572
- }
1573
- }
1574
- }
1575
- class WorkspaceConfiguration extends Disposable {
1576
- get initialized() { return this._initialized; }
1577
- constructor(configurationCache, fileService, uriIdentityService, logService) {
1578
- super();
1579
- this.configurationCache = configurationCache;
1580
- this.fileService = fileService;
1581
- this.uriIdentityService = uriIdentityService;
1582
- this.logService = logService;
1583
- this._workspaceConfigurationDisposables = this._register(( (new DisposableStore())));
1584
- this._workspaceIdentifier = null;
1585
- this._isWorkspaceTrusted = false;
1586
- this._onDidUpdateConfiguration = this._register(( (new Emitter())));
1587
- this.onDidUpdateConfiguration = this._onDidUpdateConfiguration.event;
1588
- this._initialized = false;
1589
- this.fileService = fileService;
1590
- this._workspaceConfiguration = this._cachedConfiguration = ( (new CachedWorkspaceConfiguration(configurationCache)));
1591
- }
1592
- async initialize(workspaceIdentifier, workspaceTrusted) {
1593
- this._workspaceIdentifier = workspaceIdentifier;
1594
- this._isWorkspaceTrusted = workspaceTrusted;
1595
- if (!this._initialized) {
1596
- if (this.configurationCache.needsCaching(this._workspaceIdentifier.configPath)) {
1597
- this._workspaceConfiguration = this._cachedConfiguration;
1598
- this.waitAndInitialize(this._workspaceIdentifier);
1599
- }
1600
- else {
1601
- this.doInitialize(( (new FileServiceBasedWorkspaceConfiguration(this.fileService, this.uriIdentityService, this.logService))));
1602
- }
1603
- }
1604
- await this.reload();
1605
- }
1606
- async reload() {
1607
- if (this._workspaceIdentifier) {
1608
- await this._workspaceConfiguration.load(this._workspaceIdentifier, { scopes: WORKSPACE_SCOPES, skipRestricted: this.isUntrusted() });
1609
- }
1610
- }
1611
- getFolders() {
1612
- return this._workspaceConfiguration.getFolders();
1613
- }
1614
- setFolders(folders, jsonEditingService) {
1615
- if (this._workspaceIdentifier) {
1616
- return jsonEditingService.write(this._workspaceIdentifier.configPath, [{ path: ['folders'], value: folders }], true)
1617
- .then(() => this.reload());
1618
- }
1619
- return Promise.resolve();
1620
- }
1621
- isTransient() {
1622
- return this._workspaceConfiguration.isTransient();
1623
- }
1624
- getConfiguration() {
1625
- return this._workspaceConfiguration.getWorkspaceSettings();
1626
- }
1627
- updateWorkspaceTrust(trusted) {
1628
- this._isWorkspaceTrusted = trusted;
1629
- return this.reparseWorkspaceSettings();
1630
- }
1631
- reparseWorkspaceSettings() {
1632
- this._workspaceConfiguration.reparseWorkspaceSettings({ scopes: WORKSPACE_SCOPES, skipRestricted: this.isUntrusted() });
1633
- return this.getConfiguration();
1634
- }
1635
- getRestrictedSettings() {
1636
- return this._workspaceConfiguration.getRestrictedSettings();
1637
- }
1638
- async waitAndInitialize(workspaceIdentifier) {
1639
- await whenProviderRegistered(workspaceIdentifier.configPath, this.fileService);
1640
- if (!(this._workspaceConfiguration instanceof FileServiceBasedWorkspaceConfiguration)) {
1641
- const fileServiceBasedWorkspaceConfiguration = this._register(( (new FileServiceBasedWorkspaceConfiguration(this.fileService, this.uriIdentityService, this.logService))));
1642
- await fileServiceBasedWorkspaceConfiguration.load(workspaceIdentifier, { scopes: WORKSPACE_SCOPES, skipRestricted: this.isUntrusted() });
1643
- this.doInitialize(fileServiceBasedWorkspaceConfiguration);
1644
- this.onDidWorkspaceConfigurationChange(false, true);
1645
- }
1646
- }
1647
- doInitialize(fileServiceBasedWorkspaceConfiguration) {
1648
- this._workspaceConfigurationDisposables.clear();
1649
- this._workspaceConfiguration = this._workspaceConfigurationDisposables.add(fileServiceBasedWorkspaceConfiguration);
1650
- this._workspaceConfigurationDisposables.add(this._workspaceConfiguration.onDidChange(e => this.onDidWorkspaceConfigurationChange(true, false)));
1651
- this._initialized = true;
1652
- }
1653
- isUntrusted() {
1654
- return !this._isWorkspaceTrusted;
1655
- }
1656
- async onDidWorkspaceConfigurationChange(reload, fromCache) {
1657
- if (reload) {
1658
- await this.reload();
1659
- }
1660
- this.updateCache();
1661
- this._onDidUpdateConfiguration.fire(fromCache);
1662
- }
1663
- async updateCache() {
1664
- if (this._workspaceIdentifier && this.configurationCache.needsCaching(this._workspaceIdentifier.configPath) && this._workspaceConfiguration instanceof FileServiceBasedWorkspaceConfiguration) {
1665
- const content = await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);
1666
- await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier, content);
1667
- }
1668
- }
1669
- }
1670
- class FileServiceBasedWorkspaceConfiguration extends Disposable {
1671
- constructor(fileService, uriIdentityService, logService) {
1672
- super();
1673
- this.fileService = fileService;
1674
- this.logService = logService;
1675
- this._workspaceIdentifier = null;
1676
- this._onDidChange = this._register(( (new Emitter())));
1677
- this.onDidChange = this._onDidChange.event;
1678
- this.workspaceConfigurationModelParser = ( (new WorkspaceConfigurationModelParser('')));
1679
- this.workspaceSettings = ( (new ConfigurationModel()));
1680
- this._register(Event.any(Event.filter(this.fileService.onDidFilesChange, e => !!this._workspaceIdentifier && e.contains(this._workspaceIdentifier.configPath)), Event.filter(this.fileService.onDidRunOperation, e => !!this._workspaceIdentifier && (e.isOperation(0 ) || e.isOperation(3 ) || e.isOperation(1 ) || e.isOperation(4 )) && uriIdentityService.extUri.isEqual(e.resource, this._workspaceIdentifier.configPath)))(() => this.reloadConfigurationScheduler.schedule()));
1681
- this.reloadConfigurationScheduler = this._register(( (new RunOnceScheduler(() => this._onDidChange.fire(), 50))));
1682
- this.workspaceConfigWatcher = this._register(this.watchWorkspaceConfigurationFile());
1683
- }
1684
- get workspaceIdentifier() {
1685
- return this._workspaceIdentifier;
1686
- }
1687
- async resolveContent(workspaceIdentifier) {
1688
- const content = await this.fileService.readFile(workspaceIdentifier.configPath);
1689
- return (
1690
- (content.value.toString())
1691
- );
1692
- }
1693
- async load(workspaceIdentifier, configurationParseOptions) {
1694
- if (!this._workspaceIdentifier || this._workspaceIdentifier.id !== workspaceIdentifier.id) {
1695
- this._workspaceIdentifier = workspaceIdentifier;
1696
- this.workspaceConfigurationModelParser = ( (new WorkspaceConfigurationModelParser(this._workspaceIdentifier.id)));
1697
- dispose(this.workspaceConfigWatcher);
1698
- this.workspaceConfigWatcher = this._register(this.watchWorkspaceConfigurationFile());
1699
- }
1700
- let contents = '';
1701
- try {
1702
- contents = await this.resolveContent(this._workspaceIdentifier);
1703
- }
1704
- catch (error) {
1705
- const exists = await this.fileService.exists(this._workspaceIdentifier.configPath);
1706
- if (exists) {
1707
- this.logService.error(error);
1708
- }
1709
- }
1710
- this.workspaceConfigurationModelParser.parse(contents, configurationParseOptions);
1711
- this.consolidate();
1712
- }
1713
- getConfigurationModel() {
1714
- return this.workspaceConfigurationModelParser.configurationModel;
1715
- }
1716
- getFolders() {
1717
- return this.workspaceConfigurationModelParser.folders;
1718
- }
1719
- isTransient() {
1720
- return this.workspaceConfigurationModelParser.transient;
1721
- }
1722
- getWorkspaceSettings() {
1723
- return this.workspaceSettings;
1724
- }
1725
- reparseWorkspaceSettings(configurationParseOptions) {
1726
- this.workspaceConfigurationModelParser.reparseWorkspaceSettings(configurationParseOptions);
1727
- this.consolidate();
1728
- return this.getWorkspaceSettings();
1729
- }
1730
- getRestrictedSettings() {
1731
- return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings();
1732
- }
1733
- consolidate() {
1734
- this.workspaceSettings = this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel, this.workspaceConfigurationModelParser.tasksModel);
1735
- }
1736
- watchWorkspaceConfigurationFile() {
1737
- return this._workspaceIdentifier ? this.fileService.watch(this._workspaceIdentifier.configPath) : Disposable.None;
1738
- }
1739
- }
1740
- class CachedWorkspaceConfiguration {
1741
- constructor(configurationCache) {
1742
- this.configurationCache = configurationCache;
1743
- this.onDidChange = Event.None;
1744
- this.workspaceConfigurationModelParser = ( (new WorkspaceConfigurationModelParser('')));
1745
- this.workspaceSettings = ( (new ConfigurationModel()));
1746
- }
1747
- async load(workspaceIdentifier, configurationParseOptions) {
1748
- try {
1749
- const key = this.getKey(workspaceIdentifier);
1750
- const contents = await this.configurationCache.read(key);
1751
- const parsed = JSON.parse(contents);
1752
- if (parsed.content) {
1753
- this.workspaceConfigurationModelParser = ( (new WorkspaceConfigurationModelParser(key.key)));
1754
- this.workspaceConfigurationModelParser.parse(parsed.content, configurationParseOptions);
1755
- this.consolidate();
1756
- }
1757
- }
1758
- catch (e) {
1759
- }
1760
- }
1761
- get workspaceIdentifier() {
1762
- return null;
1763
- }
1764
- getConfigurationModel() {
1765
- return this.workspaceConfigurationModelParser.configurationModel;
1766
- }
1767
- getFolders() {
1768
- return this.workspaceConfigurationModelParser.folders;
1769
- }
1770
- isTransient() {
1771
- return this.workspaceConfigurationModelParser.transient;
1772
- }
1773
- getWorkspaceSettings() {
1774
- return this.workspaceSettings;
1775
- }
1776
- reparseWorkspaceSettings(configurationParseOptions) {
1777
- this.workspaceConfigurationModelParser.reparseWorkspaceSettings(configurationParseOptions);
1778
- this.consolidate();
1779
- return this.getWorkspaceSettings();
1780
- }
1781
- getRestrictedSettings() {
1782
- return this.workspaceConfigurationModelParser.getRestrictedWorkspaceSettings();
1783
- }
1784
- consolidate() {
1785
- this.workspaceSettings = this.workspaceConfigurationModelParser.settingsModel.merge(this.workspaceConfigurationModelParser.launchModel, this.workspaceConfigurationModelParser.tasksModel);
1786
- }
1787
- async updateWorkspace(workspaceIdentifier, content) {
1788
- try {
1789
- const key = this.getKey(workspaceIdentifier);
1790
- if (content) {
1791
- await this.configurationCache.write(key, JSON.stringify({ content }));
1792
- }
1793
- else {
1794
- await this.configurationCache.remove(key);
1795
- }
1796
- }
1797
- catch (error) {
1798
- }
1799
- }
1800
- getKey(workspaceIdentifier) {
1801
- return {
1802
- type: 'workspaces',
1803
- key: workspaceIdentifier.id
1804
- };
1805
- }
1806
- }
1807
- class CachedFolderConfiguration {
1808
- constructor(folder, configFolderRelativePath, configurationParseOptions, configurationCache) {
1809
- this.configurationCache = configurationCache;
1810
- this.onDidChange = Event.None;
1811
- this.key = { type: 'folder', key: ( (hash(( (joinPath(folder, configFolderRelativePath).toString()))).toString(16))) };
1812
- this._folderSettingsModelParser = ( (new ConfigurationModelParser('CachedFolderConfiguration')));
1813
- this._folderSettingsParseOptions = configurationParseOptions;
1814
- this._standAloneConfigurations = [];
1815
- this.configurationModel = ( (new ConfigurationModel()));
1816
- }
1817
- async loadConfiguration() {
1818
- try {
1819
- const contents = await this.configurationCache.read(this.key);
1820
- const { content: configurationContents } = JSON.parse(( (contents.toString())));
1821
- if (configurationContents) {
1822
- for (const key of ( (Object.keys(configurationContents)))) {
1823
- if (key === FOLDER_SETTINGS_NAME) {
1824
- this._folderSettingsModelParser.parse(configurationContents[key], this._folderSettingsParseOptions);
1825
- }
1826
- else {
1827
- const standAloneConfigurationModelParser = ( (new StandaloneConfigurationModelParser(key, key)));
1828
- standAloneConfigurationModelParser.parse(configurationContents[key]);
1829
- this._standAloneConfigurations.push(standAloneConfigurationModelParser.configurationModel);
1830
- }
1831
- }
1832
- }
1833
- this.consolidate();
1834
- }
1835
- catch (e) {
1836
- }
1837
- return this.configurationModel;
1838
- }
1839
- async updateConfiguration(settingsContent, standAloneConfigurationContents) {
1840
- const content = {};
1841
- if (settingsContent) {
1842
- content[FOLDER_SETTINGS_NAME] = settingsContent;
1843
- }
1844
- standAloneConfigurationContents.forEach(([key, contents]) => {
1845
- if (contents) {
1846
- content[key] = contents;
1847
- }
1848
- });
1849
- if (( (Object.keys(content))).length) {
1850
- await this.configurationCache.write(this.key, JSON.stringify({ content }));
1851
- }
1852
- else {
1853
- await this.configurationCache.remove(this.key);
1854
- }
1855
- }
1856
- getRestrictedSettings() {
1857
- return this._folderSettingsModelParser.restrictedConfigurations;
1858
- }
1859
- reparse(configurationParseOptions) {
1860
- this._folderSettingsParseOptions = configurationParseOptions;
1861
- this._folderSettingsModelParser.reparse(this._folderSettingsParseOptions);
1862
- this.consolidate();
1863
- return this.configurationModel;
1864
- }
1865
- consolidate() {
1866
- this.configurationModel = this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations);
1867
- }
1868
- getUnsupportedKeys() {
1869
- return [];
1870
- }
1871
- }
1872
- class FolderConfiguration extends Disposable {
1873
- constructor(useCache, workspaceFolder, configFolderRelativePath, workbenchState, workspaceTrusted, fileService, uriIdentityService, logService, configurationCache) {
1874
- super();
1875
- this.workspaceFolder = workspaceFolder;
1876
- this.workbenchState = workbenchState;
1877
- this.workspaceTrusted = workspaceTrusted;
1878
- this.configurationCache = configurationCache;
1879
- this._onDidChange = this._register(( (new Emitter())));
1880
- this.onDidChange = this._onDidChange.event;
1881
- this.scopes = 3 === this.workbenchState ? FOLDER_SCOPES : WORKSPACE_SCOPES;
1882
- this.configurationFolder = uriIdentityService.extUri.joinPath(workspaceFolder.uri, configFolderRelativePath);
1883
- this.cachedFolderConfiguration = ( (new CachedFolderConfiguration(
1884
- workspaceFolder.uri,
1885
- configFolderRelativePath,
1886
- { scopes: this.scopes, skipRestricted: this.isUntrusted() },
1887
- configurationCache
1888
- )));
1889
- if (useCache && this.configurationCache.needsCaching(workspaceFolder.uri)) {
1890
- this.folderConfiguration = this.cachedFolderConfiguration;
1891
- whenProviderRegistered(workspaceFolder.uri, fileService)
1892
- .then(() => {
1893
- this.folderConfiguration = this._register(this.createFileServiceBasedConfiguration(fileService, uriIdentityService, logService));
1894
- this._register(this.folderConfiguration.onDidChange(e => this.onDidFolderConfigurationChange()));
1895
- this.onDidFolderConfigurationChange();
1896
- });
1897
- }
1898
- else {
1899
- this.folderConfiguration = this._register(this.createFileServiceBasedConfiguration(fileService, uriIdentityService, logService));
1900
- this._register(this.folderConfiguration.onDidChange(e => this.onDidFolderConfigurationChange()));
1901
- }
1902
- }
1903
- loadConfiguration() {
1904
- return this.folderConfiguration.loadConfiguration();
1905
- }
1906
- updateWorkspaceTrust(trusted) {
1907
- this.workspaceTrusted = trusted;
1908
- return this.reparse();
1909
- }
1910
- reparse() {
1911
- const configurationModel = this.folderConfiguration.reparse({ scopes: this.scopes, skipRestricted: this.isUntrusted() });
1912
- this.updateCache();
1913
- return configurationModel;
1914
- }
1915
- getRestrictedSettings() {
1916
- return this.folderConfiguration.getRestrictedSettings();
1917
- }
1918
- isUntrusted() {
1919
- return !this.workspaceTrusted;
1920
- }
1921
- onDidFolderConfigurationChange() {
1922
- this.updateCache();
1923
- this._onDidChange.fire();
1924
- }
1925
- createFileServiceBasedConfiguration(fileService, uriIdentityService, logService) {
1926
- const settingsResource = uriIdentityService.extUri.joinPath(this.configurationFolder, `${FOLDER_SETTINGS_NAME}.json`);
1927
- const standAloneConfigurationResources = ( ([TASKS_CONFIGURATION_KEY, LAUNCH_CONFIGURATION_KEY].map(
1928
- name => ([name, uriIdentityService.extUri.joinPath(this.configurationFolder, `${name}.json`)])
1929
- )));
1930
- return (
1931
- (new FileServiceBasedConfiguration(
1932
- (this.configurationFolder.toString()),
1933
- settingsResource,
1934
- standAloneConfigurationResources,
1935
- { scopes: this.scopes, skipRestricted: this.isUntrusted() },
1936
- fileService,
1937
- uriIdentityService,
1938
- logService
1939
- ))
1940
- );
1941
- }
1942
- async updateCache() {
1943
- if (this.configurationCache.needsCaching(this.configurationFolder) && this.folderConfiguration instanceof FileServiceBasedConfiguration) {
1944
- const [settingsContent, standAloneConfigurationContents] = await this.folderConfiguration.resolveContents();
1945
- this.cachedFolderConfiguration.updateConfiguration(settingsContent, standAloneConfigurationContents);
1946
- }
1947
- }
1948
- }
1949
- function getLocalUserConfigurationScopes(userDataProfile, hasRemote) {
1950
- return userDataProfile.isDefault
1951
- ? hasRemote ? LOCAL_MACHINE_SCOPES : undefined
1952
- : hasRemote ? LOCAL_MACHINE_PROFILE_SCOPES : PROFILE_SCOPES;
1953
- }
1954
- class Workspace extends Workspace$1 {
1955
- constructor() {
1956
- super(...arguments);
1957
- this.initialized = false;
1958
- }
1959
- }
1960
- class WorkspaceService extends Disposable {
1961
- get restrictedSettings() { return this._restrictedSettings; }
1962
- constructor({ remoteAuthority, configurationCache }, environmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, policyService) {
1963
- super();
1964
- this.userDataProfileService = userDataProfileService;
1965
- this.userDataProfilesService = userDataProfilesService;
1966
- this.fileService = fileService;
1967
- this.remoteAgentService = remoteAgentService;
1968
- this.uriIdentityService = uriIdentityService;
1969
- this.logService = logService;
1970
- this.initialized = false;
1971
- this.applicationConfiguration = null;
1972
- this.remoteUserConfiguration = null;
1973
- this._onDidChangeConfiguration = this._register(( (new Emitter())));
1974
- this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
1975
- this._onWillChangeWorkspaceFolders = this._register(( (new Emitter())));
1976
- this.onWillChangeWorkspaceFolders = this._onWillChangeWorkspaceFolders.event;
1977
- this._onDidChangeWorkspaceFolders = this._register(( (new Emitter())));
1978
- this.onDidChangeWorkspaceFolders = this._onDidChangeWorkspaceFolders.event;
1979
- this._onDidChangeWorkspaceName = this._register(( (new Emitter())));
1980
- this.onDidChangeWorkspaceName = this._onDidChangeWorkspaceName.event;
1981
- this._onDidChangeWorkbenchState = this._register(( (new Emitter())));
1982
- this.onDidChangeWorkbenchState = this._onDidChangeWorkbenchState.event;
1983
- this.isWorkspaceTrusted = true;
1984
- this._restrictedSettings = { default: [] };
1985
- this._onDidChangeRestrictedSettings = this._register(( (new Emitter())));
1986
- this.onDidChangeRestrictedSettings = this._onDidChangeRestrictedSettings.event;
1987
- this.configurationRegistry = ( (Registry.as(Extensions.Configuration)));
1988
- this.initRemoteUserConfigurationBarrier = ( (new Barrier()));
1989
- this.completeWorkspaceBarrier = ( (new Barrier()));
1990
- this.defaultConfiguration = this._register(( (new DefaultConfiguration(configurationCache, environmentService))));
1991
- this.policyConfiguration = policyService instanceof NullPolicyService ? ( (new NullPolicyConfiguration())) : this._register(( (new PolicyConfiguration(this.defaultConfiguration, policyService, logService))));
1992
- this.configurationCache = configurationCache;
1993
- this._configuration = ( (new Configuration(
1994
- this.defaultConfiguration.configurationModel,
1995
- this.policyConfiguration.configurationModel,
1996
- (new ConfigurationModel()),
1997
- (new ConfigurationModel()),
1998
- (new ConfigurationModel()),
1999
- (new ConfigurationModel()),
2000
- (new ResourceMap()),
2001
- (new ConfigurationModel()),
2002
- (new ResourceMap()),
2003
- this.workspace
2004
- )));
2005
- this.applicationConfigurationDisposables = this._register(( (new DisposableStore())));
2006
- this.createApplicationConfiguration();
2007
- this.localUserConfiguration = this._register(( (new UserConfiguration(
2008
- userDataProfileService.currentProfile.settingsResource,
2009
- userDataProfileService.currentProfile.tasksResource,
2010
- getLocalUserConfigurationScopes(userDataProfileService.currentProfile, !!remoteAuthority),
2011
- fileService,
2012
- uriIdentityService,
2013
- logService
2014
- ))));
2015
- this.cachedFolderConfigs = ( (new ResourceMap()));
2016
- this._register(this.localUserConfiguration.onDidChangeConfiguration(userConfiguration => this.onLocalUserConfigurationChanged(userConfiguration)));
2017
- if (remoteAuthority) {
2018
- const remoteUserConfiguration = this.remoteUserConfiguration = this._register(( (new RemoteUserConfiguration(
2019
- remoteAuthority,
2020
- configurationCache,
2021
- fileService,
2022
- uriIdentityService,
2023
- remoteAgentService
2024
- ))));
2025
- this._register(remoteUserConfiguration.onDidInitialize(remoteUserConfigurationModel => {
2026
- this._register(remoteUserConfiguration.onDidChangeConfiguration(remoteUserConfigurationModel => this.onRemoteUserConfigurationChanged(remoteUserConfigurationModel)));
2027
- this.onRemoteUserConfigurationChanged(remoteUserConfigurationModel);
2028
- this.initRemoteUserConfigurationBarrier.open();
2029
- }));
2030
- }
2031
- else {
2032
- this.initRemoteUserConfigurationBarrier.open();
2033
- }
2034
- this.workspaceConfiguration = this._register(( (new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService))));
2035
- this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => {
2036
- this.onWorkspaceConfigurationChanged(fromCache).then(() => {
2037
- this.workspace.initialized = this.workspaceConfiguration.initialized;
2038
- this.checkAndMarkWorkspaceComplete(fromCache);
2039
- });
2040
- }));
2041
- this._register(this.defaultConfiguration.onDidChangeConfiguration(({ properties, defaults }) => this.onDefaultConfigurationChanged(defaults, properties)));
2042
- this._register(this.policyConfiguration.onDidChangeConfiguration(configurationModel => this.onPolicyConfigurationChanged(configurationModel)));
2043
- this._register(userDataProfileService.onDidChangeCurrentProfile(e => this.onUserDataProfileChanged(e)));
2044
- this.workspaceEditingQueue = ( (new Queue()));
2045
- }
2046
- createApplicationConfiguration() {
2047
- this.applicationConfigurationDisposables.clear();
2048
- if (this.userDataProfileService.currentProfile.isDefault) {
2049
- this.applicationConfiguration = null;
2050
- }
2051
- else {
2052
- this.applicationConfiguration = this.applicationConfigurationDisposables.add(this._register(( (new UserConfiguration(
2053
- this.userDataProfilesService.defaultProfile.settingsResource,
2054
- undefined,
2055
- [1 ],
2056
- this.fileService,
2057
- this.uriIdentityService,
2058
- this.logService
2059
- )))));
2060
- this.applicationConfigurationDisposables.add(this.applicationConfiguration.onDidChangeConfiguration(configurationModel => this.onApplicationConfigurationChanged(configurationModel)));
2061
- }
2062
- }
2063
- async getCompleteWorkspace() {
2064
- await this.completeWorkspaceBarrier.wait();
2065
- return this.getWorkspace();
2066
- }
2067
- getWorkspace() {
2068
- return this.workspace;
2069
- }
2070
- getWorkbenchState() {
2071
- if (this.workspace.configuration) {
2072
- return 3 ;
2073
- }
2074
- if (this.workspace.folders.length === 1) {
2075
- return 2 ;
2076
- }
2077
- return 1 ;
2078
- }
2079
- getWorkspaceFolder(resource) {
2080
- return this.workspace.getFolder(resource);
2081
- }
2082
- addFolders(foldersToAdd, index) {
2083
- return this.updateFolders(foldersToAdd, [], index);
2084
- }
2085
- removeFolders(foldersToRemove) {
2086
- return this.updateFolders([], foldersToRemove);
2087
- }
2088
- async updateFolders(foldersToAdd, foldersToRemove, index) {
2089
- return this.workspaceEditingQueue.queue(() => this.doUpdateFolders(foldersToAdd, foldersToRemove, index));
2090
- }
2091
- isInsideWorkspace(resource) {
2092
- return !!this.getWorkspaceFolder(resource);
2093
- }
2094
- isCurrentWorkspace(workspaceIdOrFolder) {
2095
- switch (this.getWorkbenchState()) {
2096
- case 2 : {
2097
- let folderUri = undefined;
2098
- if (URI.isUri(workspaceIdOrFolder)) {
2099
- folderUri = workspaceIdOrFolder;
2100
- }
2101
- else if (isSingleFolderWorkspaceIdentifier(workspaceIdOrFolder)) {
2102
- folderUri = workspaceIdOrFolder.uri;
2103
- }
2104
- return URI.isUri(folderUri) && this.uriIdentityService.extUri.isEqual(folderUri, this.workspace.folders[0].uri);
2105
- }
2106
- case 3 :
2107
- return isWorkspaceIdentifier(workspaceIdOrFolder) && this.workspace.id === workspaceIdOrFolder.id;
2108
- }
2109
- return false;
2110
- }
2111
- async doUpdateFolders(foldersToAdd, foldersToRemove, index) {
2112
- if (this.getWorkbenchState() !== 3 ) {
2113
- return Promise.resolve(undefined);
2114
- }
2115
- if (foldersToAdd.length + foldersToRemove.length === 0) {
2116
- return Promise.resolve(undefined);
2117
- }
2118
- let foldersHaveChanged = false;
2119
- let currentWorkspaceFolders = this.getWorkspace().folders;
2120
- let newStoredFolders = ( (currentWorkspaceFolders.map(f => f.raw))).filter((folder, index) => {
2121
- if (!isStoredWorkspaceFolder(folder)) {
2122
- return true;
2123
- }
2124
- return !this.contains(foldersToRemove, currentWorkspaceFolders[index].uri);
2125
- });
2126
- foldersHaveChanged = currentWorkspaceFolders.length !== newStoredFolders.length;
2127
- if (foldersToAdd.length) {
2128
- const workspaceConfigPath = this.getWorkspace().configuration;
2129
- const workspaceConfigFolder = this.uriIdentityService.extUri.dirname(workspaceConfigPath);
2130
- currentWorkspaceFolders = toWorkspaceFolders(newStoredFolders, workspaceConfigPath, this.uriIdentityService.extUri);
2131
- const currentWorkspaceFolderUris = ( (currentWorkspaceFolders.map(folder => folder.uri)));
2132
- const storedFoldersToAdd = [];
2133
- for (const folderToAdd of foldersToAdd) {
2134
- const folderURI = folderToAdd.uri;
2135
- if (this.contains(currentWorkspaceFolderUris, folderURI)) {
2136
- continue;
2137
- }
2138
- try {
2139
- const result = await this.fileService.stat(folderURI);
2140
- if (!result.isDirectory) {
2141
- continue;
2142
- }
2143
- }
2144
- catch (e) { }
2145
- storedFoldersToAdd.push(getStoredWorkspaceFolder(folderURI, false, folderToAdd.name, workspaceConfigFolder, this.uriIdentityService.extUri));
2146
- }
2147
- if (storedFoldersToAdd.length > 0) {
2148
- foldersHaveChanged = true;
2149
- if (typeof index === 'number' && index >= 0 && index < newStoredFolders.length) {
2150
- newStoredFolders = newStoredFolders.slice(0);
2151
- newStoredFolders.splice(index, 0, ...storedFoldersToAdd);
2152
- }
2153
- else {
2154
- newStoredFolders = [...newStoredFolders, ...storedFoldersToAdd];
2155
- }
2156
- }
2157
- }
2158
- if (foldersHaveChanged) {
2159
- return this.setFolders(newStoredFolders);
2160
- }
2161
- return Promise.resolve(undefined);
2162
- }
2163
- async setFolders(folders) {
2164
- if (!this.instantiationService) {
2165
- throw new Error('Cannot update workspace folders because workspace service is not yet ready to accept writes.');
2166
- }
2167
- await this.instantiationService.invokeFunction(accessor => this.workspaceConfiguration.setFolders(folders, accessor.get(IJSONEditingService)));
2168
- return this.onWorkspaceConfigurationChanged(false);
2169
- }
2170
- contains(resources, toCheck) {
2171
- return resources.some(resource => this.uriIdentityService.extUri.isEqual(resource, toCheck));
2172
- }
2173
- getConfigurationData() {
2174
- return this._configuration.toData();
2175
- }
2176
- getValue(arg1, arg2) {
2177
- const section = typeof arg1 === 'string' ? arg1 : undefined;
2178
- const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : undefined;
2179
- return this._configuration.getValue(section, overrides);
2180
- }
2181
- async updateValue(key, value, arg3, arg4, options) {
2182
- const overrides = isConfigurationUpdateOverrides(arg3) ? arg3
2183
- : isConfigurationOverrides(arg3) ? { resource: arg3.resource, overrideIdentifiers: arg3.overrideIdentifier ? [arg3.overrideIdentifier] : undefined } : undefined;
2184
- const target = overrides ? arg4 : arg3;
2185
- const targets = target ? [target] : [];
2186
- if (overrides?.overrideIdentifiers) {
2187
- overrides.overrideIdentifiers = distinct(overrides.overrideIdentifiers);
2188
- overrides.overrideIdentifiers = overrides.overrideIdentifiers.length ? overrides.overrideIdentifiers : undefined;
2189
- }
2190
- if (!targets.length) {
2191
- if (overrides?.overrideIdentifiers && overrides.overrideIdentifiers.length > 1) {
2192
- throw new Error('Configuration Target is required while updating the value for multiple override identifiers');
2193
- }
2194
- const inspect = this.inspect(key, { resource: overrides?.resource, overrideIdentifier: overrides?.overrideIdentifiers ? overrides.overrideIdentifiers[0] : undefined });
2195
- targets.push(...this.deriveConfigurationTargets(key, value, inspect));
2196
- if (equals(value, inspect.defaultValue) && targets.length === 1 && ((targets[0] === 2 || targets[0] === 3) )) {
2197
- value = undefined;
2198
- }
2199
- }
2200
- await Promises.settled(( (targets.map(
2201
- target => this.writeConfigurationValue(key, value, target, overrides, options)
2202
- ))));
2203
- }
2204
- async reloadConfiguration(target) {
2205
- if (target === undefined) {
2206
- this.reloadDefaultConfiguration();
2207
- const application = await this.reloadApplicationConfiguration(true);
2208
- const { local, remote } = await this.reloadUserConfiguration();
2209
- await this.reloadWorkspaceConfiguration();
2210
- await this.loadConfiguration(application, local, remote);
2211
- return;
2212
- }
2213
- if (isWorkspaceFolder$1(target)) {
2214
- await this.reloadWorkspaceFolderConfiguration(target);
2215
- return;
2216
- }
2217
- switch (target) {
2218
- case 7 :
2219
- this.reloadDefaultConfiguration();
2220
- return;
2221
- case 2 : {
2222
- const { local, remote } = await this.reloadUserConfiguration();
2223
- await this.loadConfiguration(this._configuration.applicationConfiguration, local, remote);
2224
- return;
2225
- }
2226
- case 3 :
2227
- await this.reloadLocalUserConfiguration();
2228
- return;
2229
- case 4 :
2230
- await this.reloadRemoteUserConfiguration();
2231
- return;
2232
- case 5 :
2233
- case 6 :
2234
- await this.reloadWorkspaceConfiguration();
2235
- return;
2236
- }
2237
- }
2238
- hasCachedConfigurationDefaultsOverrides() {
2239
- return this.defaultConfiguration.hasCachedConfigurationDefaultsOverrides();
2240
- }
2241
- inspect(key, overrides) {
2242
- return this._configuration.inspect(key, overrides);
2243
- }
2244
- keys() {
2245
- return (
2246
- (this._configuration.keys())
2247
- );
2248
- }
2249
- async whenRemoteConfigurationLoaded() {
2250
- await this.initRemoteUserConfigurationBarrier.wait();
2251
- }
2252
- async initialize(arg) {
2253
- mark('code/willInitWorkspaceService');
2254
- const workspace = await this.createWorkspace(arg);
2255
- await this.updateWorkspaceAndInitializeConfiguration(workspace);
2256
- this.checkAndMarkWorkspaceComplete(false);
2257
- mark('code/didInitWorkspaceService');
2258
- }
2259
- updateWorkspaceTrust(trusted) {
2260
- if (this.isWorkspaceTrusted !== trusted) {
2261
- this.isWorkspaceTrusted = trusted;
2262
- const data = this._configuration.toData();
2263
- const folderConfigurationModels = [];
2264
- for (const folder of this.workspace.folders) {
2265
- const folderConfiguration = this.cachedFolderConfigs.get(folder.uri);
2266
- let configurationModel;
2267
- if (folderConfiguration) {
2268
- configurationModel = folderConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted);
2269
- this._configuration.updateFolderConfiguration(folder.uri, configurationModel);
2270
- }
2271
- folderConfigurationModels.push(configurationModel);
2272
- }
2273
- if (this.getWorkbenchState() === 2 ) {
2274
- if (folderConfigurationModels[0]) {
2275
- this._configuration.updateWorkspaceConfiguration(folderConfigurationModels[0]);
2276
- }
2277
- }
2278
- else {
2279
- this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted));
2280
- }
2281
- this.updateRestrictedSettings();
2282
- let keys = [];
2283
- if (this.restrictedSettings.userLocal) {
2284
- keys.push(...this.restrictedSettings.userLocal);
2285
- }
2286
- if (this.restrictedSettings.userRemote) {
2287
- keys.push(...this.restrictedSettings.userRemote);
2288
- }
2289
- if (this.restrictedSettings.workspace) {
2290
- keys.push(...this.restrictedSettings.workspace);
2291
- }
2292
- this.restrictedSettings.workspaceFolder?.forEach((value) => keys.push(...value));
2293
- keys = distinct(keys);
2294
- if (keys.length) {
2295
- this.triggerConfigurationChange({ keys, overrides: [] }, { data, workspace: this.workspace }, 5 );
2296
- }
2297
- }
2298
- }
2299
- acquireInstantiationService(instantiationService) {
2300
- this.instantiationService = instantiationService;
2301
- }
2302
- async createWorkspace(arg) {
2303
- if (isWorkspaceIdentifier(arg)) {
2304
- return this.createMultiFolderWorkspace(arg);
2305
- }
2306
- if (isSingleFolderWorkspaceIdentifier(arg)) {
2307
- return this.createSingleFolderWorkspace(arg);
2308
- }
2309
- return this.createEmptyWorkspace(arg);
2310
- }
2311
- async createMultiFolderWorkspace(workspaceIdentifier) {
2312
- await this.workspaceConfiguration.initialize({ id: workspaceIdentifier.id, configPath: workspaceIdentifier.configPath }, this.isWorkspaceTrusted);
2313
- const workspaceConfigPath = workspaceIdentifier.configPath;
2314
- const workspaceFolders = toWorkspaceFolders(this.workspaceConfiguration.getFolders(), workspaceConfigPath, this.uriIdentityService.extUri);
2315
- const workspaceId = workspaceIdentifier.id;
2316
- const workspace = ( (new Workspace(
2317
- workspaceId,
2318
- workspaceFolders,
2319
- this.workspaceConfiguration.isTransient(),
2320
- workspaceConfigPath,
2321
- uri => this.uriIdentityService.extUri.ignorePathCasing(uri)
2322
- )));
2323
- workspace.initialized = this.workspaceConfiguration.initialized;
2324
- return workspace;
2325
- }
2326
- createSingleFolderWorkspace(singleFolderWorkspaceIdentifier) {
2327
- const workspace = ( (new Workspace(
2328
- singleFolderWorkspaceIdentifier.id,
2329
- [toWorkspaceFolder(singleFolderWorkspaceIdentifier.uri)],
2330
- false,
2331
- null,
2332
- uri => this.uriIdentityService.extUri.ignorePathCasing(uri)
2333
- )));
2334
- workspace.initialized = true;
2335
- return workspace;
2336
- }
2337
- createEmptyWorkspace(emptyWorkspaceIdentifier) {
2338
- const workspace = ( (new Workspace(
2339
- emptyWorkspaceIdentifier.id,
2340
- [],
2341
- false,
2342
- null,
2343
- uri => this.uriIdentityService.extUri.ignorePathCasing(uri)
2344
- )));
2345
- workspace.initialized = true;
2346
- return Promise.resolve(workspace);
2347
- }
2348
- checkAndMarkWorkspaceComplete(fromCache) {
2349
- if (!this.completeWorkspaceBarrier.isOpen() && this.workspace.initialized) {
2350
- this.completeWorkspaceBarrier.open();
2351
- this.validateWorkspaceFoldersAndReload(fromCache);
2352
- }
2353
- }
2354
- async updateWorkspaceAndInitializeConfiguration(workspace) {
2355
- const hasWorkspaceBefore = !!this.workspace;
2356
- let previousState;
2357
- let previousWorkspacePath;
2358
- let previousFolders = [];
2359
- if (hasWorkspaceBefore) {
2360
- previousState = this.getWorkbenchState();
2361
- previousWorkspacePath = this.workspace.configuration ? this.workspace.configuration.fsPath : undefined;
2362
- previousFolders = this.workspace.folders;
2363
- this.workspace.update(workspace);
2364
- }
2365
- else {
2366
- this.workspace = workspace;
2367
- }
2368
- await this.initializeConfiguration();
2369
- if (hasWorkspaceBefore) {
2370
- const newState = this.getWorkbenchState();
2371
- if (previousState && newState !== previousState) {
2372
- this._onDidChangeWorkbenchState.fire(newState);
2373
- }
2374
- const newWorkspacePath = this.workspace.configuration ? this.workspace.configuration.fsPath : undefined;
2375
- if (previousWorkspacePath && newWorkspacePath !== previousWorkspacePath || newState !== previousState) {
2376
- this._onDidChangeWorkspaceName.fire();
2377
- }
2378
- const folderChanges = this.compareFolders(previousFolders, this.workspace.folders);
2379
- if (folderChanges && (folderChanges.added.length || folderChanges.removed.length || folderChanges.changed.length)) {
2380
- await this.handleWillChangeWorkspaceFolders(folderChanges, false);
2381
- this._onDidChangeWorkspaceFolders.fire(folderChanges);
2382
- }
2383
- }
2384
- if (!this.localUserConfiguration.hasTasksLoaded) {
2385
- this._register(runWhenIdle(() => this.reloadLocalUserConfiguration()));
2386
- }
2387
- }
2388
- compareFolders(currentFolders, newFolders) {
2389
- const result = { added: [], removed: [], changed: [] };
2390
- result.added = newFolders.filter(newFolder => !currentFolders.some(currentFolder => ( (newFolder.uri.toString())) === ( (currentFolder.uri.toString()))));
2391
- for (let currentIndex = 0; currentIndex < currentFolders.length; currentIndex++) {
2392
- const currentFolder = currentFolders[currentIndex];
2393
- let newIndex = 0;
2394
- for (newIndex = 0; newIndex < newFolders.length && ( (currentFolder.uri.toString())) !== ( (newFolders[newIndex].uri.toString())); newIndex++) { }
2395
- if (newIndex < newFolders.length) {
2396
- if (currentIndex !== newIndex || currentFolder.name !== newFolders[newIndex].name) {
2397
- result.changed.push(currentFolder);
2398
- }
2399
- }
2400
- else {
2401
- result.removed.push(currentFolder);
2402
- }
2403
- }
2404
- return result;
2405
- }
2406
- async initializeConfiguration() {
2407
- await this.defaultConfiguration.initialize();
2408
- const [, application, user] = await Promise.all([
2409
- this.policyConfiguration.initialize(),
2410
- this.initializeApplicationConfiguration(),
2411
- (async () => {
2412
- mark('code/willInitUserConfiguration');
2413
- const result = await this.initializeUserConfiguration();
2414
- mark('code/didInitUserConfiguration');
2415
- return result;
2416
- })()
2417
- ]);
2418
- mark('code/willInitWorkspaceConfiguration');
2419
- await this.loadConfiguration(application, user.local, user.remote);
2420
- mark('code/didInitWorkspaceConfiguration');
2421
- }
2422
- async initializeApplicationConfiguration() {
2423
- return this.applicationConfiguration ? this.applicationConfiguration.initialize() : Promise.resolve(( (new ConfigurationModel())));
2424
- }
2425
- async initializeUserConfiguration() {
2426
- const [local, remote] = await Promise.all([this.localUserConfiguration.initialize(), this.remoteUserConfiguration ? this.remoteUserConfiguration.initialize() : Promise.resolve(( (new ConfigurationModel())))]);
2427
- return { local, remote };
2428
- }
2429
- reloadDefaultConfiguration() {
2430
- this.onDefaultConfigurationChanged(this.defaultConfiguration.reload());
2431
- }
2432
- async reloadApplicationConfiguration(donotTrigger) {
2433
- if (!this.applicationConfiguration) {
2434
- return (
2435
- (new ConfigurationModel())
2436
- );
2437
- }
2438
- const model = await this.applicationConfiguration.reload();
2439
- if (!donotTrigger) {
2440
- this.onApplicationConfigurationChanged(model);
2441
- }
2442
- return model;
2443
- }
2444
- async reloadUserConfiguration() {
2445
- const [local, remote] = await Promise.all([this.reloadLocalUserConfiguration(true), this.reloadRemoteUserConfiguration(true)]);
2446
- return { local, remote };
2447
- }
2448
- async reloadLocalUserConfiguration(donotTrigger) {
2449
- const model = await this.localUserConfiguration.reload();
2450
- if (!donotTrigger) {
2451
- this.onLocalUserConfigurationChanged(model);
2452
- }
2453
- return model;
2454
- }
2455
- async reloadRemoteUserConfiguration(donotTrigger) {
2456
- if (this.remoteUserConfiguration) {
2457
- const model = await this.remoteUserConfiguration.reload();
2458
- if (!donotTrigger) {
2459
- this.onRemoteUserConfigurationChanged(model);
2460
- }
2461
- return model;
2462
- }
2463
- return (
2464
- (new ConfigurationModel())
2465
- );
2466
- }
2467
- async reloadWorkspaceConfiguration() {
2468
- const workbenchState = this.getWorkbenchState();
2469
- if (workbenchState === 2 ) {
2470
- return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);
2471
- }
2472
- if (workbenchState === 3 ) {
2473
- return this.workspaceConfiguration.reload().then(() => this.onWorkspaceConfigurationChanged(false));
2474
- }
2475
- }
2476
- reloadWorkspaceFolderConfiguration(folder) {
2477
- return this.onWorkspaceFolderConfigurationChanged(folder);
2478
- }
2479
- async loadConfiguration(applicationConfigurationModel, userConfigurationModel, remoteUserConfigurationModel) {
2480
- this.cachedFolderConfigs = ( (new ResourceMap()));
2481
- const folders = this.workspace.folders;
2482
- const folderConfigurations = await this.loadFolderConfigurations(folders);
2483
- const workspaceConfiguration = this.getWorkspaceConfigurationModel(folderConfigurations);
2484
- const folderConfigurationModels = ( (new ResourceMap()));
2485
- folderConfigurations.forEach((folderConfiguration, index) => folderConfigurationModels.set(folders[index].uri, folderConfiguration));
2486
- const currentConfiguration = this._configuration;
2487
- this._configuration = ( (new Configuration(
2488
- this.defaultConfiguration.configurationModel,
2489
- this.policyConfiguration.configurationModel,
2490
- applicationConfigurationModel,
2491
- userConfigurationModel,
2492
- remoteUserConfigurationModel,
2493
- workspaceConfiguration,
2494
- folderConfigurationModels,
2495
- (new ConfigurationModel()),
2496
- (new ResourceMap()),
2497
- this.workspace
2498
- )));
2499
- if (this.initialized) {
2500
- const change = this._configuration.compare(currentConfiguration);
2501
- this.triggerConfigurationChange(change, { data: currentConfiguration.toData(), workspace: this.workspace }, 5 );
2502
- }
2503
- else {
2504
- this.initialized = true;
2505
- }
2506
- this.updateRestrictedSettings();
2507
- }
2508
- getWorkspaceConfigurationModel(folderConfigurations) {
2509
- switch (this.getWorkbenchState()) {
2510
- case 2 :
2511
- return folderConfigurations[0];
2512
- case 3 :
2513
- return this.workspaceConfiguration.getConfiguration();
2514
- default:
2515
- return (
2516
- (new ConfigurationModel())
2517
- );
2518
- }
2519
- }
2520
- onUserDataProfileChanged(e) {
2521
- e.join((async () => {
2522
- if (e.preserveData) {
2523
- await Promise.all([
2524
- this.copyProfileSettings(e.previous.settingsResource, e.profile.settingsResource),
2525
- this.copyProfileTasks(e.previous.tasksResource, e.profile.tasksResource)
2526
- ]);
2527
- }
2528
- const promises = [];
2529
- promises.push(this.localUserConfiguration.reset(e.profile.settingsResource, e.profile.tasksResource, getLocalUserConfigurationScopes(e.profile, !!this.remoteUserConfiguration)));
2530
- if (e.previous.isDefault !== e.profile.isDefault) {
2531
- this.createApplicationConfiguration();
2532
- if (this.applicationConfiguration) {
2533
- promises.push(this.reloadApplicationConfiguration(true));
2534
- }
2535
- }
2536
- const [localUser, application] = await Promise.all(promises);
2537
- await this.loadConfiguration(application ?? this._configuration.applicationConfiguration, localUser, this._configuration.remoteUserConfiguration);
2538
- })());
2539
- }
2540
- async copyProfileSettings(from, to) {
2541
- let fromContent;
2542
- try {
2543
- fromContent = ( ((await this.fileService.readFile(from)).value.toString()));
2544
- }
2545
- catch (error) {
2546
- if (error.fileOperationResult !== 1 ) {
2547
- throw error;
2548
- }
2549
- }
2550
- if (!fromContent) {
2551
- return;
2552
- }
2553
- const allSettings = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
2554
- const applicationSettings = ( (Object.keys(allSettings))).filter(key => allSettings[key]?.scope === 1 );
2555
- const toContent = updateIgnoredSettings(fromContent, '{}', applicationSettings, {});
2556
- await this.fileService.writeFile(to, VSBuffer.fromString(toContent));
2557
- }
2558
- async copyProfileTasks(from, to) {
2559
- if (await this.fileService.exists(from)) {
2560
- await this.fileService.copy(from, to);
2561
- }
2562
- }
2563
- onDefaultConfigurationChanged(configurationModel, properties) {
2564
- if (this.workspace) {
2565
- const previousData = this._configuration.toData();
2566
- const change = this._configuration.compareAndUpdateDefaultConfiguration(configurationModel, properties);
2567
- if (this.applicationConfiguration) {
2568
- this._configuration.updateApplicationConfiguration(this.applicationConfiguration.reparse());
2569
- }
2570
- if (this.remoteUserConfiguration) {
2571
- this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse());
2572
- this._configuration.updateRemoteUserConfiguration(this.remoteUserConfiguration.reparse());
2573
- }
2574
- if (this.getWorkbenchState() === 2 ) {
2575
- const folderConfiguration = this.cachedFolderConfigs.get(this.workspace.folders[0].uri);
2576
- if (folderConfiguration) {
2577
- this._configuration.updateWorkspaceConfiguration(folderConfiguration.reparse());
2578
- this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri, folderConfiguration.reparse());
2579
- }
2580
- }
2581
- else {
2582
- this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());
2583
- for (const folder of this.workspace.folders) {
2584
- const folderConfiguration = this.cachedFolderConfigs.get(folder.uri);
2585
- if (folderConfiguration) {
2586
- this._configuration.updateFolderConfiguration(folder.uri, folderConfiguration.reparse());
2587
- }
2588
- }
2589
- }
2590
- this.triggerConfigurationChange(change, { data: previousData, workspace: this.workspace }, 7 );
2591
- this.updateRestrictedSettings();
2592
- }
2593
- }
2594
- onPolicyConfigurationChanged(policyConfiguration) {
2595
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2596
- const change = this._configuration.compareAndUpdatePolicyConfiguration(policyConfiguration);
2597
- this.triggerConfigurationChange(change, previous, 7 );
2598
- }
2599
- onApplicationConfigurationChanged(applicationConfiguration) {
2600
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2601
- const change = this._configuration.compareAndUpdateApplicationConfiguration(applicationConfiguration);
2602
- const configurationProperties = this.configurationRegistry.getConfigurationProperties();
2603
- change.keys = change.keys.filter(key => configurationProperties[key]?.scope === 1 );
2604
- this.triggerConfigurationChange(change, previous, 2 );
2605
- }
2606
- onLocalUserConfigurationChanged(userConfiguration) {
2607
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2608
- const change = this._configuration.compareAndUpdateLocalUserConfiguration(userConfiguration);
2609
- this.triggerConfigurationChange(change, previous, 2 );
2610
- }
2611
- onRemoteUserConfigurationChanged(userConfiguration) {
2612
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2613
- const change = this._configuration.compareAndUpdateRemoteUserConfiguration(userConfiguration);
2614
- this.triggerConfigurationChange(change, previous, 2 );
2615
- }
2616
- async onWorkspaceConfigurationChanged(fromCache) {
2617
- if (this.workspace && this.workspace.configuration) {
2618
- let newFolders = toWorkspaceFolders(this.workspaceConfiguration.getFolders(), this.workspace.configuration, this.uriIdentityService.extUri);
2619
- if (this.workspace.initialized) {
2620
- const { added, removed, changed } = this.compareFolders(this.workspace.folders, newFolders);
2621
- if (added.length || removed.length || changed.length) {
2622
- newFolders = await this.toValidWorkspaceFolders(newFolders);
2623
- }
2624
- else {
2625
- newFolders = this.workspace.folders;
2626
- }
2627
- }
2628
- await this.updateWorkspaceConfiguration(newFolders, this.workspaceConfiguration.getConfiguration(), fromCache);
2629
- }
2630
- }
2631
- updateRestrictedSettings() {
2632
- const changed = [];
2633
- const allProperties = this.configurationRegistry.getConfigurationProperties();
2634
- const defaultRestrictedSettings = ( (Object.keys(allProperties))).filter(key => allProperties[key].restricted).sort((a, b) => a.localeCompare(b));
2635
- const defaultDelta = delta$1(defaultRestrictedSettings, this._restrictedSettings.default, (a, b) => a.localeCompare(b));
2636
- changed.push(...defaultDelta.added, ...defaultDelta.removed);
2637
- const application = (this.applicationConfiguration?.getRestrictedSettings() || []).sort((a, b) => a.localeCompare(b));
2638
- const applicationDelta = delta$1(application, this._restrictedSettings.application || [], (a, b) => a.localeCompare(b));
2639
- changed.push(...applicationDelta.added, ...applicationDelta.removed);
2640
- const userLocal = this.localUserConfiguration.getRestrictedSettings().sort((a, b) => a.localeCompare(b));
2641
- const userLocalDelta = delta$1(userLocal, this._restrictedSettings.userLocal || [], (a, b) => a.localeCompare(b));
2642
- changed.push(...userLocalDelta.added, ...userLocalDelta.removed);
2643
- const userRemote = (this.remoteUserConfiguration?.getRestrictedSettings() || []).sort((a, b) => a.localeCompare(b));
2644
- const userRemoteDelta = delta$1(userRemote, this._restrictedSettings.userRemote || [], (a, b) => a.localeCompare(b));
2645
- changed.push(...userRemoteDelta.added, ...userRemoteDelta.removed);
2646
- const workspaceFolderMap = ( (new ResourceMap()));
2647
- for (const workspaceFolder of this.workspace.folders) {
2648
- const cachedFolderConfig = this.cachedFolderConfigs.get(workspaceFolder.uri);
2649
- const folderRestrictedSettings = (cachedFolderConfig?.getRestrictedSettings() || []).sort((a, b) => a.localeCompare(b));
2650
- if (folderRestrictedSettings.length) {
2651
- workspaceFolderMap.set(workspaceFolder.uri, folderRestrictedSettings);
2652
- }
2653
- const previous = this._restrictedSettings.workspaceFolder?.get(workspaceFolder.uri) || [];
2654
- const workspaceFolderDelta = delta$1(folderRestrictedSettings, previous, (a, b) => a.localeCompare(b));
2655
- changed.push(...workspaceFolderDelta.added, ...workspaceFolderDelta.removed);
2656
- }
2657
- const workspace = this.getWorkbenchState() === 3 ? this.workspaceConfiguration.getRestrictedSettings().sort((a, b) => a.localeCompare(b))
2658
- : this.workspace.folders[0] ? (workspaceFolderMap.get(this.workspace.folders[0].uri) || []) : [];
2659
- const workspaceDelta = delta$1(workspace, this._restrictedSettings.workspace || [], (a, b) => a.localeCompare(b));
2660
- changed.push(...workspaceDelta.added, ...workspaceDelta.removed);
2661
- if (changed.length) {
2662
- this._restrictedSettings = {
2663
- default: defaultRestrictedSettings,
2664
- application: application.length ? application : undefined,
2665
- userLocal: userLocal.length ? userLocal : undefined,
2666
- userRemote: userRemote.length ? userRemote : undefined,
2667
- workspace: workspace.length ? workspace : undefined,
2668
- workspaceFolder: workspaceFolderMap.size ? workspaceFolderMap : undefined,
2669
- };
2670
- this._onDidChangeRestrictedSettings.fire(this.restrictedSettings);
2671
- }
2672
- }
2673
- async updateWorkspaceConfiguration(workspaceFolders, configuration, fromCache) {
2674
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2675
- const change = this._configuration.compareAndUpdateWorkspaceConfiguration(configuration);
2676
- const changes = this.compareFolders(this.workspace.folders, workspaceFolders);
2677
- if (changes.added.length || changes.removed.length || changes.changed.length) {
2678
- this.workspace.folders = workspaceFolders;
2679
- const change = await this.onFoldersChanged();
2680
- await this.handleWillChangeWorkspaceFolders(changes, fromCache);
2681
- this.triggerConfigurationChange(change, previous, 6 );
2682
- this._onDidChangeWorkspaceFolders.fire(changes);
2683
- }
2684
- else {
2685
- this.triggerConfigurationChange(change, previous, 5 );
2686
- }
2687
- this.updateRestrictedSettings();
2688
- }
2689
- async handleWillChangeWorkspaceFolders(changes, fromCache) {
2690
- const joiners = [];
2691
- this._onWillChangeWorkspaceFolders.fire({
2692
- join(updateWorkspaceTrustStatePromise) {
2693
- joiners.push(updateWorkspaceTrustStatePromise);
2694
- },
2695
- changes,
2696
- fromCache
2697
- });
2698
- try {
2699
- await Promises.settled(joiners);
2700
- }
2701
- catch (error) { }
2702
- }
2703
- async onWorkspaceFolderConfigurationChanged(folder) {
2704
- const [folderConfiguration] = await this.loadFolderConfigurations([folder]);
2705
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2706
- const folderConfigurationChange = this._configuration.compareAndUpdateFolderConfiguration(folder.uri, folderConfiguration);
2707
- if (this.getWorkbenchState() === 2 ) {
2708
- const workspaceConfigurationChange = this._configuration.compareAndUpdateWorkspaceConfiguration(folderConfiguration);
2709
- this.triggerConfigurationChange(mergeChanges(folderConfigurationChange, workspaceConfigurationChange), previous, 5 );
2710
- }
2711
- else {
2712
- this.triggerConfigurationChange(folderConfigurationChange, previous, 6 );
2713
- }
2714
- this.updateRestrictedSettings();
2715
- }
2716
- async onFoldersChanged() {
2717
- const changes = [];
2718
- for (const key of ( (this.cachedFolderConfigs.keys()))) {
2719
- if (!this.workspace.folders.filter(folder => ( (folder.uri.toString())) === ( (key.toString())))[0]) {
2720
- const folderConfiguration = this.cachedFolderConfigs.get(key);
2721
- folderConfiguration.dispose();
2722
- this.cachedFolderConfigs.delete(key);
2723
- changes.push(this._configuration.compareAndDeleteFolderConfiguration(key));
2724
- }
2725
- }
2726
- const toInitialize = this.workspace.folders.filter(folder => !this.cachedFolderConfigs.has(folder.uri));
2727
- if (toInitialize.length) {
2728
- const folderConfigurations = await this.loadFolderConfigurations(toInitialize);
2729
- folderConfigurations.forEach((folderConfiguration, index) => {
2730
- changes.push(this._configuration.compareAndUpdateFolderConfiguration(toInitialize[index].uri, folderConfiguration));
2731
- });
2732
- }
2733
- return mergeChanges(...changes);
2734
- }
2735
- loadFolderConfigurations(folders) {
2736
- return Promise.all([...( (folders.map(folder => {
2737
- let folderConfiguration = this.cachedFolderConfigs.get(folder.uri);
2738
- if (!folderConfiguration) {
2739
- folderConfiguration = ( (new FolderConfiguration(
2740
- !this.initialized,
2741
- folder,
2742
- FOLDER_CONFIG_FOLDER_NAME,
2743
- this.getWorkbenchState(),
2744
- this.isWorkspaceTrusted,
2745
- this.fileService,
2746
- this.uriIdentityService,
2747
- this.logService,
2748
- this.configurationCache
2749
- )));
2750
- this._register(folderConfiguration.onDidChange(() => this.onWorkspaceFolderConfigurationChanged(folder)));
2751
- this.cachedFolderConfigs.set(folder.uri, this._register(folderConfiguration));
2752
- }
2753
- return folderConfiguration.loadConfiguration();
2754
- })))]);
2755
- }
2756
- async validateWorkspaceFoldersAndReload(fromCache) {
2757
- const validWorkspaceFolders = await this.toValidWorkspaceFolders(this.workspace.folders);
2758
- const { removed } = this.compareFolders(this.workspace.folders, validWorkspaceFolders);
2759
- if (removed.length) {
2760
- await this.updateWorkspaceConfiguration(validWorkspaceFolders, this.workspaceConfiguration.getConfiguration(), fromCache);
2761
- }
2762
- }
2763
- async toValidWorkspaceFolders(workspaceFolders) {
2764
- const validWorkspaceFolders = [];
2765
- for (const workspaceFolder of workspaceFolders) {
2766
- try {
2767
- const result = await this.fileService.stat(workspaceFolder.uri);
2768
- if (!result.isDirectory) {
2769
- continue;
2770
- }
2771
- }
2772
- catch (e) {
2773
- this.logService.warn(`Ignoring the error while validating workspace folder ${( ( workspaceFolder.uri.toString()))} - ${toErrorMessage(e)}`);
2774
- }
2775
- validWorkspaceFolders.push(workspaceFolder);
2776
- }
2777
- return validWorkspaceFolders;
2778
- }
2779
- async writeConfigurationValue(key, value, target, overrides, options) {
2780
- if (!this.instantiationService) {
2781
- throw new Error('Cannot write configuration because the configuration service is not yet ready to accept writes.');
2782
- }
2783
- if (target === 7 ) {
2784
- throw new Error('Invalid configuration target');
2785
- }
2786
- if (target === 8 ) {
2787
- const previous = { data: this._configuration.toData(), workspace: this.workspace };
2788
- this._configuration.updateValue(key, value, overrides);
2789
- this.triggerConfigurationChange({ keys: overrides?.overrideIdentifiers?.length ? [keyFromOverrideIdentifiers(overrides.overrideIdentifiers), key] : [key], overrides: overrides?.overrideIdentifiers?.length ? ( (overrides.overrideIdentifiers.map(overrideIdentifier => ([overrideIdentifier, [key]])))) : [] }, previous, target);
2790
- return;
2791
- }
2792
- const editableConfigurationTarget = this.toEditableConfigurationTarget(target, key);
2793
- if (!editableConfigurationTarget) {
2794
- throw new Error('Invalid configuration target');
2795
- }
2796
- if (editableConfigurationTarget === 2 && !this.remoteUserConfiguration) {
2797
- throw new Error('Invalid configuration target');
2798
- }
2799
- this.configurationEditing = this.configurationEditing ?? this.instantiationService.createInstance(ConfigurationEditing, (await this.remoteAgentService.getEnvironment())?.settingsPath ?? null);
2800
- await this.configurationEditing.writeConfiguration(editableConfigurationTarget, { key, value }, { scopes: overrides, ...options });
2801
- switch (editableConfigurationTarget) {
2802
- case 1 :
2803
- if (this.applicationConfiguration && this.configurationRegistry.getConfigurationProperties()[key].scope === 1 ) {
2804
- await this.reloadApplicationConfiguration();
2805
- }
2806
- else {
2807
- await this.reloadLocalUserConfiguration();
2808
- }
2809
- return;
2810
- case 2 :
2811
- return this.reloadRemoteUserConfiguration().then(() => undefined);
2812
- case 3 :
2813
- return this.reloadWorkspaceConfiguration();
2814
- case 4 : {
2815
- const workspaceFolder = overrides && overrides.resource ? this.workspace.getFolder(overrides.resource) : null;
2816
- if (workspaceFolder) {
2817
- return this.reloadWorkspaceFolderConfiguration(workspaceFolder);
2818
- }
2819
- }
2820
- }
2821
- }
2822
- deriveConfigurationTargets(key, value, inspect) {
2823
- if (equals(value, inspect.value)) {
2824
- return [];
2825
- }
2826
- const definedTargets = [];
2827
- if (inspect.workspaceFolderValue !== undefined) {
2828
- definedTargets.push(6 );
2829
- }
2830
- if (inspect.workspaceValue !== undefined) {
2831
- definedTargets.push(5 );
2832
- }
2833
- if (inspect.userRemoteValue !== undefined) {
2834
- definedTargets.push(4 );
2835
- }
2836
- if (inspect.userLocalValue !== undefined) {
2837
- definedTargets.push(3 );
2838
- }
2839
- if (value === undefined) {
2840
- return definedTargets;
2841
- }
2842
- return [definedTargets[0] || 2 ];
2843
- }
2844
- triggerConfigurationChange(change, previous, target) {
2845
- if (change.keys.length) {
2846
- if (target !== 7 ) {
2847
- this.logService.debug(`Configuration keys changed in ${ConfigurationTargetToString(target)} target`, ...change.keys);
2848
- }
2849
- const configurationChangeEvent = ( (new ConfigurationChangeEvent(change, previous, this._configuration, this.workspace)));
2850
- configurationChangeEvent.source = target;
2851
- configurationChangeEvent.sourceConfig = this.getTargetConfiguration(target);
2852
- this._onDidChangeConfiguration.fire(configurationChangeEvent);
2853
- }
2854
- }
2855
- getTargetConfiguration(target) {
2856
- switch (target) {
2857
- case 7 :
2858
- return this._configuration.defaults.contents;
2859
- case 2 :
2860
- return this._configuration.userConfiguration.contents;
2861
- case 5 :
2862
- return this._configuration.workspaceConfiguration.contents;
2863
- }
2864
- return {};
2865
- }
2866
- toEditableConfigurationTarget(target, key) {
2867
- if (target === 2 ) {
2868
- if (this.remoteUserConfiguration) {
2869
- const scope = this.configurationRegistry.getConfigurationProperties()[key]?.scope;
2870
- if (scope === 2 || scope === 6 ) {
2871
- return 2 ;
2872
- }
2873
- if (this.inspect(key).userRemoteValue !== undefined) {
2874
- return 2 ;
2875
- }
2876
- }
2877
- return 1 ;
2878
- }
2879
- if (target === 3 ) {
2880
- return 1 ;
2881
- }
2882
- if (target === 4 ) {
2883
- return 2 ;
2884
- }
2885
- if (target === 5 ) {
2886
- return 3 ;
2887
- }
2888
- if (target === 6 ) {
2889
- return 4 ;
2890
- }
2891
- return null;
2892
- }
2893
- }
2894
- let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchemasContribution extends Disposable {
2895
- constructor(workspaceContextService, environmentService, workspaceTrustManagementService, extensionService, lifecycleService) {
2896
- super();
2897
- this.workspaceContextService = workspaceContextService;
2898
- this.environmentService = environmentService;
2899
- this.workspaceTrustManagementService = workspaceTrustManagementService;
2900
- extensionService.whenInstalledExtensionsRegistered().then(() => {
2901
- this.registerConfigurationSchemas();
2902
- const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
2903
- const delayer = this._register(( (new Delayer(50))));
2904
- this._register(Event.any(configurationRegistry.onDidUpdateConfiguration, configurationRegistry.onDidSchemaChange, workspaceTrustManagementService.onDidChangeTrust)(() => delayer.trigger(() => this.registerConfigurationSchemas(), lifecycleService.phase === 4 ? undefined : 2500 )));
2905
- });
2906
- }
2907
- registerConfigurationSchemas() {
2908
- const jsonRegistry = ( (Registry.as(Extensions$1.JSONContribution)));
2909
- const allSettingsSchema = {
2910
- properties: allSettings.properties,
2911
- patternProperties: allSettings.patternProperties,
2912
- additionalProperties: true,
2913
- allowTrailingCommas: true,
2914
- allowComments: true
2915
- };
2916
- const userSettingsSchema = this.environmentService.remoteAuthority ?
2917
- {
2918
- properties: Object.assign({}, applicationSettings.properties, windowSettings.properties, resourceSettings.properties),
2919
- patternProperties: allSettings.patternProperties,
2920
- additionalProperties: true,
2921
- allowTrailingCommas: true,
2922
- allowComments: true
2923
- }
2924
- : allSettingsSchema;
2925
- const profileSettingsSchema = {
2926
- properties: Object.assign({}, machineSettings.properties, machineOverridableSettings.properties, windowSettings.properties, resourceSettings.properties),
2927
- patternProperties: allSettings.patternProperties,
2928
- additionalProperties: true,
2929
- allowTrailingCommas: true,
2930
- allowComments: true
2931
- };
2932
- const machineSettingsSchema = {
2933
- properties: Object.assign({}, machineSettings.properties, machineOverridableSettings.properties, windowSettings.properties, resourceSettings.properties),
2934
- patternProperties: allSettings.patternProperties,
2935
- additionalProperties: true,
2936
- allowTrailingCommas: true,
2937
- allowComments: true
2938
- };
2939
- const workspaceSettingsSchema = {
2940
- properties: Object.assign({}, this.checkAndFilterPropertiesRequiringTrust(machineOverridableSettings.properties), this.checkAndFilterPropertiesRequiringTrust(windowSettings.properties), this.checkAndFilterPropertiesRequiringTrust(resourceSettings.properties)),
2941
- patternProperties: allSettings.patternProperties,
2942
- additionalProperties: true,
2943
- allowTrailingCommas: true,
2944
- allowComments: true
2945
- };
2946
- jsonRegistry.registerSchema(defaultSettingsSchemaId, {
2947
- properties: ( (Object.keys(allSettings.properties))).reduce((result, key) => {
2948
- result[key] = Object.assign({ deprecationMessage: undefined }, allSettings.properties[key]);
2949
- return result;
2950
- }, {}),
2951
- patternProperties: ( (Object.keys(allSettings.patternProperties))).reduce((result, key) => {
2952
- result[key] = Object.assign({ deprecationMessage: undefined }, allSettings.patternProperties[key]);
2953
- return result;
2954
- }, {}),
2955
- additionalProperties: true,
2956
- allowTrailingCommas: true,
2957
- allowComments: true
2958
- });
2959
- jsonRegistry.registerSchema(userSettingsSchemaId, userSettingsSchema);
2960
- jsonRegistry.registerSchema(profileSettingsSchemaId, profileSettingsSchema);
2961
- jsonRegistry.registerSchema(machineSettingsSchemaId, machineSettingsSchema);
2962
- if (3 === this.workspaceContextService.getWorkbenchState()) {
2963
- const folderSettingsSchema = {
2964
- properties: Object.assign({}, this.checkAndFilterPropertiesRequiringTrust(machineOverridableSettings.properties), this.checkAndFilterPropertiesRequiringTrust(resourceSettings.properties)),
2965
- patternProperties: allSettings.patternProperties,
2966
- additionalProperties: true,
2967
- allowTrailingCommas: true,
2968
- allowComments: true
2969
- };
2970
- jsonRegistry.registerSchema(workspaceSettingsSchemaId, workspaceSettingsSchema);
2971
- jsonRegistry.registerSchema(folderSettingsSchemaId, folderSettingsSchema);
2972
- }
2973
- else {
2974
- jsonRegistry.registerSchema(workspaceSettingsSchemaId, workspaceSettingsSchema);
2975
- jsonRegistry.registerSchema(folderSettingsSchemaId, workspaceSettingsSchema);
2976
- }
2977
- jsonRegistry.registerSchema(configurationDefaultsSchemaId, {
2978
- type: 'object',
2979
- description: ( (localize(
2980
- 'configurationDefaults.description',
2981
- 'Contribute defaults for configurations'
2982
- ))),
2983
- properties: Object.assign({}, machineOverridableSettings.properties, windowSettings.properties, resourceSettings.properties),
2984
- patternProperties: {
2985
- [OVERRIDE_PROPERTY_PATTERN]: {
2986
- type: 'object',
2987
- default: {},
2988
- $ref: resourceLanguageSettingsSchemaId,
2989
- }
2990
- },
2991
- additionalProperties: false
2992
- });
2993
- }
2994
- checkAndFilterPropertiesRequiringTrust(properties) {
2995
- if (this.workspaceTrustManagementService.isWorkspaceTrusted()) {
2996
- return properties;
2997
- }
2998
- const result = {};
2999
- Object.entries(properties).forEach(([key, value]) => {
3000
- if (!value.restricted) {
3001
- result[key] = value;
3002
- }
3003
- });
3004
- return result;
3005
- }
3006
- };
3007
- RegisterConfigurationSchemasContribution = ( (__decorate([
3008
- ( (__param(0, IWorkspaceContextService))),
3009
- ( (__param(1, IWorkbenchEnvironmentService))),
3010
- ( (__param(2, IWorkspaceTrustManagementService))),
3011
- ( (__param(3, IExtensionService))),
3012
- ( (__param(4, ILifecycleService)))
3013
- ], RegisterConfigurationSchemasContribution)));
3014
- const workbenchContributionsRegistry = ( (Registry.as(Extensions$2.Workbench)));
3015
- workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution, 3 );
3016
- let TextResourceConfigurationService = class TextResourceConfigurationService extends Disposable {
3017
- constructor(configurationService, modelService, languageService) {
3018
- super();
3019
- this.configurationService = configurationService;
3020
- this.modelService = modelService;
3021
- this.languageService = languageService;
3022
- this._onDidChangeConfiguration = this._register(( (new Emitter())));
3023
- this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
3024
- this._register(this.configurationService.onDidChangeConfiguration(e => this._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(e))));
3025
- }
3026
- getValue(resource, arg2, arg3) {
3027
- if (typeof arg3 === 'string') {
3028
- return this._getValue(resource, Position$2.isIPosition(arg2) ? arg2 : null, arg3);
3029
- }
3030
- return this._getValue(resource, null, typeof arg2 === 'string' ? arg2 : undefined);
3031
- }
3032
- updateValue(resource, key, value, configurationTarget) {
3033
- const language = this.getLanguage(resource, null);
3034
- const configurationValue = this.configurationService.inspect(key, { resource, overrideIdentifier: language });
3035
- if (configurationTarget === undefined) {
3036
- configurationTarget = this.deriveConfigurationTarget(configurationValue, language);
3037
- }
3038
- switch (configurationTarget) {
3039
- case 8 :
3040
- return this._updateValue(key, value, configurationTarget, configurationValue.memory?.override, resource, language);
3041
- case 6 :
3042
- return this._updateValue(key, value, configurationTarget, configurationValue.workspaceFolder?.override, resource, language);
3043
- case 5 :
3044
- return this._updateValue(key, value, configurationTarget, configurationValue.workspace?.override, resource, language);
3045
- case 4 :
3046
- return this._updateValue(key, value, configurationTarget, configurationValue.userRemote?.override, resource, language);
3047
- default:
3048
- return this._updateValue(key, value, configurationTarget, configurationValue.userLocal?.override, resource, language);
3049
- }
3050
- }
3051
- _updateValue(key, value, configurationTarget, overriddenValue, resource, language) {
3052
- if (language && overriddenValue !== undefined) {
3053
- return this.configurationService.updateValue(key, value, { resource, overrideIdentifier: language }, configurationTarget);
3054
- }
3055
- else {
3056
- return this.configurationService.updateValue(key, value, { resource }, configurationTarget);
3057
- }
3058
- }
3059
- deriveConfigurationTarget(configurationValue, language) {
3060
- if (language) {
3061
- if (configurationValue.memory?.override !== undefined) {
3062
- return 8 ;
3063
- }
3064
- if (configurationValue.workspaceFolder?.override !== undefined) {
3065
- return 6 ;
3066
- }
3067
- if (configurationValue.workspace?.override !== undefined) {
3068
- return 5 ;
3069
- }
3070
- if (configurationValue.userRemote?.override !== undefined) {
3071
- return 4 ;
3072
- }
3073
- if (configurationValue.userLocal?.override !== undefined) {
3074
- return 3 ;
3075
- }
3076
- }
3077
- if (configurationValue.memory?.value !== undefined) {
3078
- return 8 ;
3079
- }
3080
- if (configurationValue.workspaceFolder?.value !== undefined) {
3081
- return 6 ;
3082
- }
3083
- if (configurationValue.workspace?.value !== undefined) {
3084
- return 5 ;
3085
- }
3086
- if (configurationValue.userRemote?.value !== undefined) {
3087
- return 4 ;
3088
- }
3089
- return 3 ;
3090
- }
3091
- _getValue(resource, position, section) {
3092
- const language = resource ? this.getLanguage(resource, position) : undefined;
3093
- if (typeof section === 'undefined') {
3094
- return this.configurationService.getValue({ resource, overrideIdentifier: language });
3095
- }
3096
- return this.configurationService.getValue(section, { resource, overrideIdentifier: language });
3097
- }
3098
- getLanguage(resource, position) {
3099
- const model = this.modelService.getModel(resource);
3100
- if (model) {
3101
- return position ? model.getLanguageIdAtPosition(position.lineNumber, position.column) : model.getLanguageId();
3102
- }
3103
- return this.languageService.guessLanguageIdByFilepathOrFirstLine(resource);
3104
- }
3105
- toResourceConfigurationChangeEvent(configurationChangeEvent) {
3106
- return {
3107
- affectedKeys: configurationChangeEvent.affectedKeys,
3108
- affectsConfiguration: (resource, configuration) => {
3109
- const overrideIdentifier = resource ? this.getLanguage(resource, null) : undefined;
3110
- return configurationChangeEvent.affectsConfiguration(configuration, { resource, overrideIdentifier });
3111
- }
3112
- };
3113
- }
3114
- };
3115
- TextResourceConfigurationService = ( (__decorate([
3116
- ( (__param(0, IConfigurationService))),
3117
- ( (__param(1, IModelService))),
3118
- ( (__param(2, ILanguageService)))
3119
- ], TextResourceConfigurationService)));
3120
- class ConfigurationCache {
3121
- constructor(donotCacheResourcesWithSchemes, environmentService, fileService) {
3122
- this.donotCacheResourcesWithSchemes = donotCacheResourcesWithSchemes;
3123
- this.fileService = fileService;
3124
- this.cachedConfigurations = ( (new Map()));
3125
- this.cacheHome = environmentService.cacheHome;
3126
- }
3127
- needsCaching(resource) {
3128
- return !this.donotCacheResourcesWithSchemes.includes(resource.scheme);
3129
- }
3130
- read(key) {
3131
- return this.getCachedConfiguration(key).read();
3132
- }
3133
- write(key, content) {
3134
- return this.getCachedConfiguration(key).save(content);
3135
- }
3136
- remove(key) {
3137
- return this.getCachedConfiguration(key).remove();
3138
- }
3139
- getCachedConfiguration({ type, key }) {
3140
- const k = `${type}:${key}`;
3141
- let cachedConfiguration = this.cachedConfigurations.get(k);
3142
- if (!cachedConfiguration) {
3143
- cachedConfiguration = ( (new CachedConfiguration({ type, key }, this.cacheHome, this.fileService)));
3144
- this.cachedConfigurations.set(k, cachedConfiguration);
3145
- }
3146
- return cachedConfiguration;
3147
- }
3148
- }
3149
- class CachedConfiguration {
3150
- constructor({ type, key }, cacheHome, fileService) {
3151
- this.fileService = fileService;
3152
- this.cachedConfigurationFolderResource = joinPath(cacheHome, 'CachedConfigurations', type, key);
3153
- this.cachedConfigurationFileResource = joinPath(this.cachedConfigurationFolderResource, type === 'workspaces' ? 'workspace.json' : 'configuration.json');
3154
- this.queue = ( (new Queue()));
3155
- }
3156
- async read() {
3157
- try {
3158
- const content = await this.fileService.readFile(this.cachedConfigurationFileResource);
3159
- return (
3160
- (content.value.toString())
3161
- );
3162
- }
3163
- catch (e) {
3164
- return '';
3165
- }
3166
- }
3167
- async save(content) {
3168
- const created = await this.createCachedFolder();
3169
- if (created) {
3170
- await this.queue.queue(async () => {
3171
- await this.fileService.writeFile(this.cachedConfigurationFileResource, VSBuffer.fromString(content));
3172
- });
3173
- }
3174
- }
3175
- async remove() {
3176
- try {
3177
- await this.queue.queue(() => this.fileService.del(this.cachedConfigurationFolderResource, { recursive: true, useTrash: false }));
3178
- }
3179
- catch (error) {
3180
- if (error.fileOperationResult !== 1 ) {
3181
- throw error;
3182
- }
3183
- }
3184
- }
3185
- async createCachedFolder() {
3186
- if (await this.fileService.exists(this.cachedConfigurationFolderResource)) {
3187
- return true;
3188
- }
3189
- try {
3190
- await this.fileService.createFolder(this.cachedConfigurationFolderResource);
3191
- return true;
3192
- }
3193
- catch (error) {
3194
- return false;
3195
- }
3196
- }
3197
- }
3198
- const sepRegexp = /\//g;
3199
- const labelMatchingRegexp = /\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;
3200
- function hasDriveLetterIgnorePlatform(path) {
3201
- return !!(path && path[2] === ':');
3202
- }
3203
- const FORMATTER_CACHE_SIZE = 50;
3204
- let LabelService = class LabelService extends Disposable {
3205
- constructor(environmentService, contextService, pathService, remoteAgentService, storageService, lifecycleService) {
3206
- super();
3207
- this.environmentService = environmentService;
3208
- this.contextService = contextService;
3209
- this.pathService = pathService;
3210
- this.remoteAgentService = remoteAgentService;
3211
- this._onDidChangeFormatters = this._register(( (new Emitter({ leakWarningThreshold: 400 }))));
3212
- this.onDidChangeFormatters = this._onDidChangeFormatters.event;
3213
- this.os = OS;
3214
- this.userHome = pathService.defaultUriScheme === Schemas.file ? this.pathService.userHome({ preferLocal: true }) : undefined;
3215
- const memento = this.storedFormattersMemento = ( (new Memento('cachedResourceLabelFormatters2', storageService)));
3216
- this.storedFormatters = memento.getMemento(0 , 1 );
3217
- this.formatters = this.storedFormatters?.formatters?.slice() || [];
3218
- this.resolveRemoteEnvironment();
3219
- }
3220
- async resolveRemoteEnvironment() {
3221
- const env = await this.remoteAgentService.getEnvironment();
3222
- this.os = env?.os ?? OS;
3223
- this.userHome = await this.pathService.userHome();
3224
- }
3225
- findFormatting(resource) {
3226
- let bestResult;
3227
- for (const formatter of this.formatters) {
3228
- if (formatter.scheme === resource.scheme) {
3229
- if (!formatter.authority && (!bestResult || formatter.priority)) {
3230
- bestResult = formatter;
3231
- continue;
3232
- }
3233
- if (!formatter.authority) {
3234
- continue;
3235
- }
3236
- if (match(formatter.authority.toLowerCase(), resource.authority.toLowerCase()) &&
3237
- (!bestResult ||
3238
- !bestResult.authority ||
3239
- formatter.authority.length > bestResult.authority.length ||
3240
- ((formatter.authority.length === bestResult.authority.length) && formatter.priority))) {
3241
- bestResult = formatter;
3242
- }
3243
- }
3244
- }
3245
- return bestResult ? bestResult.formatting : undefined;
3246
- }
3247
- getUriLabel(resource, options = {}) {
3248
- let formatting = this.findFormatting(resource);
3249
- if (formatting && options.separator) {
3250
- formatting = { ...formatting, separator: options.separator };
3251
- }
3252
- const label = this.doGetUriLabel(resource, formatting, options);
3253
- if (!formatting && options.separator) {
3254
- return label.replace(sepRegexp, options.separator);
3255
- }
3256
- return label;
3257
- }
3258
- doGetUriLabel(resource, formatting, options = {}) {
3259
- if (!formatting) {
3260
- return getPathLabel(resource, {
3261
- os: this.os,
3262
- tildify: this.userHome ? { userHome: this.userHome } : undefined,
3263
- relative: options.relative ? {
3264
- noPrefix: options.noPrefix,
3265
- getWorkspace: () => this.contextService.getWorkspace(),
3266
- getWorkspaceFolder: resource => this.contextService.getWorkspaceFolder(resource)
3267
- } : undefined
3268
- });
3269
- }
3270
- if (options.relative && this.contextService) {
3271
- let folder = this.contextService.getWorkspaceFolder(resource);
3272
- if (!folder) {
3273
- const workspace = this.contextService.getWorkspace();
3274
- const firstFolder = firstOrDefault(workspace.folders);
3275
- if (firstFolder && resource.scheme !== firstFolder.uri.scheme && resource.path.startsWith(posix.sep)) {
3276
- folder = this.contextService.getWorkspaceFolder(firstFolder.uri.with({ path: resource.path }));
3277
- }
3278
- }
3279
- if (folder) {
3280
- const folderLabel = this.formatUri(folder.uri, formatting, options.noPrefix);
3281
- let relativeLabel = this.formatUri(resource, formatting, options.noPrefix);
3282
- let overlap = 0;
3283
- while (relativeLabel[overlap] && relativeLabel[overlap] === folderLabel[overlap]) {
3284
- overlap++;
3285
- }
3286
- if (!relativeLabel[overlap] || relativeLabel[overlap] === formatting.separator) {
3287
- relativeLabel = relativeLabel.substring(1 + overlap);
3288
- }
3289
- else if (overlap === folderLabel.length && folder.uri.path === posix.sep) {
3290
- relativeLabel = relativeLabel.substring(overlap);
3291
- }
3292
- const hasMultipleRoots = this.contextService.getWorkspace().folders.length > 1;
3293
- if (hasMultipleRoots && !options.noPrefix) {
3294
- const rootName = folder?.name ?? basenameOrAuthority(folder.uri);
3295
- relativeLabel = relativeLabel ? `${rootName} • ${relativeLabel}` : rootName;
3296
- }
3297
- return relativeLabel;
3298
- }
3299
- }
3300
- return this.formatUri(resource, formatting, options.noPrefix);
3301
- }
3302
- getUriBasenameLabel(resource) {
3303
- const formatting = this.findFormatting(resource);
3304
- const label = this.doGetUriLabel(resource, formatting);
3305
- let pathLib;
3306
- if (formatting?.separator === win32.sep) {
3307
- pathLib = win32;
3308
- }
3309
- else if (formatting?.separator === posix.sep) {
3310
- pathLib = posix;
3311
- }
3312
- else {
3313
- pathLib = ((this.os === 1) ) ? win32 : posix;
3314
- }
3315
- return pathLib.basename(label);
3316
- }
3317
- getWorkspaceLabel(workspace, options) {
3318
- if (isWorkspace(workspace)) {
3319
- const identifier = toWorkspaceIdentifier(workspace);
3320
- if (isSingleFolderWorkspaceIdentifier(identifier) || isWorkspaceIdentifier(identifier)) {
3321
- return this.getWorkspaceLabel(identifier, options);
3322
- }
3323
- return '';
3324
- }
3325
- if (URI.isUri(workspace)) {
3326
- return this.doGetSingleFolderWorkspaceLabel(workspace, options);
3327
- }
3328
- if (isSingleFolderWorkspaceIdentifier(workspace)) {
3329
- return this.doGetSingleFolderWorkspaceLabel(workspace.uri, options);
3330
- }
3331
- if (isWorkspaceIdentifier(workspace)) {
3332
- return this.doGetWorkspaceLabel(workspace.configPath, options);
3333
- }
3334
- return '';
3335
- }
3336
- doGetWorkspaceLabel(workspaceUri, options) {
3337
- if (isUntitledWorkspace(workspaceUri, this.environmentService)) {
3338
- return (
3339
- (localize('untitledWorkspace', "Untitled (Workspace)"))
3340
- );
3341
- }
3342
- if (isTemporaryWorkspace(workspaceUri)) {
3343
- return (
3344
- (localize('temporaryWorkspace', "Workspace"))
3345
- );
3346
- }
3347
- let filename = basename(workspaceUri);
3348
- if (filename.endsWith(WORKSPACE_EXTENSION)) {
3349
- filename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
3350
- }
3351
- let label;
3352
- switch (options?.verbose) {
3353
- case 0 :
3354
- label = filename;
3355
- break;
3356
- case 2 :
3357
- label = ( (localize(
3358
- 'workspaceNameVerbose',
3359
- "{0} (Workspace)",
3360
- this.getUriLabel(joinPath(dirname(workspaceUri), filename))
3361
- )));
3362
- break;
3363
- case 1 :
3364
- default:
3365
- label = ( (localize('workspaceName', "{0} (Workspace)", filename)));
3366
- break;
3367
- }
3368
- if (options?.verbose === 0 ) {
3369
- return label;
3370
- }
3371
- return this.appendWorkspaceSuffix(label, workspaceUri);
3372
- }
3373
- doGetSingleFolderWorkspaceLabel(folderUri, options) {
3374
- let label;
3375
- switch (options?.verbose) {
3376
- case 2 :
3377
- label = this.getUriLabel(folderUri);
3378
- break;
3379
- case 0 :
3380
- case 1 :
3381
- default:
3382
- label = basename(folderUri) || posix.sep;
3383
- break;
3384
- }
3385
- if (options?.verbose === 0 ) {
3386
- return label;
3387
- }
3388
- return this.appendWorkspaceSuffix(label, folderUri);
3389
- }
3390
- getSeparator(scheme, authority) {
3391
- const formatter = this.findFormatting(( (URI.from({ scheme, authority }))));
3392
- return formatter?.separator || posix.sep;
3393
- }
3394
- getHostLabel(scheme, authority) {
3395
- const formatter = this.findFormatting(( (URI.from({ scheme, authority }))));
3396
- return formatter?.workspaceSuffix || authority || '';
3397
- }
3398
- getHostTooltip(scheme, authority) {
3399
- const formatter = this.findFormatting(( (URI.from({ scheme, authority }))));
3400
- return formatter?.workspaceTooltip;
3401
- }
3402
- registerCachedFormatter(formatter) {
3403
- const list = this.storedFormatters.formatters ??= [];
3404
- let replace = list.findIndex(f => f.scheme === formatter.scheme && f.authority === formatter.authority);
3405
- if (replace === -1 && list.length >= FORMATTER_CACHE_SIZE) {
3406
- replace = FORMATTER_CACHE_SIZE - 1;
3407
- }
3408
- if (replace === -1) {
3409
- list.unshift(formatter);
3410
- }
3411
- else {
3412
- for (let i = replace; i > 0; i--) {
3413
- list[i] = list[i - 1];
3414
- }
3415
- list[0] = formatter;
3416
- }
3417
- this.storedFormattersMemento.saveMemento();
3418
- return this.registerFormatter(formatter);
3419
- }
3420
- registerFormatter(formatter) {
3421
- this.formatters.push(formatter);
3422
- this._onDidChangeFormatters.fire({ scheme: formatter.scheme });
3423
- return {
3424
- dispose: () => {
3425
- this.formatters = this.formatters.filter(f => f !== formatter);
3426
- this._onDidChangeFormatters.fire({ scheme: formatter.scheme });
3427
- }
3428
- };
3429
- }
3430
- formatUri(resource, formatting, forceNoTildify) {
3431
- let label = formatting.label.replace(labelMatchingRegexp, (match, token, qsToken, qsValue) => {
3432
- switch (token) {
3433
- case 'scheme': return resource.scheme;
3434
- case 'authority': return resource.authority;
3435
- case 'authoritySuffix': {
3436
- const i = resource.authority.indexOf('+');
3437
- return i === -1 ? resource.authority : resource.authority.slice(i + 1);
3438
- }
3439
- case 'path':
3440
- return formatting.stripPathStartingSeparator
3441
- ? resource.path.slice(resource.path[0] === formatting.separator ? 1 : 0)
3442
- : resource.path;
3443
- default: {
3444
- if (qsToken === 'query') {
3445
- const { query } = resource;
3446
- if (query && query[0] === '{' && query[query.length - 1] === '}') {
3447
- try {
3448
- return JSON.parse(query)[qsValue] || '';
3449
- }
3450
- catch { }
3451
- }
3452
- }
3453
- return '';
3454
- }
3455
- }
3456
- });
3457
- if (formatting.normalizeDriveLetter && hasDriveLetterIgnorePlatform(label)) {
3458
- label = label.charAt(1).toUpperCase() + label.substr(2);
3459
- }
3460
- if (formatting.tildify && !forceNoTildify) {
3461
- if (this.userHome) {
3462
- label = tildify(label, this.userHome.fsPath, this.os);
3463
- }
3464
- }
3465
- if (formatting.authorityPrefix && resource.authority) {
3466
- label = formatting.authorityPrefix + label;
3467
- }
3468
- return label.replace(sepRegexp, formatting.separator);
3469
- }
3470
- appendWorkspaceSuffix(label, uri) {
3471
- const formatting = this.findFormatting(uri);
3472
- const suffix = formatting && (typeof formatting.workspaceSuffix === 'string') ? formatting.workspaceSuffix : undefined;
3473
- return suffix ? `${label} [${suffix}]` : label;
3474
- }
3475
- };
3476
- LabelService = ( (__decorate([
3477
- ( (__param(0, IWorkbenchEnvironmentService))),
3478
- ( (__param(1, IWorkspaceContextService))),
3479
- ( (__param(2, IPathService))),
3480
- ( (__param(3, IRemoteAgentService))),
3481
- ( (__param(4, IStorageService))),
3482
- ( (__param(5, ILifecycleService)))
3483
- ], LabelService)));
3484
- function getWorkspaceIdentifier(workspaceUri) {
3485
- return {
3486
- id: getWorkspaceId(workspaceUri),
3487
- configPath: workspaceUri
3488
- };
3489
- }
3490
- function getWorkspaceId(uri) {
3491
- return (
3492
- (hash(( (uri.toString()))).toString(16))
3493
- );
3494
- }
3495
- let BrowserWorkspacesService = class BrowserWorkspacesService extends Disposable {
3496
- constructor(storageService, contextService, logService, fileService, environmentService, uriIdentityService) {
3497
- super();
3498
- this.storageService = storageService;
3499
- this.contextService = contextService;
3500
- this.logService = logService;
3501
- this.fileService = fileService;
3502
- this.environmentService = environmentService;
3503
- this.uriIdentityService = uriIdentityService;
3504
- this._onRecentlyOpenedChange = this._register(( (new Emitter())));
3505
- this.onDidChangeRecentlyOpened = this._onRecentlyOpenedChange.event;
3506
- this.addWorkspaceToRecentlyOpened();
3507
- this.registerListeners();
3508
- }
3509
- registerListeners() {
3510
- this._register(this.storageService.onDidChangeValue(e => this.onDidChangeStorage(e)));
3511
- this._register(this.contextService.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e)));
3512
- }
3513
- onDidChangeStorage(e) {
3514
- if (e.key === BrowserWorkspacesService.RECENTLY_OPENED_KEY && e.scope === -1 ) {
3515
- this._onRecentlyOpenedChange.fire();
3516
- }
3517
- }
3518
- onDidChangeWorkspaceFolders(e) {
3519
- if (!isTemporaryWorkspace(this.contextService.getWorkspace())) {
3520
- return;
3521
- }
3522
- for (const folder of e.added) {
3523
- this.addRecentlyOpened([{ folderUri: folder.uri }]);
3524
- }
3525
- }
3526
- addWorkspaceToRecentlyOpened() {
3527
- const workspace = this.contextService.getWorkspace();
3528
- const remoteAuthority = this.environmentService.remoteAuthority;
3529
- switch (this.contextService.getWorkbenchState()) {
3530
- case 2 :
3531
- this.addRecentlyOpened([{ folderUri: workspace.folders[0].uri, remoteAuthority }]);
3532
- break;
3533
- case 3 :
3534
- this.addRecentlyOpened([{ workspace: { id: workspace.id, configPath: workspace.configuration }, remoteAuthority }]);
3535
- break;
3536
- }
3537
- }
3538
- async getRecentlyOpened() {
3539
- const recentlyOpenedRaw = this.storageService.get(BrowserWorkspacesService.RECENTLY_OPENED_KEY, -1 );
3540
- if (recentlyOpenedRaw) {
3541
- const recentlyOpened = restoreRecentlyOpened(JSON.parse(recentlyOpenedRaw), this.logService);
3542
- recentlyOpened.workspaces = recentlyOpened.workspaces.filter(recent => {
3543
- if (isRecentFolder(recent) && recent.folderUri.scheme === Schemas.file && !isTemporaryWorkspace(this.contextService.getWorkspace())) {
3544
- return false;
3545
- }
3546
- if (isRecentWorkspace(recent) && isTemporaryWorkspace(recent.workspace.configPath)) {
3547
- return false;
3548
- }
3549
- return true;
3550
- });
3551
- return recentlyOpened;
3552
- }
3553
- return { workspaces: [], files: [] };
3554
- }
3555
- async addRecentlyOpened(recents) {
3556
- const recentlyOpened = await this.getRecentlyOpened();
3557
- for (const recent of recents) {
3558
- if (isRecentFile(recent)) {
3559
- this.doRemoveRecentlyOpened(recentlyOpened, [recent.fileUri]);
3560
- recentlyOpened.files.unshift(recent);
3561
- }
3562
- else if (isRecentFolder(recent)) {
3563
- this.doRemoveRecentlyOpened(recentlyOpened, [recent.folderUri]);
3564
- recentlyOpened.workspaces.unshift(recent);
3565
- }
3566
- else {
3567
- this.doRemoveRecentlyOpened(recentlyOpened, [recent.workspace.configPath]);
3568
- recentlyOpened.workspaces.unshift(recent);
3569
- }
3570
- }
3571
- return this.saveRecentlyOpened(recentlyOpened);
3572
- }
3573
- async removeRecentlyOpened(paths) {
3574
- const recentlyOpened = await this.getRecentlyOpened();
3575
- this.doRemoveRecentlyOpened(recentlyOpened, paths);
3576
- return this.saveRecentlyOpened(recentlyOpened);
3577
- }
3578
- doRemoveRecentlyOpened(recentlyOpened, paths) {
3579
- recentlyOpened.files = recentlyOpened.files.filter(file => {
3580
- return !paths.some(path => ( (path.toString())) === ( (file.fileUri.toString())));
3581
- });
3582
- recentlyOpened.workspaces = recentlyOpened.workspaces.filter(workspace => {
3583
- return !paths.some(path => ( (path.toString())) === (isRecentFolder(workspace) ? ( (workspace.folderUri.toString())) : ( (workspace.workspace.configPath.toString()))));
3584
- });
3585
- }
3586
- async saveRecentlyOpened(data) {
3587
- return this.storageService.store(BrowserWorkspacesService.RECENTLY_OPENED_KEY, JSON.stringify(toStoreData(data)), -1 , 0 );
3588
- }
3589
- async clearRecentlyOpened() {
3590
- this.storageService.remove(BrowserWorkspacesService.RECENTLY_OPENED_KEY, -1 );
3591
- }
3592
- async enterWorkspace(workspaceUri) {
3593
- return { workspace: await this.getWorkspaceIdentifier(workspaceUri) };
3594
- }
3595
- async createUntitledWorkspace(folders, remoteAuthority) {
3596
- const randomId = ( ((Date.now() + Math.round(Math.random() * 1000)).toString()));
3597
- const newUntitledWorkspacePath = joinPath(this.environmentService.untitledWorkspacesHome, `Untitled-${randomId}.${WORKSPACE_EXTENSION}`);
3598
- const storedWorkspaceFolder = [];
3599
- if (folders) {
3600
- for (const folder of folders) {
3601
- storedWorkspaceFolder.push(getStoredWorkspaceFolder(folder.uri, true, folder.name, this.environmentService.untitledWorkspacesHome, this.uriIdentityService.extUri));
3602
- }
3603
- }
3604
- const storedWorkspace = { folders: storedWorkspaceFolder, remoteAuthority };
3605
- await this.fileService.writeFile(newUntitledWorkspacePath, VSBuffer.fromString(JSON.stringify(storedWorkspace, null, '\t')));
3606
- return this.getWorkspaceIdentifier(newUntitledWorkspacePath);
3607
- }
3608
- async deleteUntitledWorkspace(workspace) {
3609
- try {
3610
- await this.fileService.del(workspace.configPath);
3611
- }
3612
- catch (error) {
3613
- if (error.fileOperationResult !== 1 ) {
3614
- throw error;
3615
- }
3616
- }
3617
- }
3618
- async getWorkspaceIdentifier(workspaceUri) {
3619
- return getWorkspaceIdentifier(workspaceUri);
3620
- }
3621
- async getDirtyWorkspaces() {
3622
- return [];
3623
- }
3624
- };
3625
- BrowserWorkspacesService.RECENTLY_OPENED_KEY = 'recently.opened';
3626
- BrowserWorkspacesService = ( (__decorate([
3627
- ( (__param(0, IStorageService))),
3628
- ( (__param(1, IWorkspaceContextService))),
3629
- ( (__param(2, ILogService))),
3630
- ( (__param(3, IFileService))),
3631
- ( (__param(4, IWorkbenchEnvironmentService))),
3632
- ( (__param(5, IUriIdentityService)))
3633
- ], BrowserWorkspacesService)));
3634
- let AbstractWorkspaceEditingService = class AbstractWorkspaceEditingService {
3635
- constructor(jsonEditingService, contextService, configurationService, notificationService, commandService, fileService, textFileService, workspacesService, environmentService, fileDialogService, dialogService, hostService, uriIdentityService, workspaceTrustManagementService, userDataProfilesService, userDataProfileService) {
3636
- this.jsonEditingService = jsonEditingService;
3637
- this.contextService = contextService;
3638
- this.configurationService = configurationService;
3639
- this.notificationService = notificationService;
3640
- this.commandService = commandService;
3641
- this.fileService = fileService;
3642
- this.textFileService = textFileService;
3643
- this.workspacesService = workspacesService;
3644
- this.environmentService = environmentService;
3645
- this.fileDialogService = fileDialogService;
3646
- this.dialogService = dialogService;
3647
- this.hostService = hostService;
3648
- this.uriIdentityService = uriIdentityService;
3649
- this.workspaceTrustManagementService = workspaceTrustManagementService;
3650
- this.userDataProfilesService = userDataProfilesService;
3651
- this.userDataProfileService = userDataProfileService;
3652
- }
3653
- async pickNewWorkspacePath() {
3654
- const availableFileSystems = [Schemas.file];
3655
- if (this.environmentService.remoteAuthority) {
3656
- availableFileSystems.unshift(Schemas.vscodeRemote);
3657
- }
3658
- let workspacePath = await this.fileDialogService.showSaveDialog({
3659
- saveLabel: mnemonicButtonLabel(( (localize('save', "Save")))),
3660
- title: ( (localize('saveWorkspace', "Save Workspace"))),
3661
- filters: WORKSPACE_FILTER,
3662
- defaultUri: joinPath(await this.fileDialogService.defaultWorkspacePath(), this.getNewWorkspaceName()),
3663
- availableFileSystems
3664
- });
3665
- if (!workspacePath) {
3666
- return;
3667
- }
3668
- if (!hasWorkspaceFileExtension(workspacePath)) {
3669
- workspacePath = workspacePath.with({ path: `${workspacePath.path}.${WORKSPACE_EXTENSION}` });
3670
- }
3671
- return workspacePath;
3672
- }
3673
- getNewWorkspaceName() {
3674
- const configPathURI = this.getCurrentWorkspaceIdentifier()?.configPath;
3675
- if (configPathURI && isSavedWorkspace(configPathURI, this.environmentService)) {
3676
- return basename(configPathURI);
3677
- }
3678
- const folder = firstOrDefault(this.contextService.getWorkspace().folders);
3679
- if (folder) {
3680
- return `${basename(folder.uri)}.${WORKSPACE_EXTENSION}`;
3681
- }
3682
- return `workspace.${WORKSPACE_EXTENSION}`;
3683
- }
3684
- async updateFolders(index, deleteCount, foldersToAddCandidates, donotNotifyError) {
3685
- const folders = this.contextService.getWorkspace().folders;
3686
- let foldersToDelete = [];
3687
- if (typeof deleteCount === 'number') {
3688
- foldersToDelete = ( (folders.slice(index, index + deleteCount).map(folder => folder.uri)));
3689
- }
3690
- let foldersToAdd = [];
3691
- if (Array.isArray(foldersToAddCandidates)) {
3692
- foldersToAdd = ( (foldersToAddCandidates.map(
3693
- folderToAdd => ({ uri: removeTrailingPathSeparator(folderToAdd.uri), name: folderToAdd.name })
3694
- )));
3695
- }
3696
- const wantsToDelete = foldersToDelete.length > 0;
3697
- const wantsToAdd = foldersToAdd.length > 0;
3698
- if (!wantsToAdd && !wantsToDelete) {
3699
- return;
3700
- }
3701
- if (wantsToAdd && !wantsToDelete) {
3702
- return this.doAddFolders(foldersToAdd, index, donotNotifyError);
3703
- }
3704
- if (wantsToDelete && !wantsToAdd) {
3705
- return this.removeFolders(foldersToDelete);
3706
- }
3707
- else {
3708
- if (this.includesSingleFolderWorkspace(foldersToDelete)) {
3709
- return this.createAndEnterWorkspace(foldersToAdd);
3710
- }
3711
- if (this.contextService.getWorkbenchState() !== 3 ) {
3712
- return this.doAddFolders(foldersToAdd, index, donotNotifyError);
3713
- }
3714
- return this.doUpdateFolders(foldersToAdd, foldersToDelete, index, donotNotifyError);
3715
- }
3716
- }
3717
- async doUpdateFolders(foldersToAdd, foldersToDelete, index, donotNotifyError = false) {
3718
- try {
3719
- await this.contextService.updateFolders(foldersToAdd, foldersToDelete, index);
3720
- }
3721
- catch (error) {
3722
- if (donotNotifyError) {
3723
- throw error;
3724
- }
3725
- this.handleWorkspaceConfigurationEditingError(error);
3726
- }
3727
- }
3728
- addFolders(foldersToAddCandidates, donotNotifyError = false) {
3729
- const foldersToAdd = ( (foldersToAddCandidates.map(
3730
- folderToAdd => ({ uri: removeTrailingPathSeparator(folderToAdd.uri), name: folderToAdd.name })
3731
- )));
3732
- return this.doAddFolders(foldersToAdd, undefined, donotNotifyError);
3733
- }
3734
- async doAddFolders(foldersToAdd, index, donotNotifyError = false) {
3735
- const state = this.contextService.getWorkbenchState();
3736
- const remoteAuthority = this.environmentService.remoteAuthority;
3737
- if (remoteAuthority) {
3738
- foldersToAdd = foldersToAdd.filter(folder => folder.uri.scheme !== Schemas.file && (folder.uri.scheme !== Schemas.vscodeRemote || isEqualAuthority(folder.uri.authority, remoteAuthority)));
3739
- }
3740
- if (state !== 3 ) {
3741
- let newWorkspaceFolders = ( (this.contextService.getWorkspace().folders.map(folder => ({ uri: folder.uri }))));
3742
- newWorkspaceFolders.splice(typeof index === 'number' ? index : newWorkspaceFolders.length, 0, ...foldersToAdd);
3743
- newWorkspaceFolders = distinct(newWorkspaceFolders, folder => this.uriIdentityService.extUri.getComparisonKey(folder.uri));
3744
- if (state === 1 && newWorkspaceFolders.length === 0 || state === 2 && newWorkspaceFolders.length === 1) {
3745
- return;
3746
- }
3747
- return this.createAndEnterWorkspace(newWorkspaceFolders);
3748
- }
3749
- try {
3750
- await this.contextService.addFolders(foldersToAdd, index);
3751
- }
3752
- catch (error) {
3753
- if (donotNotifyError) {
3754
- throw error;
3755
- }
3756
- this.handleWorkspaceConfigurationEditingError(error);
3757
- }
3758
- }
3759
- async removeFolders(foldersToRemove, donotNotifyError = false) {
3760
- if (this.includesSingleFolderWorkspace(foldersToRemove)) {
3761
- return this.createAndEnterWorkspace([]);
3762
- }
3763
- try {
3764
- await this.contextService.removeFolders(foldersToRemove);
3765
- }
3766
- catch (error) {
3767
- if (donotNotifyError) {
3768
- throw error;
3769
- }
3770
- this.handleWorkspaceConfigurationEditingError(error);
3771
- }
3772
- }
3773
- includesSingleFolderWorkspace(folders) {
3774
- if (this.contextService.getWorkbenchState() === 2 ) {
3775
- const workspaceFolder = this.contextService.getWorkspace().folders[0];
3776
- return (folders.some(folder => this.uriIdentityService.extUri.isEqual(folder, workspaceFolder.uri)));
3777
- }
3778
- return false;
3779
- }
3780
- async createAndEnterWorkspace(folders, path) {
3781
- if (path && !(await this.isValidTargetWorkspacePath(path))) {
3782
- return;
3783
- }
3784
- const remoteAuthority = this.environmentService.remoteAuthority;
3785
- const untitledWorkspace = await this.workspacesService.createUntitledWorkspace(folders, remoteAuthority);
3786
- if (path) {
3787
- try {
3788
- await this.saveWorkspaceAs(untitledWorkspace, path);
3789
- }
3790
- finally {
3791
- await this.workspacesService.deleteUntitledWorkspace(untitledWorkspace);
3792
- }
3793
- }
3794
- else {
3795
- path = untitledWorkspace.configPath;
3796
- if (!this.userDataProfileService.currentProfile.isDefault) {
3797
- await this.userDataProfilesService.setProfileForWorkspace(untitledWorkspace, this.userDataProfileService.currentProfile);
3798
- }
3799
- }
3800
- return this.enterWorkspace(path);
3801
- }
3802
- async saveAndEnterWorkspace(workspaceUri) {
3803
- const workspaceIdentifier = this.getCurrentWorkspaceIdentifier();
3804
- if (!workspaceIdentifier) {
3805
- return;
3806
- }
3807
- if (isEqual(workspaceIdentifier.configPath, workspaceUri)) {
3808
- return this.saveWorkspace(workspaceIdentifier);
3809
- }
3810
- if (!(await this.isValidTargetWorkspacePath(workspaceUri))) {
3811
- return;
3812
- }
3813
- await this.saveWorkspaceAs(workspaceIdentifier, workspaceUri);
3814
- return this.enterWorkspace(workspaceUri);
3815
- }
3816
- async isValidTargetWorkspacePath(workspaceUri) {
3817
- return true;
3818
- }
3819
- async saveWorkspaceAs(workspace, targetConfigPathURI) {
3820
- const configPathURI = workspace.configPath;
3821
- const isNotUntitledWorkspace = !isUntitledWorkspace(targetConfigPathURI, this.environmentService);
3822
- if (isNotUntitledWorkspace && !this.userDataProfileService.currentProfile.isDefault) {
3823
- const newWorkspace = await this.workspacesService.getWorkspaceIdentifier(targetConfigPathURI);
3824
- await this.userDataProfilesService.setProfileForWorkspace(newWorkspace, this.userDataProfileService.currentProfile);
3825
- }
3826
- if (this.uriIdentityService.extUri.isEqual(configPathURI, targetConfigPathURI)) {
3827
- return;
3828
- }
3829
- const isFromUntitledWorkspace = isUntitledWorkspace(configPathURI, this.environmentService);
3830
- const raw = await this.fileService.readFile(configPathURI);
3831
- const newRawWorkspaceContents = rewriteWorkspaceFileForNewLocation(( (raw.value.toString())), configPathURI, isFromUntitledWorkspace, targetConfigPathURI, this.uriIdentityService.extUri);
3832
- await this.textFileService.create([{ resource: targetConfigPathURI, value: newRawWorkspaceContents, options: { overwrite: true } }]);
3833
- await this.trustWorkspaceConfiguration(targetConfigPathURI);
3834
- }
3835
- async saveWorkspace(workspace) {
3836
- const configPathURI = workspace.configPath;
3837
- const existingModel = this.textFileService.files.get(configPathURI);
3838
- if (existingModel) {
3839
- await existingModel.save({ force: true, reason: 1 });
3840
- return;
3841
- }
3842
- const workspaceFileExists = await this.fileService.exists(configPathURI);
3843
- if (workspaceFileExists) {
3844
- return;
3845
- }
3846
- const newWorkspace = { folders: [] };
3847
- const newRawWorkspaceContents = rewriteWorkspaceFileForNewLocation(JSON.stringify(newWorkspace, null, '\t'), configPathURI, false, configPathURI, this.uriIdentityService.extUri);
3848
- await this.textFileService.create([{ resource: configPathURI, value: newRawWorkspaceContents }]);
3849
- }
3850
- handleWorkspaceConfigurationEditingError(error) {
3851
- switch (error.code) {
3852
- case 0 :
3853
- this.onInvalidWorkspaceConfigurationFileError();
3854
- break;
3855
- default:
3856
- this.notificationService.error(error.message);
3857
- }
3858
- }
3859
- onInvalidWorkspaceConfigurationFileError() {
3860
- const message = ( (localize(
3861
- 'errorInvalidTaskConfiguration',
3862
- "Unable to write into workspace configuration file. Please open the file to correct errors/warnings in it and try again."
3863
- )));
3864
- this.askToOpenWorkspaceConfigurationFile(message);
3865
- }
3866
- askToOpenWorkspaceConfigurationFile(message) {
3867
- this.notificationService.prompt(Severity.Error, message, [{
3868
- label: ( (localize('openWorkspaceConfigurationFile', "Open Workspace Configuration"))),
3869
- run: () => this.commandService.executeCommand('workbench.action.openWorkspaceConfigFile')
3870
- }]);
3871
- }
3872
- async doEnterWorkspace(workspaceUri) {
3873
- if (!!this.environmentService.extensionTestsLocationURI) {
3874
- throw new Error('Entering a new workspace is not possible in tests.');
3875
- }
3876
- const workspace = await this.workspacesService.getWorkspaceIdentifier(workspaceUri);
3877
- if (this.contextService.getWorkbenchState() === 2 ) {
3878
- await this.migrateWorkspaceSettings(workspace);
3879
- }
3880
- await this.configurationService.initialize(workspace);
3881
- return this.workspacesService.enterWorkspace(workspaceUri);
3882
- }
3883
- migrateWorkspaceSettings(toWorkspace) {
3884
- return this.doCopyWorkspaceSettings(toWorkspace, setting => setting.scope === 3 );
3885
- }
3886
- copyWorkspaceSettings(toWorkspace) {
3887
- return this.doCopyWorkspaceSettings(toWorkspace);
3888
- }
3889
- doCopyWorkspaceSettings(toWorkspace, filter) {
3890
- const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
3891
- const targetWorkspaceConfiguration = {};
3892
- for (const key of ( (this.configurationService.keys())).workspace) {
3893
- if (configurationProperties[key]) {
3894
- if (filter && !filter(configurationProperties[key])) {
3895
- continue;
3896
- }
3897
- targetWorkspaceConfiguration[key] = this.configurationService.inspect(key).workspaceValue;
3898
- }
3899
- }
3900
- return this.jsonEditingService.write(toWorkspace.configPath, [{ path: ['settings'], value: targetWorkspaceConfiguration }], true);
3901
- }
3902
- async trustWorkspaceConfiguration(configPathURI) {
3903
- if (this.contextService.getWorkbenchState() !== 1 && this.workspaceTrustManagementService.isWorkspaceTrusted()) {
3904
- await this.workspaceTrustManagementService.setUrisTrust([configPathURI], true);
3905
- }
3906
- }
3907
- getCurrentWorkspaceIdentifier() {
3908
- const identifier = toWorkspaceIdentifier(this.contextService.getWorkspace());
3909
- if (isWorkspaceIdentifier(identifier)) {
3910
- return identifier;
3911
- }
3912
- return undefined;
3913
- }
3914
- };
3915
- AbstractWorkspaceEditingService = ( (__decorate([
3916
- ( (__param(0, IJSONEditingService))),
3917
- ( (__param(1, IWorkspaceContextService))),
3918
- ( (__param(2, IWorkbenchConfigurationService))),
3919
- ( (__param(3, INotificationService))),
3920
- ( (__param(4, ICommandService))),
3921
- ( (__param(5, IFileService))),
3922
- ( (__param(6, ITextFileService))),
3923
- ( (__param(7, IWorkspacesService))),
3924
- ( (__param(8, IWorkbenchEnvironmentService))),
3925
- ( (__param(9, IFileDialogService))),
3926
- ( (__param(10, IDialogService))),
3927
- ( (__param(11, IHostService))),
3928
- ( (__param(12, IUriIdentityService))),
3929
- ( (__param(13, IWorkspaceTrustManagementService))),
3930
- ( (__param(14, IUserDataProfilesService))),
3931
- ( (__param(15, IUserDataProfileService)))
3932
- ], AbstractWorkspaceEditingService)));
3933
- const jsonRegistry = ( (Registry.as(Extensions$1.JSONContribution)));
3934
- const configurationRegistry$1 = ( (Registry.as(Extensions.Configuration)));
3935
- const configurationEntrySchema = {
3936
- type: 'object',
3937
- defaultSnippets: [{ body: { title: '', properties: {} } }],
3938
- properties: {
3939
- title: {
3940
- description: ( (localize(
3941
- 'vscode.extension.contributes.configuration.title',
3942
- 'A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading.'
3943
- ))),
3944
- type: 'string'
3945
- },
3946
- order: {
3947
- description: ( (localize(
3948
- 'vscode.extension.contributes.configuration.order',
3949
- 'When specified, gives the order of this category of settings relative to other categories.'
3950
- ))),
3951
- type: 'integer'
3952
- },
3953
- properties: {
3954
- description: ( (localize(
3955
- 'vscode.extension.contributes.configuration.properties',
3956
- 'Description of the configuration properties.'
3957
- ))),
3958
- type: 'object',
3959
- propertyNames: {
3960
- pattern: '\\S+',
3961
- patternErrorMessage: ( (localize(
3962
- 'vscode.extension.contributes.configuration.property.empty',
3963
- 'Property should not be empty.'
3964
- ))),
3965
- },
3966
- additionalProperties: {
3967
- anyOf: [
3968
- {
3969
- title: ( (localize(
3970
- 'vscode.extension.contributes.configuration.properties.schema',
3971
- 'Schema of the configuration property.'
3972
- ))),
3973
- $ref: 'http://json-schema.org/draft-07/schema#'
3974
- },
3975
- {
3976
- type: 'object',
3977
- properties: {
3978
- scope: {
3979
- type: 'string',
3980
- enum: ['application', 'machine', 'window', 'resource', 'language-overridable', 'machine-overridable'],
3981
- default: 'window',
3982
- enumDescriptions: [
3983
- ( (localize(
3984
- 'scope.application.description',
3985
- "Configuration that can be configured only in the user settings."
3986
- ))),
3987
- ( (localize(
3988
- 'scope.machine.description',
3989
- "Configuration that can be configured only in the user settings or only in the remote settings."
3990
- ))),
3991
- ( (localize(
3992
- 'scope.window.description',
3993
- "Configuration that can be configured in the user, remote or workspace settings."
3994
- ))),
3995
- ( (localize(
3996
- 'scope.resource.description',
3997
- "Configuration that can be configured in the user, remote, workspace or folder settings."
3998
- ))),
3999
- ( (localize(
4000
- 'scope.language-overridable.description',
4001
- "Resource configuration that can be configured in language specific settings."
4002
- ))),
4003
- ( (localize(
4004
- 'scope.machine-overridable.description',
4005
- "Machine configuration that can be configured also in workspace or folder settings."
4006
- )))
4007
- ],
4008
- markdownDescription: ( (localize(
4009
- 'scope.description',
4010
- "Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`."
4011
- )))
4012
- },
4013
- enumDescriptions: {
4014
- type: 'array',
4015
- items: {
4016
- type: 'string',
4017
- },
4018
- description: ( (localize('scope.enumDescriptions', 'Descriptions for enum values')))
4019
- },
4020
- markdownEnumDescriptions: {
4021
- type: 'array',
4022
- items: {
4023
- type: 'string',
4024
- },
4025
- description: ( (localize(
4026
- 'scope.markdownEnumDescriptions',
4027
- 'Descriptions for enum values in the markdown format.'
4028
- )))
4029
- },
4030
- enumItemLabels: {
4031
- type: 'array',
4032
- items: {
4033
- type: 'string'
4034
- },
4035
- markdownDescription: ( (localize(
4036
- 'scope.enumItemLabels',
4037
- 'Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.',
4038
- '`enum`'
4039
- )))
4040
- },
4041
- markdownDescription: {
4042
- type: 'string',
4043
- description: ( (localize('scope.markdownDescription', 'The description in the markdown format.')))
4044
- },
4045
- deprecationMessage: {
4046
- type: 'string',
4047
- description: ( (localize(
4048
- 'scope.deprecationMessage',
4049
- 'If set, the property is marked as deprecated and the given message is shown as an explanation.'
4050
- )))
4051
- },
4052
- markdownDeprecationMessage: {
4053
- type: 'string',
4054
- description: ( (localize(
4055
- 'scope.markdownDeprecationMessage',
4056
- 'If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format.'
4057
- )))
4058
- },
4059
- editPresentation: {
4060
- type: 'string',
4061
- enum: ['singlelineText', 'multilineText'],
4062
- enumDescriptions: [
4063
- ( (localize(
4064
- 'scope.singlelineText.description',
4065
- 'The value will be shown in an inputbox.'
4066
- ))),
4067
- ( (localize(
4068
- 'scope.multilineText.description',
4069
- 'The value will be shown in a textarea.'
4070
- )))
4071
- ],
4072
- default: 'singlelineText',
4073
- description: ( (localize(
4074
- 'scope.editPresentation',
4075
- 'When specified, controls the presentation format of the string setting.'
4076
- )))
4077
- },
4078
- order: {
4079
- type: 'integer',
4080
- description: ( (localize(
4081
- 'scope.order',
4082
- 'When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set.'
4083
- )))
4084
- },
4085
- ignoreSync: {
4086
- type: 'boolean',
4087
- description: ( (localize(
4088
- 'scope.ignoreSync',
4089
- 'When enabled, Settings Sync will not sync the user value of this configuration by default.'
4090
- )))
4091
- },
4092
- }
4093
- }
4094
- ]
4095
- }
4096
- }
4097
- }
4098
- };
4099
- let _configDelta;
4100
- const defaultConfigurationExtPoint = ( (ExtensionsRegistry.registerExtensionPoint({
4101
- extensionPoint: 'configurationDefaults',
4102
- jsonSchema: {
4103
- $ref: configurationDefaultsSchemaId,
4104
- }
4105
- })));
4106
- defaultConfigurationExtPoint.setHandler((extensions, { added, removed }) => {
4107
- if (_configDelta) {
4108
- configurationRegistry$1.deltaConfiguration(_configDelta);
4109
- }
4110
- const configNow = _configDelta = {};
4111
- queueMicrotask(() => {
4112
- if (_configDelta === configNow) {
4113
- configurationRegistry$1.deltaConfiguration(_configDelta);
4114
- _configDelta = undefined;
4115
- }
4116
- });
4117
- if (removed.length) {
4118
- const removedDefaultConfigurations = ( (removed.map(
4119
- extension => ({ overrides: deepClone(extension.value), source: { id: extension.description.identifier.value, displayName: extension.description.displayName } })
4120
- )));
4121
- _configDelta.removedDefaults = removedDefaultConfigurations;
4122
- }
4123
- if (added.length) {
4124
- const registeredProperties = configurationRegistry$1.getConfigurationProperties();
4125
- const allowedScopes = [6 , 3 , 4 , 5 ];
4126
- const addedDefaultConfigurations = ( (added.map(extension => {
4127
- const overrides = deepClone(extension.value);
4128
- for (const key of ( (Object.keys(overrides)))) {
4129
- if (!OVERRIDE_PROPERTY_REGEX.test(key)) {
4130
- const registeredPropertyScheme = registeredProperties[key];
4131
- if (registeredPropertyScheme?.scope && !allowedScopes.includes(registeredPropertyScheme.scope)) {
4132
- extension.collector.warn(( (localize(
4133
- 'config.property.defaultConfiguration.warning',
4134
- "Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",
4135
- key
4136
- ))));
4137
- delete overrides[key];
4138
- }
4139
- }
4140
- }
4141
- return { overrides, source: { id: extension.description.identifier.value, displayName: extension.description.displayName } };
4142
- })));
4143
- _configDelta.addedDefaults = addedDefaultConfigurations;
4144
- }
4145
- });
4146
- const configurationExtPoint = ( (ExtensionsRegistry.registerExtensionPoint({
4147
- extensionPoint: 'configuration',
4148
- deps: [defaultConfigurationExtPoint],
4149
- jsonSchema: {
4150
- description: ( (localize(
4151
- 'vscode.extension.contributes.configuration',
4152
- 'Contributes configuration settings.'
4153
- ))),
4154
- oneOf: [
4155
- configurationEntrySchema,
4156
- {
4157
- type: 'array',
4158
- items: configurationEntrySchema
4159
- }
4160
- ]
4161
- }
4162
- })));
4163
- const extensionConfigurations = ( (new ExtensionIdentifierMap()));
4164
- configurationExtPoint.setHandler((extensions, { added, removed }) => {
4165
- _configDelta ??= {};
4166
- if (removed.length) {
4167
- const removedConfigurations = [];
4168
- for (const extension of removed) {
4169
- removedConfigurations.push(...(extensionConfigurations.get(extension.description.identifier) || []));
4170
- extensionConfigurations.delete(extension.description.identifier);
4171
- }
4172
- _configDelta.removedConfigurations = removedConfigurations;
4173
- }
4174
- const seenProperties = ( (new Set()));
4175
- function handleConfiguration(node, extension) {
4176
- const configurations = [];
4177
- const configuration = deepClone(node);
4178
- if (configuration.title && (typeof configuration.title !== 'string')) {
4179
- extension.collector.error(( (localize('invalid.title', "'configuration.title' must be a string"))));
4180
- }
4181
- validateProperties(configuration, extension);
4182
- configuration.id = node.id || extension.description.identifier.value;
4183
- configuration.extensionInfo = { id: extension.description.identifier.value, displayName: extension.description.displayName };
4184
- configuration.restrictedProperties = extension.description.capabilities?.untrustedWorkspaces?.supported === 'limited' ? extension.description.capabilities?.untrustedWorkspaces.restrictedConfigurations : undefined;
4185
- configuration.title = configuration.title || extension.description.displayName || extension.description.identifier.value;
4186
- configurations.push(configuration);
4187
- return configurations;
4188
- }
4189
- function validateProperties(configuration, extension) {
4190
- const properties = configuration.properties;
4191
- if (properties) {
4192
- if (typeof properties !== 'object') {
4193
- extension.collector.error(( (localize('invalid.properties', "'configuration.properties' must be an object"))));
4194
- configuration.properties = {};
4195
- }
4196
- for (const key in properties) {
4197
- const propertyConfiguration = properties[key];
4198
- const message = validateProperty(key, propertyConfiguration);
4199
- if (message) {
4200
- delete properties[key];
4201
- extension.collector.warn(message);
4202
- continue;
4203
- }
4204
- if (seenProperties.has(key)) {
4205
- delete properties[key];
4206
- extension.collector.warn(( (localize(
4207
- 'config.property.duplicate',
4208
- "Cannot register '{0}'. This property is already registered.",
4209
- key
4210
- ))));
4211
- continue;
4212
- }
4213
- if (!isObject(propertyConfiguration)) {
4214
- delete properties[key];
4215
- extension.collector.error(( (localize(
4216
- 'invalid.property',
4217
- "configuration.properties property '{0}' must be an object",
4218
- key
4219
- ))));
4220
- continue;
4221
- }
4222
- seenProperties.add(key);
4223
- if (propertyConfiguration.scope) {
4224
- if (( (propertyConfiguration.scope.toString())) === 'application') {
4225
- propertyConfiguration.scope = 1 ;
4226
- }
4227
- else if (( (propertyConfiguration.scope.toString())) === 'machine') {
4228
- propertyConfiguration.scope = 2 ;
4229
- }
4230
- else if (( (propertyConfiguration.scope.toString())) === 'resource') {
4231
- propertyConfiguration.scope = 4 ;
4232
- }
4233
- else if (( (propertyConfiguration.scope.toString())) === 'machine-overridable') {
4234
- propertyConfiguration.scope = 6 ;
4235
- }
4236
- else if (( (propertyConfiguration.scope.toString())) === 'language-overridable') {
4237
- propertyConfiguration.scope = 5 ;
4238
- }
4239
- else {
4240
- propertyConfiguration.scope = 3 ;
4241
- }
4242
- }
4243
- else {
4244
- propertyConfiguration.scope = 3 ;
4245
- }
4246
- }
4247
- }
4248
- const subNodes = configuration.allOf;
4249
- if (subNodes) {
4250
- extension.collector.error(( (localize(
4251
- 'invalid.allOf',
4252
- "'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."
4253
- ))));
4254
- for (const node of subNodes) {
4255
- validateProperties(node, extension);
4256
- }
4257
- }
4258
- }
4259
- if (added.length) {
4260
- const addedConfigurations = [];
4261
- for (const extension of added) {
4262
- const configurations = [];
4263
- const value = extension.value;
4264
- if (Array.isArray(value)) {
4265
- value.forEach(v => configurations.push(...handleConfiguration(v, extension)));
4266
- }
4267
- else {
4268
- configurations.push(...handleConfiguration(value, extension));
4269
- }
4270
- extensionConfigurations.set(extension.description.identifier, configurations);
4271
- addedConfigurations.push(...configurations);
4272
- }
4273
- _configDelta.addedConfigurations = addedConfigurations;
4274
- }
4275
- configurationRegistry$1.deltaConfiguration(_configDelta);
4276
- _configDelta = undefined;
4277
- });
4278
- jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
4279
- allowComments: true,
4280
- allowTrailingCommas: true,
4281
- default: {
4282
- folders: [
4283
- {
4284
- path: ''
4285
- }
4286
- ],
4287
- settings: {}
4288
- },
4289
- required: ['folders'],
4290
- properties: {
4291
- 'folders': {
4292
- minItems: 0,
4293
- uniqueItems: true,
4294
- description: ( (localize(
4295
- 'workspaceConfig.folders.description',
4296
- "List of folders to be loaded in the workspace."
4297
- ))),
4298
- items: {
4299
- type: 'object',
4300
- defaultSnippets: [{ body: { path: '$1' } }],
4301
- oneOf: [{
4302
- properties: {
4303
- path: {
4304
- type: 'string',
4305
- description: ( (localize(
4306
- 'workspaceConfig.path.description',
4307
- "A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file."
4308
- )))
4309
- },
4310
- name: {
4311
- type: 'string',
4312
- description: ( (localize('workspaceConfig.name.description', "An optional name for the folder. ")))
4313
- }
4314
- },
4315
- required: ['path']
4316
- }, {
4317
- properties: {
4318
- uri: {
4319
- type: 'string',
4320
- description: ( (localize('workspaceConfig.uri.description', "URI of the folder")))
4321
- },
4322
- name: {
4323
- type: 'string',
4324
- description: ( (localize('workspaceConfig.name.description', "An optional name for the folder. ")))
4325
- }
4326
- },
4327
- required: ['uri']
4328
- }]
4329
- }
4330
- },
4331
- 'settings': {
4332
- type: 'object',
4333
- default: {},
4334
- description: ( (localize('workspaceConfig.settings.description', "Workspace settings"))),
4335
- $ref: workspaceSettingsSchemaId
4336
- },
4337
- 'launch': {
4338
- type: 'object',
4339
- default: { configurations: [], compounds: [] },
4340
- description: ( (localize('workspaceConfig.launch.description', "Workspace launch configurations"))),
4341
- $ref: launchSchemaId
4342
- },
4343
- 'tasks': {
4344
- type: 'object',
4345
- default: { version: '2.0.0', tasks: [] },
4346
- description: ( (localize('workspaceConfig.tasks.description', "Workspace task configurations"))),
4347
- $ref: tasksSchemaId
4348
- },
4349
- 'extensions': {
4350
- type: 'object',
4351
- default: {},
4352
- description: ( (localize('workspaceConfig.extensions.description', "Workspace extensions"))),
4353
- $ref: 'vscode://schemas/extensions'
4354
- },
4355
- 'remoteAuthority': {
4356
- type: 'string',
4357
- doNotSuggest: true,
4358
- description: ( (localize(
4359
- 'workspaceConfig.remoteAuthority',
4360
- "The remote server where the workspace is located."
4361
- ))),
4362
- },
4363
- 'transient': {
4364
- type: 'boolean',
4365
- doNotSuggest: true,
4366
- description: ( (localize(
4367
- 'workspaceConfig.transient',
4368
- "A transient workspace will disappear when restarting or reloading."
4369
- ))),
4370
- }
4371
- },
4372
- errorMessage: ( (localize('unknownWorkspaceProperty', "Unknown workspace configuration property")))
4373
- });
4374
- async function updateUserConfiguration(configurationJson) {
4375
- const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
4376
- await StandaloneServices.get(IFileService).writeFile(userDataProfilesService.defaultProfile.settingsResource, VSBuffer.fromString(configurationJson));
4377
- }
4378
- async function getUserConfiguration() {
4379
- const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
4380
- return ( (await StandaloneServices.get(IFileService).readFile(userDataProfilesService.defaultProfile.settingsResource)).value.toString());
4381
- }
4382
- function onUserConfigurationChange(callback) {
4383
- const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
4384
- return StandaloneServices.get(IFileService).onDidFilesChange(e => {
4385
- if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) {
4386
- callback();
4387
- }
4388
- });
4389
- }
4390
- const configurationRegistry = ( Registry.as(Extensions.Configuration));
4391
- let InjectedConfigurationService = class InjectedConfigurationService extends WorkspaceService {
4392
- constructor(workbenchEnvironmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, policyService) {
4393
- const configurationCache = new ConfigurationCache([Schemas.file, Schemas.vscodeUserData, Schemas.tmp], workbenchEnvironmentService, fileService);
4394
- super({ configurationCache }, workbenchEnvironmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, policyService);
4395
- }
4396
- };
4397
- InjectedConfigurationService = __decorate([
4398
- ( __param(0, IWorkbenchEnvironmentService)),
4399
- ( __param(1, IUserDataProfileService)),
4400
- ( __param(2, IUserDataProfilesService)),
4401
- ( __param(3, IFileService)),
4402
- ( __param(4, IRemoteAgentService)),
4403
- ( __param(5, IUriIdentityService)),
4404
- ( __param(6, ILogService)),
4405
- ( __param(7, IPolicyService))
4406
- ], InjectedConfigurationService);
4407
- class MonacoWorkspaceEditingService extends AbstractWorkspaceEditingService {
4408
- async enterWorkspace() {
4409
- }
4410
- }
4411
- let _defaultWorkspaceUri = URI.file('/workspace');
4412
- registerServiceInitializeParticipant(async (accessor) => {
4413
- const workspaceService = accessor.get(IWorkspaceContextService);
4414
- workspaceService.acquireInstantiationService(accessor.get(IInstantiationService));
4415
- try {
4416
- await accessor.get(IFileService).createFolder(_defaultWorkspaceUri);
4417
- }
4418
- catch (err) {
4419
- }
4420
- await workspaceService.initialize({
4421
- id: generateUuid(),
4422
- uri: _defaultWorkspaceUri
4423
- });
4424
- });
4425
- const MemoizedInjectedConfigurationService = memoizedConstructor(InjectedConfigurationService);
4426
- function getServiceOverride(defaultWorkspaceUri) {
4427
- _defaultWorkspaceUri = defaultWorkspaceUri;
4428
- return {
4429
- ...getServiceOverride$1(),
4430
- [( ILabelService.toString())]: new SyncDescriptor(LabelService, undefined, true),
4431
- [( IConfigurationService.toString())]: new SyncDescriptor(MemoizedInjectedConfigurationService),
4432
- [( IWorkspaceContextService.toString())]: new SyncDescriptor(MemoizedInjectedConfigurationService),
4433
- [( ITextResourceConfigurationService.toString())]: new SyncDescriptor(TextResourceConfigurationService),
4434
- [( IWorkspaceEditingService.toString())]: new SyncDescriptor(MonacoWorkspaceEditingService),
4435
- [( IWorkspacesService.toString())]: new SyncDescriptor(BrowserWorkspacesService, undefined, true)
4436
- };
4437
- }
4438
- export { configurationRegistry, getServiceOverride as default, getUserConfiguration, onUserConfigurationChange, updateUserConfiguration };