@@ -51,21 +51,24 @@ async function fetchContents(
51
51
}
52
52
53
53
/**
54
- * Shows files nested under directories in the root notebooks directory
55
- * configured on the server.
54
+ * Shows files nested under directories in the root notebooks directory configured on the server.
56
55
*/
57
56
class QuickOpenWidget extends CommandPalette {
58
57
private _pathSelected = new Signal < this, string > ( this ) ;
59
58
private _settings : ReadonlyPartialJSONObject ;
60
59
private _fileBrowser : FileBrowser ;
61
60
62
- constructor ( factory : IFileBrowserFactory , settings : ReadonlyPartialJSONObject , options : CommandPalette . IOptions ) {
61
+ constructor (
62
+ factory : IFileBrowserFactory ,
63
+ settings : ReadonlyPartialJSONObject ,
64
+ options : CommandPalette . IOptions
65
+ ) {
63
66
super ( options ) ;
64
67
65
68
this . id = 'jupyterlab-quickopen' ;
66
69
this . title . iconClass = 'jp-SideBar-tabIcon jp-SearchIcon' ;
67
70
this . title . caption = 'Quick Open' ;
68
-
71
+
69
72
this . _settings = settings ;
70
73
this . _fileBrowser = factory . defaultBrowser ;
71
74
}
@@ -103,8 +106,8 @@ class QuickOpenWidget extends CommandPalette {
103
106
// Creates commands that are relative file paths on the server
104
107
const command = `${ category } /${ fn } ` ;
105
108
if ( ! this . commands . hasCommand ( command ) ) {
106
- // Only add the command to the registry if it does not yet exist
107
- // TODO: Track disposables and remove
109
+ // Only add the command to the registry if it does not yet exist TODO: Track disposables
110
+ // and remove
108
111
this . commands . addCommand ( command , {
109
112
label : fn ,
110
113
execute : ( ) => {
@@ -146,12 +149,16 @@ const extension: JupyterFrontEndPlugin<void> = {
146
149
const settings : ISettingRegistry . ISettings = await settingRegistry . load (
147
150
extension . id
148
151
) ;
149
- const widget : QuickOpenWidget = new QuickOpenWidget ( fileBrowserFactory , settings . composite , {
150
- commands
151
- } ) ;
152
+ const widget : QuickOpenWidget = new QuickOpenWidget (
153
+ fileBrowserFactory ,
154
+ settings . composite ,
155
+ {
156
+ commands
157
+ }
158
+ ) ;
152
159
153
- // Listen for path selection signals and show the selected files in the
154
- // appropriate editor/viewer
160
+ // Listen for path selection signals and show the selected files in the appropriate
161
+ // editor/viewer
155
162
widget . pathSelected . connect ( ( sender : QuickOpenWidget , path : string ) => {
156
163
labShell . collapseLeft ( ) ;
157
164
docManager . openOrReveal ( PathExt . normalize ( path ) ) ;
@@ -162,8 +169,8 @@ const extension: JupyterFrontEndPlugin<void> = {
162
169
widget . settings = settings . composite ;
163
170
} ) ;
164
171
165
- // Add a command to activate the quickopen sidebar so that the user can
166
- // find it in the command palette, assign a hotkey, etc.
172
+ // Add a command to activate the quickopen sidebar so that the user can find it in the command
173
+ // palette, assign a hotkey, etc.
167
174
const command = 'quickopen:activate' ;
168
175
app . commands . addCommand ( command , {
169
176
label : 'Quick Open' ,
0 commit comments