@opensumi/ide-editor 3.6.5-next-1735009040.0 → 3.6.5-next-1735183968.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 (28) 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/editor.contribution.d.ts.map +1 -1
  5. package/lib/browser/editor.contribution.js +7 -0
  6. package/lib/browser/editor.contribution.js.map +1 -1
  7. package/lib/browser/monaco-contrib/command/command.service.d.ts +1 -1
  8. package/lib/browser/monaco-contrib/command/command.service.d.ts.map +1 -1
  9. package/lib/browser/monaco-contrib/command/command.service.js +4 -4
  10. package/lib/browser/monaco-contrib/command/command.service.js.map +1 -1
  11. package/lib/browser/preference/converter.d.ts.map +1 -1
  12. package/lib/browser/preference/converter.js +5 -0
  13. package/lib/browser/preference/converter.js.map +1 -1
  14. package/lib/browser/preference/schema.d.ts +1 -0
  15. package/lib/browser/preference/schema.d.ts.map +1 -1
  16. package/lib/browser/preference/schema.js +16 -0
  17. package/lib/browser/preference/schema.js.map +1 -1
  18. package/lib/browser/workbench-editor.service.d.ts +2 -0
  19. package/lib/browser/workbench-editor.service.d.ts.map +1 -1
  20. package/lib/browser/workbench-editor.service.js +8 -0
  21. package/lib/browser/workbench-editor.service.js.map +1 -1
  22. package/package.json +14 -14
  23. package/src/browser/diff/compare.ts +2 -1
  24. package/src/browser/editor.contribution.ts +9 -1
  25. package/src/browser/monaco-contrib/command/command.service.ts +4 -4
  26. package/src/browser/preference/converter.ts +6 -0
  27. package/src/browser/preference/schema.ts +16 -0
  28. package/src/browser/workbench-editor.service.ts +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/ide-editor",
3
- "version": "3.6.5-next-1735009040.0",
3
+ "version": "3.6.5-next-1735183968.0",
4
4
  "files": [
5
5
  "lib",
6
6
  "src"
@@ -17,21 +17,21 @@
17
17
  "url": "git@github.com:opensumi/core.git"
18
18
  },
19
19
  "dependencies": {
20
- "@opensumi/ide-core-common": "3.6.5-next-1735009040.0",
21
- "@opensumi/ide-core-node": "3.6.5-next-1735009040.0",
22
- "@opensumi/ide-file-service": "3.6.5-next-1735009040.0",
23
- "@opensumi/ide-monaco": "3.6.5-next-1735009040.0",
24
- "@opensumi/ide-utils": "3.6.5-next-1735009040.0",
20
+ "@opensumi/ide-core-common": "3.6.5-next-1735183968.0",
21
+ "@opensumi/ide-core-node": "3.6.5-next-1735183968.0",
22
+ "@opensumi/ide-file-service": "3.6.5-next-1735183968.0",
23
+ "@opensumi/ide-monaco": "3.6.5-next-1735183968.0",
24
+ "@opensumi/ide-utils": "3.6.5-next-1735183968.0",
25
25
  "vscode-oniguruma": "1.5.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@opensumi/ide-components": "3.6.5-next-1735009040.0",
29
- "@opensumi/ide-core-browser": "3.6.5-next-1735009040.0",
30
- "@opensumi/ide-dev-tool": "3.6.5-next-1735009040.0",
31
- "@opensumi/ide-overlay": "3.6.5-next-1735009040.0",
32
- "@opensumi/ide-quick-open": "3.6.5-next-1735009040.0",
33
- "@opensumi/ide-theme": "3.6.5-next-1735009040.0",
34
- "@opensumi/ide-workspace": "3.6.5-next-1735009040.0"
28
+ "@opensumi/ide-components": "3.6.5-next-1735183968.0",
29
+ "@opensumi/ide-core-browser": "3.6.5-next-1735183968.0",
30
+ "@opensumi/ide-dev-tool": "3.6.5-next-1735183968.0",
31
+ "@opensumi/ide-overlay": "3.6.5-next-1735183968.0",
32
+ "@opensumi/ide-quick-open": "3.6.5-next-1735183968.0",
33
+ "@opensumi/ide-theme": "3.6.5-next-1735183968.0",
34
+ "@opensumi/ide-workspace": "3.6.5-next-1735183968.0"
35
35
  },
36
- "gitHead": "adfa9ec28ca2427ac0a992ea96cb4ad3f781f4b8"
36
+ "gitHead": "9b727d3cd625334c83d97690434ec75e3b52a91f"
37
37
  }
@@ -7,6 +7,7 @@ import {
7
7
  Deferred,
8
8
  Domain,
9
9
  EDITOR_COMMANDS,
10
+ PreferenceScope,
10
11
  PreferenceService,
11
12
  URI,
12
13
  getIcon,
@@ -109,7 +110,7 @@ export class CompareEditorContribution implements MenuContribution, CommandContr
109
110
  commands.registerCommand(DIFF_EDITOR_COMMANDS.TOGGLE_COLLAPSE_UNCHANGED_REGIONS, {
110
111
  execute: () => {
111
112
  const enabled = this.preferenceService.get('diffEditor.hideUnchangedRegions.enabled');
112
- this.preferenceService.set('diffEditor.hideUnchangedRegions.enabled', !enabled);
113
+ this.preferenceService.set('diffEditor.hideUnchangedRegions.enabled', !enabled, PreferenceScope.User);
113
114
  },
114
115
  });
115
116
  }
@@ -35,6 +35,7 @@ import {
35
35
  ServiceNames,
36
36
  URI,
37
37
  formatLocalize,
38
+ getIcon,
38
39
  getLanguageIdFromMonaco,
39
40
  localize,
40
41
  } from '@opensumi/ide-core-browser';
@@ -61,7 +62,6 @@ import {
61
62
  IDocPersistentCacheProvider,
62
63
  IEditor,
63
64
  ILanguageService,
64
- IResource,
65
65
  IResourceOpenOptions,
66
66
  ResourceService,
67
67
  SaveReason,
@@ -1197,6 +1197,13 @@ 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
+
1200
1207
  commands.registerCommand(EDITOR_COMMANDS.TOGGLE_WORD_WRAP, {
1201
1208
  execute: () => {
1202
1209
  const wordWrap = this.preferenceService.get<string>('editor.wordWrap');
@@ -1321,6 +1328,7 @@ export class EditorContribution
1321
1328
 
1322
1329
  menus.registerMenuItem(MenuId.EditorTitle, {
1323
1330
  command: EDITOR_COMMANDS.SPLIT_TO_RIGHT.id,
1331
+ iconClass: getIcon('embed'),
1324
1332
  group: 'navigation',
1325
1333
  when: 'resource',
1326
1334
  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) => {
411
+ execute: (editor, ...args) => {
412
412
  const action = editor.getAction(id);
413
413
  if (action && action.isSupported()) {
414
- return this.runAction(id, editor);
414
+ return this.runAction(id, editor, ...args);
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): Promise<void> {
425
+ protected runAction(id: string, editor: ICodeEditor, ...args: any[]): Promise<void> {
426
426
  if (editor) {
427
427
  const action = editor.getAction(id);
428
428
  if (action) {
429
- return action.run();
429
+ return action.run(...args);
430
430
  }
431
431
  }
432
432
 
@@ -194,6 +194,12 @@ 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
+
197
203
  /**
198
204
  * Disable the use of `will-change` for the editor margin and lines layers.
199
205
  * The usage of `will-change` acts as a hint for browsers to create an extra layer.
@@ -110,6 +110,7 @@ export const EDITOR_DEFAULTS = {
110
110
  lineNumbersMinChars: 3,
111
111
  lineDecorationsWidth: 10,
112
112
  readOnly: false,
113
+ columnSelection: false,
113
114
  mouseStyle: 'text',
114
115
  disableLayerHinting: false,
115
116
  automaticLayout: true,
@@ -1179,6 +1180,11 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
1179
1180
  default: EDITOR_DEFAULTS.contribInfo.selectionHighlight,
1180
1181
  description: '%editor.configuration.selectionHighlight%',
1181
1182
  },
1183
+ 'editor.columnSelection': {
1184
+ type: 'boolean',
1185
+ default: EDITOR_DEFAULTS.columnSelection,
1186
+ description: '%editor.configuration.columnSelection%',
1187
+ },
1182
1188
  'editor.occurrencesHighlight': {
1183
1189
  type: 'boolean',
1184
1190
  default: EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,
@@ -1446,6 +1452,16 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
1446
1452
  default: true,
1447
1453
  description: '%editor.configuration.unicodeHighlight.ambiguousCharacters%',
1448
1454
  },
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
+ },
1449
1465
  'diffEditor.renderIndicators': {
1450
1466
  type: 'boolean',
1451
1467
  default: DIFF_EDITOR_DEFAULTS.renderIndicators,
@@ -748,6 +748,8 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
748
748
 
749
749
  private _editorLangIDContextKey: IContextKey<string>;
750
750
 
751
+ private _activeEditorIsDirtyContextKey: IContextKey<boolean>;
752
+
751
753
  private _isInDiffEditorContextKey: IContextKey<boolean>;
752
754
 
753
755
  private _diffResourceContextKey: ResourceContextKey;
@@ -905,6 +907,7 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
905
907
  );
906
908
  this._editorLangIDContextKey = this.contextKeyService.createKey<string>('editorLangId', '');
907
909
  this._isInDiffEditorContextKey = this.contextKeyService.createKey<boolean>('isInDiffEditor', false);
910
+ this._activeEditorIsDirtyContextKey = this.contextKeyService.createKey<boolean>('activeEditorIsDirty', false);
908
911
  this._isInDiffRightEditorContextKey = this.contextKeyService.createKey<boolean>('isInDiffRightEditor', false);
909
912
  this._isInEditorComponentContextKey = this.contextKeyService.createKey<boolean>('inEditorComponent', false);
910
913
  }
@@ -926,6 +929,7 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
926
929
  }
927
930
  this._editorLangIDContextKey.reset();
928
931
  }
932
+ this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty());
929
933
  this._isInDiffEditorContextKey.set(this.isDiffEditorMode());
930
934
  // 没有 focus 的时候默认添加在 RightDiffEditor
931
935
  this._isInDiffRightEditorContextKey.set(this.isDiffEditorMode());
@@ -1176,6 +1180,12 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
1176
1180
  editorId: this.codeEditor.getId(),
1177
1181
  }),
1178
1182
  );
1183
+
1184
+ this.toDispose.push(
1185
+ this.codeEditor.monacoEditor.onDidChangeModelContent(() => {
1186
+ this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty());
1187
+ }),
1188
+ );
1179
1189
  this.codeEditorReady.ready();
1180
1190
  }
1181
1191
 
@@ -2239,6 +2249,10 @@ export class EditorGroup extends WithEventBus implements IGridEditorGroup {
2239
2249
  return !!this.currentOpenType && this.currentOpenType.type === EditorOpenType.diff;
2240
2250
  }
2241
2251
 
2252
+ activeEditorIsDirty() {
2253
+ return this.hasDirty() && this.workbenchEditorService.currentEditorGroup === this;
2254
+ }
2255
+
2242
2256
  isComponentMode() {
2243
2257
  return !!this.currentOpenType && this.currentOpenType.type === EditorOpenType.component;
2244
2258
  }