@opensumi/ide-editor 3.6.5-next-1736242999.0 → 3.6.5-next-1766140030.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 (48) hide show
  1. package/lib/browser/diff/compare.d.ts.map +1 -1
  2. package/lib/browser/diff/compare.js +1 -1
  3. package/lib/browser/diff/compare.js.map +1 -1
  4. package/lib/browser/doc-model/editor-document-model.d.ts.map +1 -1
  5. package/lib/browser/doc-model/editor-document-model.js +1 -10
  6. package/lib/browser/doc-model/editor-document-model.js.map +1 -1
  7. package/lib/browser/doc-model/saveParticipants.js +19 -19
  8. package/lib/browser/doc-model/saveParticipants.js.map +1 -1
  9. package/lib/browser/editor.contribution.d.ts.map +1 -1
  10. package/lib/browser/editor.contribution.js +0 -7
  11. package/lib/browser/editor.contribution.js.map +1 -1
  12. package/lib/browser/monaco-contrib/command/command.service.d.ts +1 -1
  13. package/lib/browser/monaco-contrib/command/command.service.d.ts.map +1 -1
  14. package/lib/browser/monaco-contrib/command/command.service.js +4 -4
  15. package/lib/browser/monaco-contrib/command/command.service.js.map +1 -1
  16. package/lib/browser/preference/converter.d.ts.map +1 -1
  17. package/lib/browser/preference/converter.js +0 -5
  18. package/lib/browser/preference/converter.js.map +1 -1
  19. package/lib/browser/preference/schema.d.ts +0 -1
  20. package/lib/browser/preference/schema.d.ts.map +1 -1
  21. package/lib/browser/preference/schema.js +0 -16
  22. package/lib/browser/preference/schema.js.map +1 -1
  23. package/lib/browser/workbench-editor.service.d.ts +0 -2
  24. package/lib/browser/workbench-editor.service.d.ts.map +1 -1
  25. package/lib/browser/workbench-editor.service.js +0 -8
  26. package/lib/browser/workbench-editor.service.js.map +1 -1
  27. package/lib/common/doc-cache.d.ts +2 -0
  28. package/lib/common/doc-cache.d.ts.map +1 -1
  29. package/lib/common/doc-cache.js +11 -0
  30. package/lib/common/doc-cache.js.map +1 -1
  31. package/lib/common/editor.d.ts +2 -1
  32. package/lib/common/editor.d.ts.map +1 -1
  33. package/lib/common/language.d.ts +2 -1
  34. package/lib/common/language.d.ts.map +1 -1
  35. package/lib/common/language.js +2 -1
  36. package/lib/common/language.js.map +1 -1
  37. package/package.json +14 -14
  38. package/src/browser/diff/compare.ts +1 -2
  39. package/src/browser/doc-model/editor-document-model.ts +1 -12
  40. package/src/browser/doc-model/saveParticipants.ts +5 -5
  41. package/src/browser/editor.contribution.ts +1 -9
  42. package/src/browser/monaco-contrib/command/command.service.ts +4 -4
  43. package/src/browser/preference/converter.ts +0 -6
  44. package/src/browser/preference/schema.ts +0 -16
  45. package/src/browser/workbench-editor.service.ts +0 -14
  46. package/src/common/doc-cache.ts +12 -0
  47. package/src/common/editor.ts +1 -1
  48. package/src/common/language.ts +2 -1
@@ -39,11 +39,11 @@ import { createTextBuffer } from '@opensumi/monaco-editor-core/esm/vs/editor/com
39
39
 
40
40
  import {
41
41
  IDocCache,
42
- IDocCacheValue,
43
42
  IDocPersistentCacheProvider,
44
43
  IEditorDocumentModelContentChange,
45
44
  SaveReason,
46
45
  isDocContentCache,
46
+ parseRangeFrom,
47
47
  } from '../../common';
48
48
  import { AUTO_SAVE_MODE, IEditorDocumentModel } from '../../common/editor';
49
49
  import { EditorPreferences } from '../preference/schema';
@@ -265,17 +265,6 @@ export class EditorDocumentModel extends Disposable implements IEditorDocumentMo
265
265
  return;
266
266
  }
267
267
 
268
- const parseRangeFrom = (cacheValue: IDocCacheValue): Range => {
269
- const [_text, startLineNumber, startColumn, endLineNumber, endColumn] = cacheValue;
270
-
271
- return Range.lift({
272
- startLineNumber,
273
- startColumn,
274
- endLineNumber,
275
- endColumn,
276
- });
277
- };
278
-
279
268
  if (isDocContentCache(cache)) {
280
269
  this.monacoModel.setValue(cache.content);
281
270
  } else {
@@ -16,11 +16,6 @@ import {
16
16
  } from '@opensumi/ide-core-browser';
17
17
  import { IProgressService } from '@opensumi/ide-core-browser/lib/progress';
18
18
  import * as monaco from '@opensumi/ide-monaco';
19
- import {
20
- CodeActionItem,
21
- CodeActionKind,
22
- CodeActionTriggerSource,
23
- } from '@opensumi/ide-monaco/lib/browser/contrib/codeAction';
24
19
  import { ResourceEdit } from '@opensumi/ide-monaco/lib/browser/monaco-api';
25
20
  import { languageFeaturesService } from '@opensumi/ide-monaco/lib/browser/monaco-api/languages';
26
21
  import { ITextModel } from '@opensumi/ide-monaco/lib/browser/monaco-api/types';
@@ -32,6 +27,11 @@ import { Range } from '@opensumi/monaco-editor-core/esm/vs/editor/common/core/ra
32
27
  import * as languages from '@opensumi/monaco-editor-core/esm/vs/editor/common/languages';
33
28
  import { CodeActionProvider } from '@opensumi/monaco-editor-core/esm/vs/editor/common/languages';
34
29
  import { getCodeActions } from '@opensumi/monaco-editor-core/esm/vs/editor/contrib/codeAction/browser/codeAction';
30
+ import {
31
+ CodeActionItem,
32
+ CodeActionKind,
33
+ CodeActionTriggerSource,
34
+ } from '@opensumi/monaco-editor-core/esm/vs/editor/contrib/codeAction/common/types';
35
35
 
36
36
  import { MonacoCodeService } from '../editor.override';
37
37
  import { SaveReason } from '../types';
@@ -35,7 +35,6 @@ import {
35
35
  ServiceNames,
36
36
  URI,
37
37
  formatLocalize,
38
- getIcon,
39
38
  getLanguageIdFromMonaco,
40
39
  localize,
41
40
  } from '@opensumi/ide-core-browser';
@@ -62,6 +61,7 @@ import {
62
61
  IDocPersistentCacheProvider,
63
62
  IEditor,
64
63
  ILanguageService,
64
+ IResource,
65
65
  IResourceOpenOptions,
66
66
  ResourceService,
67
67
  SaveReason,
@@ -1197,13 +1197,6 @@ export class EditorContribution
1197
1197
  execute: () => this.prefixQuickOpenService.open(':'),
1198
1198
  });
1199
1199
 
1200
- commands.registerCommand(EDITOR_COMMANDS.TOGGLE_COLUMN_SELECTION, {
1201
- execute: () => {
1202
- const isColumnSelection = this.preferenceService.get<boolean>('editor.columnSelection');
1203
- this.preferenceService.set('editor.columnSelection', !isColumnSelection, PreferenceScope.User);
1204
- },
1205
- });
1206
-
1207
1200
  commands.registerCommand(EDITOR_COMMANDS.TOGGLE_WORD_WRAP, {
1208
1201
  execute: () => {
1209
1202
  const wordWrap = this.preferenceService.get<string>('editor.wordWrap');
@@ -1328,7 +1321,6 @@ export class EditorContribution
1328
1321
 
1329
1322
  menus.registerMenuItem(MenuId.EditorTitle, {
1330
1323
  command: EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,
1331
- iconClass: getIcon('embed'),
1332
1324
  group: 'navigation',
1333
1325
  when: 'resource',
1334
1326
  order: 5,
@@ -408,10 +408,10 @@ export class MonacoActionRegistry implements IMonacoActionRegistry {
408
408
  */
409
409
  protected newActionHandler(id: string): MonacoEditorCommandHandler {
410
410
  return {
411
- execute: (editor, ...args) => {
411
+ execute: (editor) => {
412
412
  const action = editor.getAction(id);
413
413
  if (action && action.isSupported()) {
414
- return this.runAction(id, editor, ...args);
414
+ return this.runAction(id, editor);
415
415
  }
416
416
  },
417
417
  };
@@ -422,11 +422,11 @@ export class MonacoActionRegistry implements IMonacoActionRegistry {
422
422
  * @param id 要执行的 action
423
423
  * @param editor 执行 action 的 editor,默认为当前 editor
424
424
  */
425
- protected runAction(id: string, editor: ICodeEditor, ...args: any[]): Promise<void> {
425
+ protected runAction(id: string, editor: ICodeEditor): Promise<void> {
426
426
  if (editor) {
427
427
  const action = editor.getAction(id);
428
428
  if (action) {
429
- return action.run(...args);
429
+ return action.run();
430
430
  }
431
431
  }
432
432
 
@@ -194,12 +194,6 @@ export const editorOptionsConverters: Map<KaitianPreferenceKey, NoConverter | IM
194
194
  */
195
195
  ['editor.fontLigatures', { monaco: 'fontLigatures' }],
196
196
 
197
- /**
198
- * Enable that the selection with the mouse and keys is doing column selection.
199
- * Defaults to false.
200
- */
201
- ['editor.columnSelection', { monaco: 'columnSelection' }],
202
-
203
197
  /**
204
198
  * Disable the use of `will-change` for the editor margin and lines layers.
205
199
  * The usage of `will-change` acts as a hint for browsers to create an extra layer.
@@ -110,7 +110,6 @@ export const EDITOR_DEFAULTS = {
110
110
  lineNumbersMinChars: 3,
111
111
  lineDecorationsWidth: 10,
112
112
  readOnly: false,
113
- columnSelection: false,
114
113
  mouseStyle: 'text',
115
114
  disableLayerHinting: false,
116
115
  automaticLayout: true,
@@ -1180,11 +1179,6 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
1180
1179
  default: EDITOR_DEFAULTS.contribInfo.selectionHighlight,
1181
1180
  description: '%editor.configuration.selectionHighlight%',
1182
1181
  },
1183
- 'editor.columnSelection': {
1184
- type: 'boolean',
1185
- default: EDITOR_DEFAULTS.columnSelection,
1186
- description: '%editor.configuration.columnSelection%',
1187
- },
1188
1182
  'editor.occurrencesHighlight': {
1189
1183
  type: 'boolean',
1190
1184
  default: EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,
@@ -1452,16 +1446,6 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
1452
1446
  default: true,
1453
1447
  description: '%editor.configuration.unicodeHighlight.ambiguousCharacters%',
1454
1448
  },
1455
- 'editor.unicodeHighlight.allowedCharacters': {
1456
- type: 'object',
1457
- default: {},
1458
- description: '%editor.configuration.unicodeHighlight.allowedCharacters%',
1459
- },
1460
- 'editor.unicodeHighlight.allowedLocales': {
1461
- type: 'object',
1462
- default: {},
1463
- description: '%editor.configuration.unicodeHighlight.allowedLocales%',
1464
- },
1465
1449
  'diffEditor.renderIndicators': {
1466
1450
  type: 'boolean',
1467
1451
  default: DIFF_EDITOR_DEFAULTS.renderIndicators,
@@ -748,8 +748,6 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
748
748
 
749
749
  private _editorLangIDContextKey: IContextKey<string>;
750
750
 
751
- private _activeEditorIsDirtyContextKey: IContextKey<boolean>;
752
-
753
751
  private _isInDiffEditorContextKey: IContextKey<boolean>;
754
752
 
755
753
  private _diffResourceContextKey: ResourceContextKey;
@@ -907,7 +905,6 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
907
905
  );
908
906
  this._editorLangIDContextKey = this.contextKeyService.createKey<string>('editorLangId', '');
909
907
  this._isInDiffEditorContextKey = this.contextKeyService.createKey<boolean>('isInDiffEditor', false);
910
- this._activeEditorIsDirtyContextKey = this.contextKeyService.createKey<boolean>('activeEditorIsDirty', false);
911
908
  this._isInDiffRightEditorContextKey = this.contextKeyService.createKey<boolean>('isInDiffRightEditor', false);
912
909
  this._isInEditorComponentContextKey = this.contextKeyService.createKey<boolean>('inEditorComponent', false);
913
910
  }
@@ -929,7 +926,6 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
929
926
  }
930
927
  this._editorLangIDContextKey.reset();
931
928
  }
932
- this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty());
933
929
  this._isInDiffEditorContextKey.set(this.isDiffEditorMode());
934
930
  // 没有 focus 的时候默认添加在 RightDiffEditor
935
931
  this._isInDiffRightEditorContextKey.set(this.isDiffEditorMode());
@@ -1180,12 +1176,6 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
1180
1176
  editorId: this.codeEditor.getId(),
1181
1177
  }),
1182
1178
  );
1183
-
1184
- this.toDispose.push(
1185
- this.codeEditor.monacoEditor.onDidChangeModelContent(() => {
1186
- this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty());
1187
- }),
1188
- );
1189
1179
  this.codeEditorReady.ready();
1190
1180
  }
1191
1181
 
@@ -2249,10 +2239,6 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
2249
2239
  return !!this.currentOpenType && this.currentOpenType.type === EditorOpenType.diff;
2250
2240
  }
2251
2241
 
2252
- activeEditorIsDirty() {
2253
- return this.hasDirty() && this.workbenchEditorService.currentEditorGroup === this;
2254
- }
2255
-
2256
2242
  isComponentMode() {
2257
2243
  return !!this.currentOpenType && this.currentOpenType.type === EditorOpenType.component;
2258
2244
  }
@@ -1,4 +1,5 @@
1
1
  import { MaybePromise, URI } from '@opensumi/ide-core-common';
2
+ import { Range } from '@opensumi/monaco-editor-core/esm/vs/editor/common/core/range';
2
3
 
3
4
  import type { IModelContentChange } from '@opensumi/monaco-editor-core/esm/vs/editor/common/textModelEvents';
4
5
 
@@ -104,3 +105,14 @@ export function parseCacheValueFrom(change: IModelContentChange): IDocCacheValue
104
105
 
105
106
  return [text, startLineNumber, startColumn, endLineNumber, endColumn];
106
107
  }
108
+
109
+ export function parseRangeFrom(cacheValue: IDocCacheValue): Range {
110
+ const [_text, startLineNumber, startColumn, endLineNumber, endColumn] = cacheValue;
111
+
112
+ return Range.lift({
113
+ startLineNumber,
114
+ startColumn,
115
+ endLineNumber,
116
+ endColumn,
117
+ });
118
+ }
@@ -15,6 +15,7 @@ import {
15
15
  MaybeNull,
16
16
  URI,
17
17
  } from '@opensumi/ide-core-common';
18
+ import { IDimension } from '@opensumi/ide-monaco';
18
19
 
19
20
  import { IResource } from './resource';
20
21
  import { IDocModelUpdateOptions } from './types';
@@ -23,7 +24,6 @@ import type {
23
24
  EOL,
24
25
  ICodeEditorViewState,
25
26
  IDiffEditorViewState,
26
- IDimension,
27
27
  IEditorOptions,
28
28
  ICodeEditor as IMonacoCodeEditor,
29
29
  ITextModel,
@@ -1,7 +1,8 @@
1
1
  import LSTypes from 'vscode-languageserver-types';
2
2
 
3
- import { CancellationToken, IDisposable, IRelativePattern, MarkerSeverity, Uri } from '@opensumi/ide-core-common';
3
+ import { CancellationToken, IDisposable, IRelativePattern, MarkerSeverity } from '@opensumi/ide-core-common';
4
4
  import { editor } from '@opensumi/ide-monaco';
5
+ import { URI as Uri } from '@opensumi/monaco-editor-core/esm/vs/base/common/uri';
5
6
 
6
7
  import type { IRelatedInformation } from '@opensumi/monaco-editor-core/esm/vs/platform/markers/common/markers';
7
8