@opensumi/ide-editor 2.12.1-next-079c1930

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 (298) hide show
  1. package/README.md +565 -0
  2. package/lib/browser/breadcrumb/default.d.ts +28 -0
  3. package/lib/browser/breadcrumb/default.d.ts.map +1 -0
  4. package/lib/browser/breadcrumb/default.js +283 -0
  5. package/lib/browser/breadcrumb/default.js.map +1 -0
  6. package/lib/browser/breadcrumb/document-symbol.d.ts +36 -0
  7. package/lib/browser/breadcrumb/document-symbol.d.ts.map +1 -0
  8. package/lib/browser/breadcrumb/document-symbol.js +161 -0
  9. package/lib/browser/breadcrumb/document-symbol.js.map +1 -0
  10. package/lib/browser/breadcrumb/index.d.ts +20 -0
  11. package/lib/browser/breadcrumb/index.d.ts.map +1 -0
  12. package/lib/browser/breadcrumb/index.js +90 -0
  13. package/lib/browser/breadcrumb/index.js.map +1 -0
  14. package/lib/browser/component/scroll/scroll.d.ts +66 -0
  15. package/lib/browser/component/scroll/scroll.d.ts.map +1 -0
  16. package/lib/browser/component/scroll/scroll.js +263 -0
  17. package/lib/browser/component/scroll/scroll.js.map +1 -0
  18. package/lib/browser/component/scroll/scroll.module.less +83 -0
  19. package/lib/browser/component.d.ts +23 -0
  20. package/lib/browser/component.d.ts.map +1 -0
  21. package/lib/browser/component.js +165 -0
  22. package/lib/browser/component.js.map +1 -0
  23. package/lib/browser/decoration-applier.d.ts +25 -0
  24. package/lib/browser/decoration-applier.d.ts.map +1 -0
  25. package/lib/browser/decoration-applier.js +224 -0
  26. package/lib/browser/decoration-applier.js.map +1 -0
  27. package/lib/browser/diff/compare.d.ts +14 -0
  28. package/lib/browser/diff/compare.d.ts.map +1 -0
  29. package/lib/browser/diff/compare.js +94 -0
  30. package/lib/browser/diff/compare.js.map +1 -0
  31. package/lib/browser/diff/index.d.ts +19 -0
  32. package/lib/browser/diff/index.d.ts.map +1 -0
  33. package/lib/browser/diff/index.js +92 -0
  34. package/lib/browser/diff/index.js.map +1 -0
  35. package/lib/browser/doc-cache/empty-doc-cache.d.ts +12 -0
  36. package/lib/browser/doc-cache/empty-doc-cache.d.ts.map +1 -0
  37. package/lib/browser/doc-cache/empty-doc-cache.js +27 -0
  38. package/lib/browser/doc-cache/empty-doc-cache.js.map +1 -0
  39. package/lib/browser/doc-cache/index.d.ts +3 -0
  40. package/lib/browser/doc-cache/index.d.ts.map +1 -0
  41. package/lib/browser/doc-cache/index.js +6 -0
  42. package/lib/browser/doc-cache/index.js.map +1 -0
  43. package/lib/browser/doc-cache/local-storage-cache.d.ts +32 -0
  44. package/lib/browser/doc-cache/local-storage-cache.d.ts.map +1 -0
  45. package/lib/browser/doc-cache/local-storage-cache.js +69 -0
  46. package/lib/browser/doc-cache/local-storage-cache.js.map +1 -0
  47. package/lib/browser/doc-model/editor-document-error.d.ts +7 -0
  48. package/lib/browser/doc-model/editor-document-error.d.ts.map +1 -0
  49. package/lib/browser/doc-model/editor-document-error.js +15 -0
  50. package/lib/browser/doc-model/editor-document-error.js.map +1 -0
  51. package/lib/browser/doc-model/editor-document-model-service.d.ts +40 -0
  52. package/lib/browser/doc-model/editor-document-model-service.d.ts.map +1 -0
  53. package/lib/browser/doc-model/editor-document-model-service.js +276 -0
  54. package/lib/browser/doc-model/editor-document-model-service.js.map +1 -0
  55. package/lib/browser/doc-model/editor-document-model.d.ts +85 -0
  56. package/lib/browser/doc-model/editor-document-model.d.ts.map +1 -0
  57. package/lib/browser/doc-model/editor-document-model.js +463 -0
  58. package/lib/browser/doc-model/editor-document-model.js.map +1 -0
  59. package/lib/browser/doc-model/editor-document-registry.d.ts +15 -0
  60. package/lib/browser/doc-model/editor-document-registry.d.ts.map +1 -0
  61. package/lib/browser/doc-model/editor-document-registry.js +110 -0
  62. package/lib/browser/doc-model/editor-document-registry.js.map +1 -0
  63. package/lib/browser/doc-model/editor-is-fn.d.ts +4 -0
  64. package/lib/browser/doc-model/editor-is-fn.d.ts.map +1 -0
  65. package/lib/browser/doc-model/editor-is-fn.js +12 -0
  66. package/lib/browser/doc-model/editor-is-fn.js.map +1 -0
  67. package/lib/browser/doc-model/main.d.ts +5 -0
  68. package/lib/browser/doc-model/main.d.ts.map +1 -0
  69. package/lib/browser/doc-model/main.js +8 -0
  70. package/lib/browser/doc-model/main.js.map +1 -0
  71. package/lib/browser/doc-model/override.d.ts +12 -0
  72. package/lib/browser/doc-model/override.d.ts.map +1 -0
  73. package/lib/browser/doc-model/override.js +46 -0
  74. package/lib/browser/doc-model/override.js.map +1 -0
  75. package/lib/browser/doc-model/save-task.d.ts +19 -0
  76. package/lib/browser/doc-model/save-task.d.ts.map +1 -0
  77. package/lib/browser/doc-model/save-task.js +34 -0
  78. package/lib/browser/doc-model/save-task.js.map +1 -0
  79. package/lib/browser/doc-model/saveParticipants.d.ts +21 -0
  80. package/lib/browser/doc-model/saveParticipants.d.ts.map +1 -0
  81. package/lib/browser/doc-model/saveParticipants.js +133 -0
  82. package/lib/browser/doc-model/saveParticipants.js.map +1 -0
  83. package/lib/browser/doc-model/types.d.ts +253 -0
  84. package/lib/browser/doc-model/types.d.ts.map +1 -0
  85. package/lib/browser/doc-model/types.js +31 -0
  86. package/lib/browser/doc-model/types.js.map +1 -0
  87. package/lib/browser/editor-collection.service.d.ts +137 -0
  88. package/lib/browser/editor-collection.service.d.ts.map +1 -0
  89. package/lib/browser/editor-collection.service.js +607 -0
  90. package/lib/browser/editor-collection.service.js.map +1 -0
  91. package/lib/browser/editor-opener.d.ts +10 -0
  92. package/lib/browser/editor-opener.d.ts.map +1 -0
  93. package/lib/browser/editor-opener.js +51 -0
  94. package/lib/browser/editor-opener.js.map +1 -0
  95. package/lib/browser/editor.contribution.d.ts +54 -0
  96. package/lib/browser/editor.contribution.d.ts.map +1 -0
  97. package/lib/browser/editor.contribution.js +1059 -0
  98. package/lib/browser/editor.contribution.js.map +1 -0
  99. package/lib/browser/editor.decoration.service.d.ts +28 -0
  100. package/lib/browser/editor.decoration.service.d.ts.map +1 -0
  101. package/lib/browser/editor.decoration.service.js +216 -0
  102. package/lib/browser/editor.decoration.service.js.map +1 -0
  103. package/lib/browser/editor.less +4 -0
  104. package/lib/browser/editor.module.less +493 -0
  105. package/lib/browser/editor.override.d.ts +24 -0
  106. package/lib/browser/editor.override.d.ts.map +1 -0
  107. package/lib/browser/editor.override.js +85 -0
  108. package/lib/browser/editor.override.js.map +1 -0
  109. package/lib/browser/editor.status-bar.service.d.ts +12 -0
  110. package/lib/browser/editor.status-bar.service.d.ts.map +1 -0
  111. package/lib/browser/editor.status-bar.service.js +114 -0
  112. package/lib/browser/editor.status-bar.service.js.map +1 -0
  113. package/lib/browser/editor.view.d.ts +33 -0
  114. package/lib/browser/editor.view.d.ts.map +1 -0
  115. package/lib/browser/editor.view.js +411 -0
  116. package/lib/browser/editor.view.js.map +1 -0
  117. package/lib/browser/error.d.ts +14 -0
  118. package/lib/browser/error.d.ts.map +1 -0
  119. package/lib/browser/error.js +19 -0
  120. package/lib/browser/error.js.map +1 -0
  121. package/lib/browser/feature.d.ts +14 -0
  122. package/lib/browser/feature.d.ts.map +1 -0
  123. package/lib/browser/feature.js +56 -0
  124. package/lib/browser/feature.js.map +1 -0
  125. package/lib/browser/format/formatterSelect.d.ts +11 -0
  126. package/lib/browser/format/formatterSelect.d.ts.map +1 -0
  127. package/lib/browser/format/formatterSelect.js +61 -0
  128. package/lib/browser/format/formatterSelect.js.map +1 -0
  129. package/lib/browser/fs-resource/file-tree-set.d.ts +31 -0
  130. package/lib/browser/fs-resource/file-tree-set.d.ts.map +1 -0
  131. package/lib/browser/fs-resource/file-tree-set.js +123 -0
  132. package/lib/browser/fs-resource/file-tree-set.js.map +1 -0
  133. package/lib/browser/fs-resource/fs-editor-doc.d.ts +47 -0
  134. package/lib/browser/fs-resource/fs-editor-doc.d.ts.map +1 -0
  135. package/lib/browser/fs-resource/fs-editor-doc.js +148 -0
  136. package/lib/browser/fs-resource/fs-editor-doc.js.map +1 -0
  137. package/lib/browser/fs-resource/fs-resource.d.ts +25 -0
  138. package/lib/browser/fs-resource/fs-resource.d.ts.map +1 -0
  139. package/lib/browser/fs-resource/fs-resource.js +211 -0
  140. package/lib/browser/fs-resource/fs-resource.js.map +1 -0
  141. package/lib/browser/fs-resource/index.d.ts +12 -0
  142. package/lib/browser/fs-resource/index.d.ts.map +1 -0
  143. package/lib/browser/fs-resource/index.js +30 -0
  144. package/lib/browser/fs-resource/index.js.map +1 -0
  145. package/lib/browser/grid/grid.service.d.ts +44 -0
  146. package/lib/browser/grid/grid.service.d.ts.map +1 -0
  147. package/lib/browser/grid/grid.service.js +255 -0
  148. package/lib/browser/grid/grid.service.js.map +1 -0
  149. package/lib/browser/history/index.d.ts +31 -0
  150. package/lib/browser/history/index.d.ts.map +1 -0
  151. package/lib/browser/history/index.js +164 -0
  152. package/lib/browser/history/index.js.map +1 -0
  153. package/lib/browser/index.d.ts +33 -0
  154. package/lib/browser/index.d.ts.map +1 -0
  155. package/lib/browser/index.js +212 -0
  156. package/lib/browser/index.js.map +1 -0
  157. package/lib/browser/language/diagnostic-collection.d.ts +28 -0
  158. package/lib/browser/language/diagnostic-collection.d.ts.map +1 -0
  159. package/lib/browser/language/diagnostic-collection.js +72 -0
  160. package/lib/browser/language/diagnostic-collection.js.map +1 -0
  161. package/lib/browser/language/language.service.d.ts +19 -0
  162. package/lib/browser/language/language.service.d.ts.map +1 -0
  163. package/lib/browser/language/language.service.js +146 -0
  164. package/lib/browser/language/language.service.js.map +1 -0
  165. package/lib/browser/language/workspace-symbol-quickopen.d.ts +43 -0
  166. package/lib/browser/language/workspace-symbol-quickopen.d.ts.map +1 -0
  167. package/lib/browser/language/workspace-symbol-quickopen.js +231 -0
  168. package/lib/browser/language/workspace-symbol-quickopen.js.map +1 -0
  169. package/lib/browser/menu/editor.context.d.ts +20 -0
  170. package/lib/browser/menu/editor.context.d.ts.map +1 -0
  171. package/lib/browser/menu/editor.context.js +139 -0
  172. package/lib/browser/menu/editor.context.js.map +1 -0
  173. package/lib/browser/menu/editor.menu.d.ts +13 -0
  174. package/lib/browser/menu/editor.menu.d.ts.map +1 -0
  175. package/lib/browser/menu/editor.menu.js +48 -0
  176. package/lib/browser/menu/editor.menu.js.map +1 -0
  177. package/lib/browser/menu/title-context.menu.d.ts +13 -0
  178. package/lib/browser/menu/title-context.menu.d.ts.map +1 -0
  179. package/lib/browser/menu/title-context.menu.js +55 -0
  180. package/lib/browser/menu/title-context.menu.js.map +1 -0
  181. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.contribution.d.ts +20 -0
  182. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.contribution.d.ts.map +1 -0
  183. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.contribution.js +64 -0
  184. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.contribution.js.map +1 -0
  185. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.service.d.ts +35 -0
  186. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.service.d.ts.map +1 -0
  187. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.service.js +144 -0
  188. package/lib/browser/monaco-contrib/callHierarchy/callHierarchy.service.js.map +1 -0
  189. package/lib/browser/monaco-contrib/command/command.service.d.ts +141 -0
  190. package/lib/browser/monaco-contrib/command/command.service.d.ts.map +1 -0
  191. package/lib/browser/monaco-contrib/command/command.service.js +370 -0
  192. package/lib/browser/monaco-contrib/command/command.service.js.map +1 -0
  193. package/lib/browser/monaco-contrib/index.d.ts +3 -0
  194. package/lib/browser/monaco-contrib/index.d.ts.map +1 -0
  195. package/lib/browser/monaco-contrib/index.js +6 -0
  196. package/lib/browser/monaco-contrib/index.js.map +1 -0
  197. package/lib/browser/monaco-contrib/tokenizer/textmate-registry.d.ts +46 -0
  198. package/lib/browser/monaco-contrib/tokenizer/textmate-registry.d.ts.map +1 -0
  199. package/lib/browser/monaco-contrib/tokenizer/textmate-registry.js +79 -0
  200. package/lib/browser/monaco-contrib/tokenizer/textmate-registry.js.map +1 -0
  201. package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.d.ts +58 -0
  202. package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.d.ts.map +1 -0
  203. package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.js +75 -0
  204. package/lib/browser/monaco-contrib/tokenizer/textmate-tokenizer.js.map +1 -0
  205. package/lib/browser/monaco-contrib/tokenizer/textmate.service.d.ts +54 -0
  206. package/lib/browser/monaco-contrib/tokenizer/textmate.service.d.ts.map +1 -0
  207. package/lib/browser/monaco-contrib/tokenizer/textmate.service.js +596 -0
  208. package/lib/browser/monaco-contrib/tokenizer/textmate.service.js.map +1 -0
  209. package/lib/browser/navigation.module.less +86 -0
  210. package/lib/browser/navigation.view.d.ts +29 -0
  211. package/lib/browser/navigation.view.d.ts.map +1 -0
  212. package/lib/browser/navigation.view.js +183 -0
  213. package/lib/browser/navigation.view.js.map +1 -0
  214. package/lib/browser/preference/contribution.d.ts +5 -0
  215. package/lib/browser/preference/contribution.d.ts.map +1 -0
  216. package/lib/browser/preference/contribution.js +16 -0
  217. package/lib/browser/preference/contribution.js.map +1 -0
  218. package/lib/browser/preference/converter.d.ts +34 -0
  219. package/lib/browser/preference/converter.d.ts.map +1 -0
  220. package/lib/browser/preference/converter.js +632 -0
  221. package/lib/browser/preference/converter.js.map +1 -0
  222. package/lib/browser/preference/schema.d.ts +230 -0
  223. package/lib/browser/preference/schema.d.ts.map +1 -0
  224. package/lib/browser/preference/schema.js +1453 -0
  225. package/lib/browser/preference/schema.js.map +1 -0
  226. package/lib/browser/preference/util.d.ts +4 -0
  227. package/lib/browser/preference/util.d.ts.map +1 -0
  228. package/lib/browser/preference/util.js +13 -0
  229. package/lib/browser/preference/util.js.map +1 -0
  230. package/lib/browser/resource.service.d.ts +32 -0
  231. package/lib/browser/resource.service.d.ts.map +1 -0
  232. package/lib/browser/resource.service.js +219 -0
  233. package/lib/browser/resource.service.js.map +1 -0
  234. package/lib/browser/tab.view.d.ts +12 -0
  235. package/lib/browser/tab.view.d.ts.map +1 -0
  236. package/lib/browser/tab.view.js +330 -0
  237. package/lib/browser/tab.view.js.map +1 -0
  238. package/lib/browser/types.d.ts +344 -0
  239. package/lib/browser/types.d.ts.map +1 -0
  240. package/lib/browser/types.js +94 -0
  241. package/lib/browser/types.js.map +1 -0
  242. package/lib/browser/untitled-resource.d.ts +33 -0
  243. package/lib/browser/untitled-resource.d.ts.map +1 -0
  244. package/lib/browser/untitled-resource.js +114 -0
  245. package/lib/browser/untitled-resource.js.map +1 -0
  246. package/lib/browser/view/editor.react.d.ts +10 -0
  247. package/lib/browser/view/editor.react.d.ts.map +1 -0
  248. package/lib/browser/view/editor.react.js +69 -0
  249. package/lib/browser/view/editor.react.js.map +1 -0
  250. package/lib/browser/view/react-hook.d.ts +3 -0
  251. package/lib/browser/view/react-hook.d.ts.map +1 -0
  252. package/lib/browser/view/react-hook.js +9 -0
  253. package/lib/browser/view/react-hook.js.map +1 -0
  254. package/lib/browser/view/suggest-widget.d.ts +8 -0
  255. package/lib/browser/view/suggest-widget.d.ts.map +1 -0
  256. package/lib/browser/view/suggest-widget.js +51 -0
  257. package/lib/browser/view/suggest-widget.js.map +1 -0
  258. package/lib/browser/view/topPadding.d.ts +6 -0
  259. package/lib/browser/view/topPadding.d.ts.map +1 -0
  260. package/lib/browser/view/topPadding.js +18 -0
  261. package/lib/browser/view/topPadding.js.map +1 -0
  262. package/lib/browser/workbench-editor.service.d.ts +244 -0
  263. package/lib/browser/workbench-editor.service.d.ts.map +1 -0
  264. package/lib/browser/workbench-editor.service.js +1689 -0
  265. package/lib/browser/workbench-editor.service.js.map +1 -0
  266. package/lib/common/doc-cache.d.ts +80 -0
  267. package/lib/common/doc-cache.d.ts.map +1 -0
  268. package/lib/common/doc-cache.js +39 -0
  269. package/lib/common/doc-cache.js.map +1 -0
  270. package/lib/common/editor.d.ts +571 -0
  271. package/lib/common/editor.d.ts.map +1 -0
  272. package/lib/common/editor.js +125 -0
  273. package/lib/common/editor.js.map +1 -0
  274. package/lib/common/index.d.ts +6 -0
  275. package/lib/common/index.d.ts.map +1 -0
  276. package/lib/common/index.js +9 -0
  277. package/lib/common/index.js.map +1 -0
  278. package/lib/common/language.d.ts +108 -0
  279. package/lib/common/language.d.ts.map +1 -0
  280. package/lib/common/language.js +72 -0
  281. package/lib/common/language.js.map +1 -0
  282. package/lib/common/mocks/workbench-editor.service.d.ts +21 -0
  283. package/lib/common/mocks/workbench-editor.service.d.ts.map +1 -0
  284. package/lib/common/mocks/workbench-editor.service.js +48 -0
  285. package/lib/common/mocks/workbench-editor.service.js.map +1 -0
  286. package/lib/common/resource.d.ts +94 -0
  287. package/lib/common/resource.d.ts.map +1 -0
  288. package/lib/common/resource.js +31 -0
  289. package/lib/common/resource.js.map +1 -0
  290. package/lib/common/utils.d.ts +3 -0
  291. package/lib/common/utils.d.ts.map +1 -0
  292. package/lib/common/utils.js +14 -0
  293. package/lib/common/utils.js.map +1 -0
  294. package/lib/index.d.ts +2 -0
  295. package/lib/index.d.ts.map +1 -0
  296. package/lib/index.js +5 -0
  297. package/lib/index.js.map +1 -0
  298. package/package.json +33 -0
@@ -0,0 +1,607 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BrowserDiffEditor = exports.BrowserCodeEditor = exports.BaseMonacoEditorWrapper = exports.insertSnippetWithMonacoEditor = exports.EditorCollectionServiceImpl = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const monaco = (0, tslib_1.__importStar)(require("@opensumi/monaco-editor-core/esm/vs/editor/editor.api"));
6
+ const di_1 = require("@opensumi/di");
7
+ const ide_core_common_1 = require("@opensumi/ide-core-common");
8
+ const common_1 = require("../common");
9
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
10
+ const decoration_applier_1 = require("./decoration-applier");
11
+ const types_1 = require("./doc-model/types");
12
+ const ide_core_common_2 = require("@opensumi/ide-core-common");
13
+ const types_2 = require("./types");
14
+ const feature_1 = require("./feature");
15
+ const converter_1 = require("./preference/converter");
16
+ const contextkey_1 = require("@opensumi/ide-core-browser/lib/contextkey");
17
+ const configuration_1 = require("@opensumi/monaco-editor-core/esm/vs/platform/configuration/common/configuration");
18
+ let EditorCollectionServiceImpl = class EditorCollectionServiceImpl extends ide_core_common_1.WithEventBus {
19
+ constructor() {
20
+ super();
21
+ this._editors = new Set();
22
+ this._diffEditors = new Set();
23
+ this._onCodeEditorCreate = new ide_core_common_2.Emitter();
24
+ this._onDiffEditorCreate = new ide_core_common_2.Emitter();
25
+ this.onCodeEditorCreate = this._onCodeEditorCreate.event;
26
+ this.onDiffEditorCreate = this._onDiffEditorCreate.event;
27
+ this.addDispose(this.editorFeatureRegistry.onDidRegisterFeature((contribution) => {
28
+ this._editors.forEach((editor) => {
29
+ this.editorFeatureRegistry.runOneContribution(editor, contribution);
30
+ });
31
+ }));
32
+ }
33
+ get currentEditor() {
34
+ return this._currentEditor;
35
+ }
36
+ createCodeEditor(dom, options, overrides) {
37
+ const mergedOptions = Object.assign(Object.assign({}, (0, converter_1.getConvertedMonacoOptions)(this.configurationService).editorOptions), options);
38
+ const monacoCodeEditor = this.monacoService.createCodeEditor(dom, mergedOptions, overrides);
39
+ const editor = this.injector.get(BrowserCodeEditor, [monacoCodeEditor, options]);
40
+ this._onCodeEditorCreate.fire(editor);
41
+ return editor;
42
+ }
43
+ listEditors() {
44
+ return Array.from(this._editors.values());
45
+ }
46
+ addEditors(editors) {
47
+ const beforeSize = this._editors.size;
48
+ editors.forEach((editor) => {
49
+ if (!this._editors.has(editor)) {
50
+ this._editors.add(editor);
51
+ this.editorFeatureRegistry.runContributions(editor);
52
+ editor.monacoEditor.onDidFocusEditorWidget(() => {
53
+ this._currentEditor = editor;
54
+ });
55
+ editor.monacoEditor.onContextMenu(() => {
56
+ this._currentEditor = editor;
57
+ });
58
+ }
59
+ });
60
+ if (this._editors.size !== beforeSize) {
61
+ // fire event;
62
+ }
63
+ }
64
+ removeEditors(editors) {
65
+ const beforeSize = this._editors.size;
66
+ editors.forEach((editor) => {
67
+ this._editors.delete(editor);
68
+ if (this._currentEditor === editor) {
69
+ this._currentEditor = undefined;
70
+ }
71
+ });
72
+ if (this._editors.size !== beforeSize) {
73
+ // fire event;
74
+ }
75
+ }
76
+ createDiffEditor(dom, options, overrides) {
77
+ const preferenceOptions = (0, converter_1.getConvertedMonacoOptions)(this.configurationService);
78
+ const mergedOptions = Object.assign(Object.assign(Object.assign({}, preferenceOptions.editorOptions), preferenceOptions.diffOptions), options);
79
+ const monacoDiffEditor = this.monacoService.createDiffEditor(dom, mergedOptions, overrides);
80
+ const editor = this.injector.get(BrowserDiffEditor, [monacoDiffEditor, options]);
81
+ this._onDiffEditorCreate.fire(editor);
82
+ return editor;
83
+ }
84
+ listDiffEditors() {
85
+ return Array.from(this._diffEditors.values());
86
+ }
87
+ addDiffEditors(diffEditors) {
88
+ const beforeSize = this._diffEditors.size;
89
+ diffEditors.forEach((diffEditor) => {
90
+ if (!this._diffEditors.has(diffEditor)) {
91
+ this._diffEditors.add(diffEditor);
92
+ }
93
+ });
94
+ if (this._diffEditors.size !== beforeSize) {
95
+ // fire event _onDiffEditorAdd;
96
+ }
97
+ }
98
+ removeDiffEditors(diffEditors) {
99
+ const beforeSize = this._diffEditors.size;
100
+ diffEditors.forEach((diffEditor) => {
101
+ this._diffEditors.delete(diffEditor);
102
+ });
103
+ if (this._diffEditors.size !== beforeSize) {
104
+ // fire event _onDiffEditorRemove;
105
+ }
106
+ }
107
+ // 将docModel的变更事件反映至resource的dirty装饰
108
+ onDocModelContentChangedEvent(e) {
109
+ this.eventBus.fire(new common_1.ResourceDecorationNeedChangeEvent({
110
+ uri: e.payload.uri,
111
+ decoration: {
112
+ dirty: !!e.payload.dirty,
113
+ },
114
+ }));
115
+ }
116
+ };
117
+ (0, tslib_1.__decorate)([
118
+ (0, di_1.Autowired)(),
119
+ (0, tslib_1.__metadata)("design:type", ide_core_browser_1.MonacoService)
120
+ ], EditorCollectionServiceImpl.prototype, "monacoService", void 0);
121
+ (0, tslib_1.__decorate)([
122
+ (0, di_1.Autowired)(di_1.INJECTOR_TOKEN),
123
+ (0, tslib_1.__metadata)("design:type", di_1.Injector)
124
+ ], EditorCollectionServiceImpl.prototype, "injector", void 0);
125
+ (0, tslib_1.__decorate)([
126
+ (0, di_1.Autowired)(configuration_1.IConfigurationService),
127
+ (0, tslib_1.__metadata)("design:type", Object)
128
+ ], EditorCollectionServiceImpl.prototype, "configurationService", void 0);
129
+ (0, tslib_1.__decorate)([
130
+ (0, di_1.Autowired)(types_2.IEditorFeatureRegistry),
131
+ (0, tslib_1.__metadata)("design:type", feature_1.EditorFeatureRegistryImpl)
132
+ ], EditorCollectionServiceImpl.prototype, "editorFeatureRegistry", void 0);
133
+ (0, tslib_1.__decorate)([
134
+ (0, di_1.Autowired)(types_1.IEditorDocumentModelService),
135
+ (0, tslib_1.__metadata)("design:type", Object)
136
+ ], EditorCollectionServiceImpl.prototype, "documentModelService", void 0);
137
+ (0, tslib_1.__decorate)([
138
+ (0, ide_core_common_1.OnEvent)(types_1.EditorDocumentModelContentChangedEvent),
139
+ (0, tslib_1.__metadata)("design:type", Function),
140
+ (0, tslib_1.__metadata)("design:paramtypes", [types_1.EditorDocumentModelContentChangedEvent]),
141
+ (0, tslib_1.__metadata)("design:returntype", void 0)
142
+ ], EditorCollectionServiceImpl.prototype, "onDocModelContentChangedEvent", null);
143
+ EditorCollectionServiceImpl = (0, tslib_1.__decorate)([
144
+ (0, di_1.Injectable)(),
145
+ (0, tslib_1.__metadata)("design:paramtypes", [])
146
+ ], EditorCollectionServiceImpl);
147
+ exports.EditorCollectionServiceImpl = EditorCollectionServiceImpl;
148
+ function insertSnippetWithMonacoEditor(editor, template, ranges, opts) {
149
+ const snippetController = editor.getContribution('snippetController2');
150
+ const selections = ranges.map((r) => new monaco.Selection(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn));
151
+ editor.setSelections(selections);
152
+ editor.focus();
153
+ snippetController.insert(template, 0, 0, opts.undoStopBefore, opts.undoStopAfter);
154
+ }
155
+ exports.insertSnippetWithMonacoEditor = insertSnippetWithMonacoEditor;
156
+ function updateOptionsWithMonacoEditor(monacoEditor, editorOptions, modelOptions) {
157
+ monacoEditor.updateOptions(editorOptions);
158
+ if (monacoEditor.getModel()) {
159
+ monacoEditor.getModel().updateOptions(modelOptions);
160
+ }
161
+ }
162
+ let BaseMonacoEditorWrapper = class BaseMonacoEditorWrapper extends ide_core_common_1.Disposable {
163
+ constructor(monacoEditor, type) {
164
+ super();
165
+ this.monacoEditor = monacoEditor;
166
+ this.type = type;
167
+ this.onFocus = this.monacoEditor.onDidFocusEditorWidget;
168
+ this.onBlur = this.monacoEditor.onDidBlurEditorWidget;
169
+ this._specialEditorOptions = {};
170
+ this._specialModelOptions = {};
171
+ this._editorOptionsFromContribution = {};
172
+ this._disableSelectionEmitter = false;
173
+ this.decorationApplier = this.injector.get(decoration_applier_1.MonacoEditorDecorationApplier, [this.monacoEditor]);
174
+ this.addDispose(this.monacoEditor.onDidChangeModel(() => {
175
+ this._editorOptionsFromContribution = {};
176
+ const uri = this.currentUri;
177
+ if (uri) {
178
+ Promise.resolve(this.editorFeatureRegistry.runProvideEditorOptionsForUri(uri)).then((option) => {
179
+ if (!this.currentUri || !uri.isEqual(this.currentUri)) {
180
+ return; // uri可能已经变了
181
+ }
182
+ if (option && Object.keys(option).length > 0) {
183
+ this._editorOptionsFromContribution = option;
184
+ this._doUpdateOptions();
185
+ }
186
+ });
187
+ }
188
+ this._doUpdateOptions();
189
+ }));
190
+ this.addDispose(this.monacoEditor.onDidChangeModelLanguage(() => {
191
+ this._doUpdateOptions();
192
+ }));
193
+ this.addDispose(this.configurationService.onDidChangeConfiguration((e) => {
194
+ const changedEditorKeys = e.affectedKeys.filter((key) => (0, converter_1.isEditorOption)(key));
195
+ if (changedEditorKeys.length > 0) {
196
+ this._doUpdateOptions();
197
+ }
198
+ }));
199
+ }
200
+ get currentUri() {
201
+ return this.currentDocumentModel ? this.currentDocumentModel.uri : null;
202
+ }
203
+ getId() {
204
+ return this.monacoEditor.getId();
205
+ }
206
+ getSelections() {
207
+ return this.monacoEditor.getSelections() || [];
208
+ }
209
+ disableSelectionEmitter() {
210
+ this._disableSelectionEmitter = true;
211
+ }
212
+ enableSelectionEmitter() {
213
+ this._disableSelectionEmitter = false;
214
+ }
215
+ getType() {
216
+ return this.type;
217
+ }
218
+ updateOptions(editorOptions = {}, modelOptions = {}) {
219
+ this._specialEditorOptions = (0, ide_core_common_1.removeUndefined)(Object.assign(Object.assign({}, this._specialEditorOptions), editorOptions));
220
+ this._specialModelOptions = (0, ide_core_common_1.removeUndefined)(Object.assign(Object.assign({}, this._specialModelOptions), modelOptions));
221
+ this._doUpdateOptions();
222
+ }
223
+ _doUpdateOptions() {
224
+ const { editorOptions, modelOptions } = this._calculateFinalOptions();
225
+ updateOptionsWithMonacoEditor(this.monacoEditor, editorOptions, modelOptions);
226
+ }
227
+ /**
228
+ * 合并所有的选项
229
+ * 优先关系: (从高到底)
230
+ * 1. 当前编辑器的特殊选项(通过调用 updateOptions或者启动时传入)
231
+ * 2. 来自 featureRegistry 的根据 当前uri 提供的选项
232
+ * 3. 来自偏好设置的选项
233
+ */
234
+ _calculateFinalOptions() {
235
+ var _a;
236
+ const uriStr = this.currentUri ? this.currentUri.toString() : undefined;
237
+ const languageId = this.currentDocumentModel ? this.currentDocumentModel.languageId : undefined;
238
+ const options = (0, converter_1.getConvertedMonacoOptions)(this.configurationService, uriStr, languageId, undefined);
239
+ const basicEditorOptions = {
240
+ readOnly: ((_a = this.currentDocumentModel) === null || _a === void 0 ? void 0 : _a.readonly) || false,
241
+ };
242
+ return {
243
+ editorOptions: Object.assign(Object.assign(Object.assign(Object.assign({}, basicEditorOptions), options.editorOptions), this._editorOptionsFromContribution), this._specialEditorOptions),
244
+ modelOptions: Object.assign(Object.assign({}, options.modelOptions), this._specialModelOptions),
245
+ };
246
+ }
247
+ insertSnippet(template, ranges, opts) {
248
+ insertSnippetWithMonacoEditor(this.monacoEditor, template, ranges, opts);
249
+ }
250
+ applyDecoration(key, options) {
251
+ this.decorationApplier.applyDecoration(key, options);
252
+ }
253
+ onSelectionsChanged(listener) {
254
+ return this.monacoEditor.onDidChangeCursorSelection((e) => {
255
+ if (!this._disableSelectionEmitter) {
256
+ listener({
257
+ selections: this.getSelections(),
258
+ source: e.source,
259
+ });
260
+ }
261
+ });
262
+ }
263
+ onVisibleRangesChanged(listener) {
264
+ const disposer = new ide_core_common_1.Disposable();
265
+ const monacoEditor = this.monacoEditor;
266
+ disposer.addDispose(monacoEditor.onDidScrollChange((e) => {
267
+ listener(this.monacoEditor.getVisibleRanges());
268
+ }));
269
+ disposer.addDispose(monacoEditor.onDidLayoutChange((e) => {
270
+ listener(this.monacoEditor.getVisibleRanges());
271
+ }));
272
+ return disposer;
273
+ }
274
+ setSelections(selections) {
275
+ return this.monacoEditor.setSelections(selections);
276
+ }
277
+ setSelection(selection) {
278
+ return this.monacoEditor.setSelection(selection);
279
+ }
280
+ async save() {
281
+ if (this.currentDocumentModel) {
282
+ await this.currentDocumentModel.save();
283
+ }
284
+ }
285
+ onConfigurationChanged(listener) {
286
+ const monacoEditor = this.monacoEditor;
287
+ return monacoEditor.onDidChangeConfiguration((e) => {
288
+ listener();
289
+ });
290
+ }
291
+ };
292
+ (0, tslib_1.__decorate)([
293
+ (0, di_1.Autowired)(types_2.IEditorFeatureRegistry),
294
+ (0, tslib_1.__metadata)("design:type", Object)
295
+ ], BaseMonacoEditorWrapper.prototype, "editorFeatureRegistry", void 0);
296
+ (0, tslib_1.__decorate)([
297
+ (0, di_1.Autowired)(configuration_1.IConfigurationService),
298
+ (0, tslib_1.__metadata)("design:type", Object)
299
+ ], BaseMonacoEditorWrapper.prototype, "configurationService", void 0);
300
+ (0, tslib_1.__decorate)([
301
+ (0, di_1.Autowired)(di_1.INJECTOR_TOKEN),
302
+ (0, tslib_1.__metadata)("design:type", di_1.Injector)
303
+ ], BaseMonacoEditorWrapper.prototype, "injector", void 0);
304
+ BaseMonacoEditorWrapper = (0, tslib_1.__decorate)([
305
+ (0, di_1.Injectable)({ multiple: true }),
306
+ (0, tslib_1.__metadata)("design:paramtypes", [Object, Number])
307
+ ], BaseMonacoEditorWrapper);
308
+ exports.BaseMonacoEditorWrapper = BaseMonacoEditorWrapper;
309
+ class BrowserCodeEditor extends BaseMonacoEditorWrapper {
310
+ constructor(monacoEditor, options = {}) {
311
+ super(monacoEditor, common_1.EditorType.CODE);
312
+ this.monacoEditor = monacoEditor;
313
+ this.editorState = new Map();
314
+ this.toDispose = [];
315
+ this._onCursorPositionChanged = new ide_core_common_1.Emitter();
316
+ this.onCursorPositionChanged = this._onCursorPositionChanged.event;
317
+ this._disposed = false;
318
+ this._onRefOpen = new ide_core_common_2.Emitter();
319
+ this.onRefOpen = this._onRefOpen.event;
320
+ this._specialEditorOptions = options;
321
+ this.collectionService.addEditors([this]);
322
+ // 防止浏览器后退前进手势
323
+ const disposer = monacoEditor.onDidChangeModel(() => {
324
+ bindPreventNavigation(this.monacoEditor.getDomNode());
325
+ disposer.dispose();
326
+ });
327
+ this.toDispose.push(monacoEditor.onDidChangeCursorPosition(() => {
328
+ if (!this.currentDocumentModel) {
329
+ return;
330
+ }
331
+ const selection = monacoEditor.getSelection();
332
+ this._onCursorPositionChanged.fire({
333
+ position: monacoEditor.getPosition(),
334
+ selectionLength: selection ? this.currentDocumentModel.getMonacoModel().getValueInRange(selection).length : 0,
335
+ });
336
+ }));
337
+ this.addDispose({
338
+ dispose: () => {
339
+ this.monacoEditor.dispose();
340
+ },
341
+ });
342
+ }
343
+ get currentDocumentModel() {
344
+ if (this._currentDocumentModelRef && !this._currentDocumentModelRef.disposed) {
345
+ return this._currentDocumentModelRef.instance;
346
+ }
347
+ else {
348
+ return null;
349
+ }
350
+ }
351
+ getType() {
352
+ return common_1.EditorType.CODE;
353
+ }
354
+ layout() {
355
+ this.monacoEditor.layout();
356
+ }
357
+ focus() {
358
+ this.monacoEditor.focus();
359
+ }
360
+ dispose() {
361
+ super.dispose();
362
+ this.saveCurrentState();
363
+ this.collectionService.removeEditors([this]);
364
+ this._disposed = true;
365
+ this.toDispose.forEach((disposable) => disposable.dispose());
366
+ }
367
+ saveCurrentState() {
368
+ if (this.currentUri) {
369
+ const state = this.monacoEditor.saveViewState();
370
+ if (state) {
371
+ this.editorState.set(this.currentUri.toString(), state);
372
+ }
373
+ }
374
+ }
375
+ restoreState() {
376
+ if (this.currentUri) {
377
+ const state = this.editorState.get(this.currentUri.toString());
378
+ if (state) {
379
+ this.monacoEditor.restoreViewState(state);
380
+ }
381
+ }
382
+ }
383
+ async open(documentModelRef, range) {
384
+ this.saveCurrentState();
385
+ this._currentDocumentModelRef = documentModelRef;
386
+ const model = this.currentDocumentModel.getMonacoModel();
387
+ this.disableSelectionEmitter();
388
+ this.monacoEditor.setModel(model);
389
+ if (range) {
390
+ this.enableSelectionEmitter();
391
+ this.monacoEditor.revealRangeInCenter(range);
392
+ this.monacoEditor.setSelection(range);
393
+ }
394
+ else {
395
+ this.enableSelectionEmitter();
396
+ this.restoreState();
397
+ }
398
+ this._onRefOpen.fire(documentModelRef);
399
+ // monaco 在文件首次打开时不会触发 cursorChange
400
+ this._onCursorPositionChanged.fire({
401
+ position: this.monacoEditor.getPosition(),
402
+ selectionLength: 0,
403
+ });
404
+ }
405
+ }
406
+ (0, tslib_1.__decorate)([
407
+ (0, di_1.Autowired)(common_1.EditorCollectionService),
408
+ (0, tslib_1.__metadata)("design:type", EditorCollectionServiceImpl)
409
+ ], BrowserCodeEditor.prototype, "collectionService", void 0);
410
+ (0, tslib_1.__decorate)([
411
+ (0, di_1.Autowired)(types_2.IEditorFeatureRegistry),
412
+ (0, tslib_1.__metadata)("design:type", Object)
413
+ ], BrowserCodeEditor.prototype, "editorFeatureRegistry", void 0);
414
+ exports.BrowserCodeEditor = BrowserCodeEditor;
415
+ class BrowserDiffEditor extends ide_core_common_1.Disposable {
416
+ constructor(monacoDiffEditor, specialOptions = {}) {
417
+ super();
418
+ this.monacoDiffEditor = monacoDiffEditor;
419
+ this.specialOptions = specialOptions;
420
+ this.editorState = new Map();
421
+ this.wrapEditors();
422
+ this.addDispose(this.configurationService.onDidChangeConfiguration((e) => {
423
+ const changedEditorKeys = e.affectedKeys.filter((key) => (0, converter_1.isDiffEditorOption)(key));
424
+ if (changedEditorKeys.length > 0) {
425
+ this.doUpdateDiffOptions();
426
+ }
427
+ }));
428
+ }
429
+ get originalDocModel() {
430
+ if (this.originalDocModelRef && !this.originalDocModelRef.disposed) {
431
+ return this.originalDocModelRef.instance;
432
+ }
433
+ return null;
434
+ }
435
+ get modifiedDocModel() {
436
+ if (this.modifiedDocModelRef && !this.modifiedDocModelRef.disposed) {
437
+ return this.modifiedDocModelRef.instance;
438
+ }
439
+ return null;
440
+ }
441
+ saveCurrentState() {
442
+ if (this.currentUri) {
443
+ const state = this.monacoDiffEditor.saveViewState();
444
+ if (state) {
445
+ this.editorState.set(this.currentUri.toString(), state);
446
+ }
447
+ }
448
+ }
449
+ restoreState() {
450
+ if (this.currentUri) {
451
+ const state = this.editorState.get(this.currentUri.toString());
452
+ if (state) {
453
+ this.monacoDiffEditor.restoreViewState(state);
454
+ }
455
+ }
456
+ }
457
+ async compare(originalDocModelRef, modifiedDocModelRef, options = {}, rawUri) {
458
+ this.saveCurrentState(); // 保存上一个状态
459
+ this.originalDocModelRef = originalDocModelRef;
460
+ this.modifiedDocModelRef = modifiedDocModelRef;
461
+ this.monacoDiffEditor.setModel({
462
+ original: this.originalDocModel.getMonacoModel(),
463
+ modified: this.modifiedDocModel.getMonacoModel(),
464
+ });
465
+ if (rawUri) {
466
+ this.currentUri = rawUri;
467
+ }
468
+ else {
469
+ this.currentUri = ide_core_common_1.URI.from({
470
+ scheme: 'diff',
471
+ query: ide_core_common_1.URI.stringifyQuery({
472
+ name,
473
+ original: this.originalDocModel.uri.toString(),
474
+ modified: this.modifiedDocModel.uri.toString(),
475
+ }),
476
+ });
477
+ }
478
+ if (options.range || options.originalRange) {
479
+ const range = (options.range || options.originalRange);
480
+ const currentEditor = options.range ? this.modifiedEditor.monacoEditor : this.originalEditor.monacoEditor;
481
+ // 必须使用 setTimeout, 因为两边的 editor 出现时机问题,diffEditor是异步显示和渲染
482
+ setTimeout(() => {
483
+ currentEditor.revealRangeInCenter(range);
484
+ currentEditor.setSelection(range);
485
+ });
486
+ // monaco diffEditor 在setModel后,计算diff完成后, 左侧 originalEditor 会发出一个异步的onScroll,
487
+ // 这个行为可能会带动右侧 modifiedEditor 进行滚动, 导致 revealRange 错位
488
+ // 此处 添加一个onDidUpdateDiff 监听
489
+ const disposer = this.monacoDiffEditor.onDidUpdateDiff(() => {
490
+ disposer.dispose();
491
+ setTimeout(() => {
492
+ currentEditor.revealRangeInCenter(range);
493
+ currentEditor.setSelection(range);
494
+ });
495
+ });
496
+ }
497
+ else {
498
+ this.restoreState();
499
+ }
500
+ if (options.revealFirstDiff) {
501
+ const diffs = this.monacoDiffEditor.getLineChanges();
502
+ if (diffs && diffs.length > 0) {
503
+ this.showFirstDiff();
504
+ }
505
+ else {
506
+ const disposer = this.monacoDiffEditor.onDidUpdateDiff(() => {
507
+ this.showFirstDiff();
508
+ disposer.dispose();
509
+ });
510
+ }
511
+ }
512
+ await this.updateOptionsOnModelChange();
513
+ this.diffResourceKey.set(this.currentUri);
514
+ }
515
+ showFirstDiff() {
516
+ const diffs = this.monacoDiffEditor.getLineChanges();
517
+ if (diffs && diffs.length > 0) {
518
+ this.monacoDiffEditor.revealLineInCenter(diffs[0].modifiedStartLineNumber);
519
+ }
520
+ }
521
+ async updateOptionsOnModelChange() {
522
+ await this.doUpdateDiffOptions();
523
+ }
524
+ async doUpdateDiffOptions() {
525
+ const uriStr = this.modifiedEditor.currentUri ? this.modifiedEditor.currentUri.toString() : undefined;
526
+ const languageId = this.modifiedEditor.currentDocumentModel ? this.modifiedEditor.currentDocumentModel.languageId : undefined;
527
+ const options = (0, converter_1.getConvertedMonacoOptions)(this.configurationService, uriStr, languageId);
528
+ this.monacoDiffEditor.updateOptions(Object.assign(Object.assign({}, options.diffOptions), this.specialOptions));
529
+ }
530
+ updateDiffOptions(options) {
531
+ this.specialOptions = (0, ide_core_common_1.removeUndefined)(Object.assign(Object.assign({}, this.specialOptions), options));
532
+ this.doUpdateDiffOptions();
533
+ }
534
+ getLineChanges() {
535
+ return this.monacoDiffEditor.getLineChanges();
536
+ }
537
+ wrapEditors() {
538
+ const diffEditor = this;
539
+ this.originalEditor = this.injector.get(DiffEditorPart, [diffEditor.monacoDiffEditor.getOriginalEditor(), () => diffEditor.originalDocModel, common_1.EditorType.ORIGINAL_DIFF]);
540
+ this.modifiedEditor = this.injector.get(DiffEditorPart, [diffEditor.monacoDiffEditor.getModifiedEditor(), () => diffEditor.modifiedDocModel, common_1.EditorType.MODIFIED_DIFF]);
541
+ this.collectionService.addEditors([this.originalEditor, this.modifiedEditor]);
542
+ this.collectionService.addDiffEditors([this]);
543
+ // 为 modified editor 的 contextKeyService 注入diffEditor的ResourceKey
544
+ const modifiedContextKeyService = this.contextKeyService.createScoped(this.modifiedEditor.monacoEditor._contextKeyService);
545
+ this.diffResourceKey = new contextkey_1.ResourceContextKey(modifiedContextKeyService, undefined, 'diffResource');
546
+ }
547
+ layout() {
548
+ return this.monacoDiffEditor.layout();
549
+ }
550
+ focus() {
551
+ this.monacoDiffEditor.focus();
552
+ }
553
+ dispose() {
554
+ super.dispose();
555
+ this.collectionService.removeEditors([this.originalEditor, this.modifiedEditor]);
556
+ this.collectionService.removeDiffEditors([this]);
557
+ this.monacoDiffEditor.dispose();
558
+ this._disposed = true;
559
+ }
560
+ }
561
+ (0, tslib_1.__decorate)([
562
+ (0, di_1.Autowired)(common_1.EditorCollectionService),
563
+ (0, tslib_1.__metadata)("design:type", EditorCollectionServiceImpl)
564
+ ], BrowserDiffEditor.prototype, "collectionService", void 0);
565
+ (0, tslib_1.__decorate)([
566
+ (0, di_1.Autowired)(di_1.INJECTOR_TOKEN),
567
+ (0, tslib_1.__metadata)("design:type", di_1.Injector)
568
+ ], BrowserDiffEditor.prototype, "injector", void 0);
569
+ (0, tslib_1.__decorate)([
570
+ (0, di_1.Autowired)(configuration_1.IConfigurationService),
571
+ (0, tslib_1.__metadata)("design:type", Object)
572
+ ], BrowserDiffEditor.prototype, "configurationService", void 0);
573
+ (0, tslib_1.__decorate)([
574
+ (0, di_1.Autowired)(ide_core_browser_1.IContextKeyService),
575
+ (0, tslib_1.__metadata)("design:type", Object)
576
+ ], BrowserDiffEditor.prototype, "contextKeyService", void 0);
577
+ exports.BrowserDiffEditor = BrowserDiffEditor;
578
+ // utils
579
+ function bindPreventNavigation(div) {
580
+ div.addEventListener('mousewheel', preventNavigation);
581
+ }
582
+ function preventNavigation(e) {
583
+ e.preventDefault();
584
+ e.stopPropagation();
585
+ if (this.offsetWidth + this.scrollLeft + e.deltaX > this.scrollWidth) {
586
+ e.preventDefault();
587
+ e.stopPropagation();
588
+ }
589
+ else if (this.scrollLeft + e.deltaX < 0) {
590
+ e.preventDefault();
591
+ e.stopPropagation();
592
+ }
593
+ }
594
+ let DiffEditorPart = class DiffEditorPart extends BaseMonacoEditorWrapper {
595
+ constructor(monacoEditor, getDocumentModel, type) {
596
+ super(monacoEditor, type);
597
+ this.getDocumentModel = getDocumentModel;
598
+ }
599
+ get currentDocumentModel() {
600
+ return this.getDocumentModel();
601
+ }
602
+ };
603
+ DiffEditorPart = (0, tslib_1.__decorate)([
604
+ (0, di_1.Injectable)({ multiple: true }),
605
+ (0, tslib_1.__metadata)("design:paramtypes", [Object, Function, Number])
606
+ ], DiffEditorPart);
607
+ //# sourceMappingURL=editor-collection.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-collection.service.js","sourceRoot":"","sources":["../../src/browser/editor-collection.service.ts"],"names":[],"mappings":";;;;AACA,2GAAgF;AAChF,qCAA+E;AAC/E,+DAAsJ;AACtJ,sCAAqN;AACrN,iEAAuF;AACvF,6DAAqE;AACrE,6CAAuJ;AACvJ,+DAA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,EAAC,CAAC;;GACvB,cAAc,CAUnB"}
@@ -0,0 +1,10 @@
1
+ import { IOpener, URI } from '@opensumi/ide-core-browser';
2
+ import { WorkbenchEditorService, ResourceService } from '../common';
3
+ export declare class EditorOpener implements IOpener {
4
+ resourceService: ResourceService;
5
+ workbenchEditorService: WorkbenchEditorService;
6
+ open(uri: URI): Promise<boolean>;
7
+ handleURI(uri: URI): Promise<boolean>;
8
+ handleScheme(): boolean;
9
+ }
10
+ //# sourceMappingURL=editor-opener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-opener.d.ts","sourceRoot":"","sources":["../../src/browser/editor-opener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAU,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEpE,qBACa,YAAa,YAAW,OAAO;IAG1C,eAAe,EAAE,eAAe,CAAC;IAGjC,sBAAsB,EAAE,sBAAsB,CAAC;IAEzC,IAAI,CAAC,GAAG,EAAE,GAAG;IAsBb,SAAS,CAAC,GAAG,EAAE,GAAG;IAIxB,YAAY;CAIb"}