@@ -18,54 +18,52 @@ export async function addServerNamespaceToWorkspace(): Promise<void> {
18
18
// Get its namespace list
19
19
let uri = vscode . Uri . parse ( `isfs://${ serverName } /?ns=%SYS` ) ;
20
20
const api = new AtelierAPI ( uri ) ;
21
- const allNamespaces : string [ ] = await api
22
- . serverInfo ( )
23
- . then ( ( data ) => data . result . content . namespaces
24
- ) ;
21
+ const allNamespaces : string [ ] = await api . serverInfo ( ) . then ( ( data ) => data . result . content . namespaces ) ;
25
22
// Prepare a displayable form of its connection spec as a hint to the user
26
23
const connSpec = await serverManagerApi . getServerSpec ( serverName ) ;
27
24
const connDisplayString = `${ connSpec . webServer . scheme } ://${ connSpec . webServer . host } :${ connSpec . webServer . port } /${ connSpec . webServer . pathPrefix } ` ;
28
25
// Get user's choice of namespace
29
- const namespace = await vscode . window . showQuickPick (
30
- allNamespaces ,
31
- {
32
- placeHolder : `Namespace on server '${ serverName } ' (${ connDisplayString } )`
33
- }
34
- ) ;
26
+ const namespace = await vscode . window . showQuickPick ( allNamespaces , {
27
+ placeHolder : `Namespace on server '${ serverName } ' (${ connDisplayString } )` ,
28
+ } ) ;
35
29
if ( ! namespace ) {
36
30
return ;
37
31
}
38
32
// Pick between isfs and isfs-readonly
39
33
const editable = await vscode . window . showQuickPick (
40
34
[
41
- { value : true , label : "Editable" , detail : "Documents opened from this folder will be editable directly on the server." } ,
42
- { value : false , label : "Read-only" , detail : "Documents opened from this folder will be read-only." }
35
+ {
36
+ value : true ,
37
+ label : "Editable" ,
38
+ detail : "Documents opened from this folder will be editable directly on the server." ,
39
+ } ,
40
+ { value : false , label : "Read-only" , detail : "Documents opened from this folder will be read-only." } ,
43
41
] ,
44
42
{ placeHolder : "Choose the mode of access" }
45
43
) ;
46
44
// Prepare the folder parameters
47
45
const label = editable . value ? `${ serverName } :${ namespace } ` : `${ serverName } :${ namespace } (read-only)` ;
48
46
uri = uri . with ( { scheme : editable . value ? "isfs" : "isfs-readonly" , query : `ns=${ namespace } ` } ) ;
49
47
// Append it to the workspace
50
- const added = vscode . workspace . updateWorkspaceFolders ( vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders . length : 0 , 0 , { uri, name : label } ) ;
48
+ const added = vscode . workspace . updateWorkspaceFolders (
49
+ vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders . length : 0 ,
50
+ 0 ,
51
+ { uri, name : label }
52
+ ) ;
51
53
// Switch to Explorer view so user sees the outcome
52
- vscode . commands . executeCommand ( ' workbench.view.explorer' ) ;
54
+ vscode . commands . executeCommand ( " workbench.view.explorer" ) ;
53
55
// Handle failure
54
56
if ( ! added ) {
55
- vscode . window . showErrorMessage (
56
- "Folder not added. Maybe it already exists on the workspace." ,
57
- "Retry" ,
58
- "Close"
59
- )
57
+ vscode . window
58
+ . showErrorMessage ( "Folder not added. Maybe it already exists on the workspace." , "Retry" , "Close" )
60
59
. then ( ( value ) => {
61
60
if ( value === "Retry" ) {
62
- vscode . commands . executeCommand ( ' vscode-objectscript.addServerNamespaceToWorkspace' ) ;
61
+ vscode . commands . executeCommand ( " vscode-objectscript.addServerNamespaceToWorkspace" ) ;
63
62
}
64
63
} ) ;
65
64
}
66
65
}
67
66
68
-
69
67
async function getServerManagerApi ( ) : Promise < any > {
70
68
const targetExtension = vscode . extensions . getExtension ( "intersystems-community.servermanager" ) ;
71
69
if ( ! targetExtension ) {
0 commit comments