11import * as vscode from "vscode" ;
2- import { config , workspaceState , checkConnection } from "../extension" ;
2+ import { config , workspaceState , checkConnection , FILESYSTEM_SCHEMA } from "../extension" ;
33import { currentWorkspaceFolder , terminalWithDocker , currentFile } from "../utils" ;
4+ import { mainMenu } from "./studio" ;
45
56export async function serverActions ( ) : Promise < void > {
67 const { active, host, ns, https, port : defaultPort , username, password : defaultPassword , links } = config ( "conn" ) ;
@@ -45,34 +46,43 @@ export async function serverActions(): Promise<void> {
4546 detail : "Use docker-compose to start session inside configured service" ,
4647 } ) ;
4748 }
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+ }
4857 return vscode . window
4958 . showQuickPick (
5059 [
5160 ...extraLinks ,
5261 {
5362 id : "refreshConnection" ,
54- label : "Refresh connection " ,
63+ label : "Refresh Connection " ,
5564 detail : "Force attempt to connect to the server" ,
5665 } ,
5766 ...terminal ,
5867 {
59- detail : "Enable/Disable current connection" ,
6068 id : "toggleConnection" ,
61- label : "Toggle connection" ,
69+ label : "Toggle Connection" ,
70+ detail : "Enable/Disable current connection" ,
6271 } ,
6372 {
64- detail : portalUrl ,
6573 id : "openPortal" ,
6674 label : "Open Management Portal" ,
75+ detail : portalUrl ,
6776 } ,
6877 {
69- detail : classRef ,
7078 id : "openClassReference" ,
71- label : "Open class reference" ,
79+ label : "Open Class Reference" ,
80+ detail : classRef ,
7281 } ,
82+ ...studio ,
7383 ] ,
7484 {
75- placeHolder : `Select action for server: ${ connInfo } ` ,
85+ placeHolder : `Select action for server ${ connInfo } ` ,
7686 }
7787 )
7888 . then ( action => {
@@ -99,6 +109,10 @@ export async function serverActions(): Promise<void> {
99109 terminalWithDocker ( ) ;
100110 break ;
101111 }
112+ case "studioAction" : {
113+ mainMenu ( ) ;
114+ break ;
115+ }
102116 default : {
103117 vscode . env . openExternal ( vscode . Uri . parse ( action . detail ) ) ;
104118 }
0 commit comments