@theia/editor 1.18.0 → 1.19.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 (36) hide show
  1. package/lib/browser/editor-command.d.ts +2 -0
  2. package/lib/browser/editor-command.d.ts.map +1 -1
  3. package/lib/browser/editor-command.js +80 -65
  4. package/lib/browser/editor-command.js.map +1 -1
  5. package/lib/browser/editor-contribution.d.ts +1 -2
  6. package/lib/browser/editor-contribution.d.ts.map +1 -1
  7. package/lib/browser/editor-contribution.js +6 -5
  8. package/lib/browser/editor-contribution.js.map +1 -1
  9. package/lib/browser/editor-manager.d.ts +1 -2
  10. package/lib/browser/editor-manager.d.ts.map +1 -1
  11. package/lib/browser/editor-manager.js.map +1 -1
  12. package/lib/browser/editor-menu.d.ts +13 -1
  13. package/lib/browser/editor-menu.d.ts.map +1 -1
  14. package/lib/browser/editor-menu.js +32 -7
  15. package/lib/browser/editor-menu.js.map +1 -1
  16. package/lib/browser/editor-preferences.d.ts +2 -0
  17. package/lib/browser/editor-preferences.d.ts.map +1 -1
  18. package/lib/browser/editor-preferences.js +302 -291
  19. package/lib/browser/editor-preferences.js.map +1 -1
  20. package/lib/browser/editor-widget-factory.js +1 -1
  21. package/lib/browser/editor-widget-factory.js.map +1 -1
  22. package/lib/browser/editor.d.ts +1 -2
  23. package/lib/browser/editor.d.ts.map +1 -1
  24. package/lib/browser/editor.js.map +1 -1
  25. package/lib/browser/quick-editor-service.d.ts +1 -2
  26. package/lib/browser/quick-editor-service.d.ts.map +1 -1
  27. package/lib/browser/quick-editor-service.js.map +1 -1
  28. package/package.json +5 -5
  29. package/src/browser/editor-command.ts +80 -65
  30. package/src/browser/editor-contribution.ts +7 -7
  31. package/src/browser/editor-manager.ts +1 -2
  32. package/src/browser/editor-menu.ts +35 -7
  33. package/src/browser/editor-preferences.ts +302 -291
  34. package/src/browser/editor-widget-factory.ts +2 -2
  35. package/src/browser/editor.ts +1 -2
  36. package/src/browser/quick-editor-service.ts +1 -2
@@ -18,14 +18,14 @@ import { EditorManager } from './editor-manager';
18
18
  import { TextEditor } from './editor';
19
19
  import { injectable, inject, optional } from '@theia/core/shared/inversify';
20
20
  import { StatusBarAlignment, StatusBar } from '@theia/core/lib/browser/status-bar/status-bar';
21
- import { FrontendApplicationContribution, DiffUris, DockLayout, QuickInputService } from '@theia/core/lib/browser';
21
+ import { FrontendApplicationContribution, DiffUris, DockLayout, QuickInputService, KeybindingRegistry, KeybindingContribution } from '@theia/core/lib/browser';
22
22
  import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
23
23
  import { CommandHandler, DisposableCollection } from '@theia/core';
24
24
  import { EditorCommands } from './editor-command';
25
25
  import { CommandRegistry, CommandContribution } from '@theia/core/lib/common';
26
- import { KeybindingRegistry, KeybindingContribution } from '@theia/core/lib/browser';
27
26
  import { LanguageService } from '@theia/core/lib/browser/language-service';
28
27
  import { SUPPORTED_ENCODINGS } from '@theia/core/lib/browser/supported-encodings';
28
+ import { nls } from '@theia/core/lib/common/nls';
29
29
 
30
30
  @injectable()
31
31
  export class EditorContribution implements FrontendApplicationContribution, CommandContribution, KeybindingContribution {
@@ -95,7 +95,7 @@ export class EditorContribution implements FrontendApplicationContribution, Comm
95
95
  alignment: StatusBarAlignment.RIGHT,
96
96
  priority: 1,
97
97
  command: EditorCommands.CHANGE_LANGUAGE.id,
98
- tooltip: 'Select Language Mode'
98
+ tooltip: nls.localize('vscode/editorStatus/selectLanguageMode', 'Select Language Mode')
99
99
  });
100
100
  }
101
101
 
@@ -109,7 +109,7 @@ export class EditorContribution implements FrontendApplicationContribution, Comm
109
109
  alignment: StatusBarAlignment.RIGHT,
110
110
  priority: 10,
111
111
  command: EditorCommands.CHANGE_ENCODING.id,
112
- tooltip: 'Select Encoding'
112
+ tooltip: nls.localize('vscode/editorStatus/selectEncoding', 'Select Encoding')
113
113
  });
114
114
  }
115
115
 
@@ -120,11 +120,11 @@ export class EditorContribution implements FrontendApplicationContribution, Comm
120
120
  }
121
121
  const { cursor } = editor;
122
122
  this.statusBar.setElement('editor-status-cursor-position', {
123
- text: `Ln ${cursor.line + 1}, Col ${editor.getVisibleColumn(cursor)}`,
123
+ text: nls.localize('vscode/editorStatus/singleSelection', 'Ln {0}, Col {1}', (cursor.line + 1).toString(), editor.getVisibleColumn(cursor).toString()),
124
124
  alignment: StatusBarAlignment.RIGHT,
125
125
  priority: 100,
126
- tooltip: 'Go To Line',
127
- command: 'editor.action.gotoLine'
126
+ tooltip: EditorCommands.GOTO_LINE_COLUMN.label,
127
+ command: EditorCommands.GOTO_LINE_COLUMN.id
128
128
  });
129
129
  }
130
130
 
@@ -19,9 +19,8 @@ import URI from '@theia/core/lib/common/uri';
19
19
  import { RecursivePartial, Emitter, Event, MaybePromise } from '@theia/core/lib/common';
20
20
  import { WidgetOpenerOptions, NavigatableWidgetOpenHandler, NavigatableWidgetOptions, Widget } from '@theia/core/lib/browser';
21
21
  import { EditorWidget } from './editor-widget';
22
- import { Range, Position, Location } from './editor';
22
+ import { Range, Position, Location, TextEditor } from './editor';
23
23
  import { EditorWidgetFactory } from './editor-widget-factory';
24
- import { TextEditor } from './editor';
25
24
 
26
25
  export interface WidgetId {
27
26
  id: number;
@@ -18,6 +18,7 @@ import { injectable } from '@theia/core/shared/inversify';
18
18
  import { MenuContribution, MenuModelRegistry, MenuPath, MAIN_MENU_BAR } from '@theia/core';
19
19
  import { CommonCommands, CommonMenus } from '@theia/core/lib/browser';
20
20
  import { EditorCommands } from './editor-command';
21
+ import { nls } from '@theia/core/lib/common/nls';
21
22
 
22
23
  export const EDITOR_CONTEXT_MENU: MenuPath = ['editor_context_menu'];
23
24
 
@@ -41,10 +42,24 @@ export namespace EditorMainMenu {
41
42
  export const GO = [...MAIN_MENU_BAR, '5_go'];
42
43
 
43
44
  /**
44
- * Navigation menu group in the `Go` menu.
45
+ * Navigation menu group in the `Go` main-menu.
45
46
  */
46
47
  export const NAVIGATION_GROUP = [...GO, '1_navigation_group'];
47
48
 
49
+ /**
50
+ * Workspace menu group in the `Go` main-menu.
51
+ */
52
+ export const WORKSPACE_GROUP = [...GO, '2_workspace_group'];
53
+
54
+ /**
55
+ * Language features menu group in the `Go` main-menu.
56
+ */
57
+ export const LANGUAGE_FEATURES_GROUP = [...GO, '3_language_features_group'];
58
+
59
+ /**
60
+ * Location menu group in the `Go` main-menu.
61
+ */
62
+ export const LOCATION_GROUP = [...GO, '4_locations'];
48
63
  }
49
64
 
50
65
  @injectable()
@@ -72,18 +87,26 @@ export class EditorMenuContribution implements MenuContribution {
72
87
  });
73
88
 
74
89
  // Editor navigation. Go > Back and Go > Forward.
75
- registry.registerSubmenu(EditorMainMenu.GO, 'Go');
90
+ registry.registerSubmenu(EditorMainMenu.GO, nls.localize('vscode/menubar/mGoto', 'Go'));
76
91
  registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
77
92
  commandId: EditorCommands.GO_BACK.id,
78
- label: 'Back'
93
+ label: EditorCommands.GO_BACK.label,
94
+ order: '1'
79
95
  });
80
96
  registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
81
97
  commandId: EditorCommands.GO_FORWARD.id,
82
- label: 'Forward'
98
+ label: EditorCommands.GO_FORWARD.label,
99
+ order: '2'
83
100
  });
84
101
  registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
85
102
  commandId: EditorCommands.GO_LAST_EDIT.id,
86
- label: 'Last Edit Location'
103
+ label: nls.localize('vscode/editor.contribution/miLastEditLocation', 'Last Edit Location'),
104
+ order: '3'
105
+ });
106
+
107
+ registry.registerMenuAction(EditorMainMenu.LOCATION_GROUP, {
108
+ commandId: EditorCommands.GOTO_LINE_COLUMN.id,
109
+ order: '1'
87
110
  });
88
111
 
89
112
  // Toggle Commands.
@@ -94,14 +117,19 @@ export class EditorMenuContribution implements MenuContribution {
94
117
  });
95
118
  registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
96
119
  commandId: EditorCommands.TOGGLE_MINIMAP.id,
97
- label: 'Show Minimap',
120
+ label: EditorCommands.TOGGLE_MINIMAP.label,
98
121
  order: '1',
99
122
  });
100
123
  registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
101
124
  commandId: EditorCommands.TOGGLE_RENDER_WHITESPACE.id,
102
- label: 'Render Whitespace',
125
+ label: EditorCommands.TOGGLE_RENDER_WHITESPACE.label,
103
126
  order: '2'
104
127
  });
128
+ registry.registerMenuAction(CommonMenus.FILE_CLOSE, {
129
+ commandId: CommonCommands.CLOSE_MAIN_TAB.id,
130
+ label: nls.localize('vscode/editor.contribution/closeEditor', 'Close Editor'),
131
+ order: '1'
132
+ });
105
133
  }
106
134
 
107
135
  }