@@ -7,34 +7,16 @@ import {
77 FILESYSTEM_READONLY_SCHEMA ,
88 explorerProvider ,
99} from "../extension" ;
10- import {
11- connectionTarget ,
12- terminalWithDocker ,
13- shellWithDocker ,
14- currentFile ,
15- } from "../utils" ;
10+ import { connectionTarget , terminalWithDocker , shellWithDocker , currentFile } from "../utils" ;
1611import { mainCommandMenu , mainSourceControlMenu } from "./studio" ;
1712import { AtelierAPI } from "../api" ;
1813import { getCSPToken } from "../utils/getCSPToken" ;
1914
20- type ServerAction = {
21- detail : string ;
22- id : string ;
23- label : string ;
24- rawLink ?: string ;
25- } ;
15+ type ServerAction = { detail : string ; id : string ; label : string ; rawLink ?: string } ;
2616export async function serverActions ( ) : Promise < void > {
2717 const { apiTarget, configName : workspaceFolder } = connectionTarget ( ) ;
2818 const api = new AtelierAPI ( apiTarget ) ;
29- const {
30- active,
31- host = "" ,
32- ns = "" ,
33- https,
34- port = 0 ,
35- pathPrefix,
36- docker,
37- } = api . config ;
19+ const { active, host = "" , ns = "" , https, port = 0 , pathPrefix, docker } = api . config ;
3820 const explorerCount = ( await explorerProvider . getChildren ( ) ) . length ;
3921 if ( ! explorerCount && ( ! docker || host === "" ) ) {
4022 await vscode . commands . executeCommand ( "ObjectScriptExplorer.focus" ) ;
@@ -56,9 +38,7 @@ export async function serverActions(): Promise<void> {
5638 detail : "Force attempt to connect to the server" ,
5739 } ) ;
5840 }
59- const connectionActionsHandler = async (
60- action : ServerAction
61- ) : Promise < ServerAction > => {
41+ const connectionActionsHandler = async ( action : ServerAction ) : Promise < ServerAction > => {
6242 if ( ! action ) {
6343 return ;
6444 }
@@ -69,13 +49,8 @@ export async function serverActions(): Promise<void> {
6949 ? vscode . ConfigurationTarget . WorkspaceFolder
7050 : vscode . ConfigurationTarget . Workspace ;
7151 const targetConfig =
72- connConfig . inspect ( "conn" ) . workspaceFolderValue ||
73- connConfig . inspect ( "conn" ) . workspaceValue ;
74- return connConfig . update (
75- "conn" ,
76- { ...targetConfig , active : ! active } ,
77- target
78- ) ;
52+ connConfig . inspect ( "conn" ) . workspaceFolderValue || connConfig . inspect ( "conn" ) . workspaceValue ;
53+ return connConfig . update ( "conn" , { ...targetConfig , active : ! active } , target ) ;
7954 }
8055 case "refreshConnection" : {
8156 await checkConnection ( true , undefined , true ) ;
@@ -94,15 +69,10 @@ export async function serverActions(): Promise<void> {
9469 } ) ;
9570 }
9671 const file = currentFile ( ) ;
97- const classname =
98- file && file . name . toLowerCase ( ) . endsWith ( ".cls" )
99- ? file . name . slice ( 0 , - 4 )
100- : "" ;
72+ const classname = file && file . name . toLowerCase ( ) . endsWith ( ".cls" ) ? file . name . slice ( 0 , - 4 ) : "" ;
10173 const classnameEncoded = encodeURIComponent ( classname ) ;
10274 const connInfo = `${ host } :${ port } ${ pathPrefix } [${ nsEncoded . toUpperCase ( ) } ]` ;
103- const serverUrl = `${
104- https ? "https" : "http"
105- } ://${ host } :${ port } ${ pathPrefix } `;
75+ const serverUrl = `${ https ? "https" : "http" } ://${ host } :${ port } ${ pathPrefix } ` ;
10676 const portalPath = `/csp/sys/UtilHome.csp?$NAMESPACE=${ nsEncoded } ` ;
10777 const classRef = `/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${ nsEncoded } ${
10878 classname ? "&CLASSNAME=" + classnameEncoded : ""
@@ -111,11 +81,7 @@ export async function serverActions(): Promise<void> {
11181 for ( const title in links ) {
11282 const rawLink = String ( links [ title ] ) ;
11383 // Skip link if it requires a classname and we don't currently have one
114- if (
115- classname == "" &&
116- ( rawLink . includes ( "${classname}" ) ||
117- rawLink . includes ( "${classnameEncoded}" ) )
118- ) {
84+ if ( classname == "" && ( rawLink . includes ( "${classname}" ) || rawLink . includes ( "${classnameEncoded}" ) ) ) {
11985 continue ;
12086 }
12187 const link = rawLink
@@ -161,8 +127,7 @@ export async function serverActions(): Promise<void> {
161127 if (
162128 ! vscode . window . activeTextEditor ||
163129 vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_SCHEMA ||
164- vscode . window . activeTextEditor . document . uri . scheme ===
165- FILESYSTEM_READONLY_SCHEMA
130+ vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_READONLY_SCHEMA
166131 ) {
167132 actions . push ( {
168133 id : "serverSourceControlMenu" ,
0 commit comments