@jupyterlab/fileeditor-extension 3.4.1 → 4.0.0-alpha.10

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.
package/lib/commands.d.ts CHANGED
@@ -1,12 +1,15 @@
1
- import { ICommandPalette, ISessionContextDialogs, WidgetTracker } from '@jupyterlab/apputils';
1
+ import { JupyterFrontEnd } from '@jupyterlab/application';
2
+ import { ICommandPalette, ISessionContextDialogs, MainAreaWidget, WidgetTracker } from '@jupyterlab/apputils';
3
+ import { CodeViewerWidget, IEditorServices } from '@jupyterlab/codeeditor';
4
+ import { ICompletionProviderManager } from '@jupyterlab/completer';
2
5
  import { IConsoleTracker } from '@jupyterlab/console';
3
6
  import { IDocumentWidget } from '@jupyterlab/docregistry';
4
7
  import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
5
- import { FileEditor } from '@jupyterlab/fileeditor';
8
+ import { FileEditor, IEditorTracker } from '@jupyterlab/fileeditor';
6
9
  import { ILauncher } from '@jupyterlab/launcher';
7
10
  import { IMainMenu } from '@jupyterlab/mainmenu';
8
11
  import { ISettingRegistry } from '@jupyterlab/settingregistry';
9
- import { TranslationBundle } from '@jupyterlab/translation';
12
+ import { ITranslator, TranslationBundle } from '@jupyterlab/translation';
10
13
  import { CommandRegistry } from '@lumino/commands';
11
14
  import { ReadonlyJSONObject } from '@lumino/coreutils';
12
15
  /**
@@ -17,13 +20,17 @@ export declare namespace CommandIDs {
17
20
  const createNewMarkdown = "fileeditor:create-new-markdown-file";
18
21
  const changeFontSize = "fileeditor:change-font-size";
19
22
  const lineNumbers = "fileeditor:toggle-line-numbers";
23
+ const currentLineNumbers = "fileeditor:toggle-current-line-numbers";
20
24
  const lineWrap = "fileeditor:toggle-line-wrap";
25
+ const currentLineWrap = "fileeditor:toggle-current-line-wrap";
21
26
  const changeTabs = "fileeditor:change-tabs";
22
27
  const matchBrackets = "fileeditor:toggle-match-brackets";
28
+ const currentMatchBrackets = "fileeditor:toggle-current-match-brackets";
23
29
  const autoClosingBrackets = "fileeditor:toggle-autoclosing-brackets";
24
30
  const autoClosingBracketsUniversal = "fileeditor:toggle-autoclosing-brackets-universal";
25
31
  const createConsole = "fileeditor:create-console";
26
32
  const replaceSelection = "fileeditor:replace-selection";
33
+ const restartConsole = "fileeditor:restart-console";
27
34
  const runCode = "fileeditor:run-code";
28
35
  const runAllCode = "fileeditor:run-all";
29
36
  const markdownPreview = "fileeditor:markdown-preview";
@@ -33,6 +40,9 @@ export declare namespace CommandIDs {
33
40
  const copy = "fileeditor:copy";
34
41
  const paste = "fileeditor:paste";
35
42
  const selectAll = "fileeditor:select-all";
43
+ const invokeCompleter = "completer:invoke-file";
44
+ const selectCompleter = "completer:select-file";
45
+ const openCodeViewer = "code-viewer:open";
36
46
  }
37
47
  export interface IFileTypeData extends ReadonlyJSONObject {
38
48
  fileExt: string;
@@ -66,85 +76,8 @@ export declare namespace Commands {
66
76
  /**
67
77
  * Wrapper function for adding the default File Editor commands
68
78
  */
69
- function addCommands(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string, isEnabled: () => boolean, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, browserFactory: IFileBrowserFactory): void;
70
- /**
71
- * Add a command to change font size for File Editor
72
- */
73
- function addChangeFontSizeCommand(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string): void;
74
- /**
75
- * Add the Line Numbers command
76
- */
77
- function addLineNumbersCommand(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string, isEnabled: () => boolean): void;
78
- /**
79
- * Add the Word Wrap command
80
- */
81
- function addWordWrapCommand(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string, isEnabled: () => boolean): void;
82
- /**
83
- * Add command for changing tabs size or type in File Editor
84
- */
85
- function addChangeTabsCommand(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string): void;
86
- /**
87
- * Add the Match Brackets command
88
- */
89
- function addMatchBracketsCommand(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string, isEnabled: () => boolean): void;
90
- /**
91
- * Add the Auto Close Brackets for Text Editor command
92
- */
93
- function addAutoClosingBracketsCommand(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string): void;
94
- /**
95
- * Add the replace selection for text editor command
96
- */
97
- function addReplaceSelectionCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
98
- /**
99
- * Add the Create Console for Editor command
100
- */
101
- function addCreateConsoleCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
102
- /**
103
- * Add the Run Code command
104
- */
105
- function addRunCodeCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
106
- /**
107
- * Add the Run All Code command
108
- */
109
- function addRunAllCodeCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
110
- /**
111
- * Add markdown preview command
112
- */
113
- function addMarkdownPreviewCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle): void;
114
- /**
115
- * Add undo command
116
- */
117
- function addUndoCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
118
- /**
119
- * Add redo command
120
- */
121
- function addRedoCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
122
- /**
123
- * Add cut command
124
- */
125
- function addCutCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
126
- /**
127
- * Add copy command
128
- */
129
- function addCopyCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
130
- /**
131
- * Add paste command
132
- */
133
- function addPasteCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
134
- /**
135
- * Add select all command
136
- */
137
- function addSelectAllCommand(commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, isEnabled: () => boolean): void;
138
- /**
139
- * Add the New File command
140
- *
141
- * Defaults to Text/.txt if file type data is not specified
142
- */
143
- function addCreateNewCommand(commands: CommandRegistry, browserFactory: IFileBrowserFactory, trans: TranslationBundle): void;
144
- /**
145
- * Add the New Markdown File command
146
- */
147
- function addCreateNewMarkdownCommand(commands: CommandRegistry, browserFactory: IFileBrowserFactory, trans: TranslationBundle): void;
79
+ function addCommands(commands: CommandRegistry, settingRegistry: ISettingRegistry, trans: TranslationBundle, id: string, isEnabled: () => boolean, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, browserFactory: IFileBrowserFactory, consoleTracker: IConsoleTracker | null, sessionDialogs: ISessionContextDialogs | null): void;
80
+ function addCompleterCommands(commands: CommandRegistry, editorTracker: IEditorTracker, manager: ICompletionProviderManager, translator: ITranslator | null): void;
148
81
  /**
149
82
  * Wrapper function for adding the default launcher items for File Editor
150
83
  */
@@ -188,25 +121,14 @@ export declare namespace Commands {
188
121
  /**
189
122
  * Wrapper function for adding the default menu items for File Editor
190
123
  */
191
- function addMenuItems(menu: IMainMenu, commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle, consoleTracker: IConsoleTracker | null, sessionDialogs: ISessionContextDialogs | null): void;
124
+ function addMenuItems(menu: IMainMenu, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, consoleTracker: IConsoleTracker | null, isEnabled: () => boolean): void;
192
125
  /**
193
126
  * Add Create New ___ File commands to the File menu for common file types associated with available kernels
194
127
  */
195
128
  function addKernelLanguageMenuItems(menu: IMainMenu, availableKernelFileTypes: Iterable<IFileTypeData>): void;
196
- /**
197
- * Add File Editor undo and redo widgets to the Edit menu
198
- */
199
- function addUndoRedoToEditMenu(menu: IMainMenu, tracker: WidgetTracker<IDocumentWidget<FileEditor>>): void;
200
- /**
201
- * Add a File Editor editor viewer to the View Menu
202
- */
203
- function addEditorViewerToViewMenu(menu: IMainMenu, tracker: WidgetTracker<IDocumentWidget<FileEditor>>): void;
204
- /**
205
- * Add a File Editor console creator to the File menu
206
- */
207
- function addConsoleCreatorToFileMenu(menu: IMainMenu, commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, trans: TranslationBundle): void;
208
129
  /**
209
130
  * Add a File Editor code runner to the Run menu
210
131
  */
211
- function addCodeRunnersToRunMenu(menu: IMainMenu, commands: CommandRegistry, tracker: WidgetTracker<IDocumentWidget<FileEditor>>, consoleTracker: IConsoleTracker, trans: TranslationBundle, sessionDialogs: ISessionContextDialogs | null): void;
132
+ function addCodeRunnersToRunMenu(menu: IMainMenu, consoleTracker: IConsoleTracker): void;
133
+ function addOpenCodeViewerCommand(app: JupyterFrontEnd, editorServices: IEditorServices, tracker: WidgetTracker<MainAreaWidget<CodeViewerWidget>>, trans: TranslationBundle): void;
212
134
  }