1
1
import * as vscode from "vscode" ;
2
- import { config , workspaceState , checkConnection } from "../extension" ;
2
+ import { config , workspaceState , checkConnection , FILESYSTEM_SCHEMA } from "../extension" ;
3
3
import { currentWorkspaceFolder , terminalWithDocker , currentFile } from "../utils" ;
4
+ import { mainMenu } from "./studio" ;
4
5
5
6
export async function serverActions ( ) : Promise < void > {
6
7
const { active, host, ns, https, port : defaultPort , username, password : defaultPassword , links } = config ( "conn" ) ;
@@ -45,34 +46,43 @@ export async function serverActions(): Promise<void> {
45
46
detail : "Use docker-compose to start session inside configured service" ,
46
47
} ) ;
47
48
}
49
+ const studio = [ ] ;
50
+ if ( ! vscode . window . activeTextEditor || vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_SCHEMA ) {
51
+ studio . push ( {
52
+ id : "studioAction" ,
53
+ label : "Server Source Control..." ,
54
+ detail : "Pick server-side source control action" ,
55
+ } ) ;
56
+ }
48
57
return vscode . window
49
58
. showQuickPick (
50
59
[
51
60
...extraLinks ,
52
61
{
53
62
id : "refreshConnection" ,
54
- label : "Refresh connection " ,
63
+ label : "Refresh Connection " ,
55
64
detail : "Force attempt to connect to the server" ,
56
65
} ,
57
66
...terminal ,
58
67
{
59
- detail : "Enable/Disable current connection" ,
60
68
id : "toggleConnection" ,
61
- label : "Toggle connection" ,
69
+ label : "Toggle Connection" ,
70
+ detail : "Enable/Disable current connection" ,
62
71
} ,
63
72
{
64
- detail : portalUrl ,
65
73
id : "openPortal" ,
66
74
label : "Open Management Portal" ,
75
+ detail : portalUrl ,
67
76
} ,
68
77
{
69
- detail : classRef ,
70
78
id : "openClassReference" ,
71
- label : "Open class reference" ,
79
+ label : "Open Class Reference" ,
80
+ detail : classRef ,
72
81
} ,
82
+ ...studio ,
73
83
] ,
74
84
{
75
- placeHolder : `Select action for server: ${ connInfo } ` ,
85
+ placeHolder : `Select action for server ${ connInfo } ` ,
76
86
}
77
87
)
78
88
. then ( action => {
@@ -99,6 +109,10 @@ export async function serverActions(): Promise<void> {
99
109
terminalWithDocker ( ) ;
100
110
break ;
101
111
}
112
+ case "studioAction" : {
113
+ mainMenu ( ) ;
114
+ break ;
115
+ }
102
116
default : {
103
117
vscode . env . openExternal ( vscode . Uri . parse ( action . detail ) ) ;
104
118
}
0 commit comments