@@ -71,7 +71,7 @@ import { ObjectScriptRoutineSymbolProvider } from "./providers/ObjectScriptRouti
7171import { ObjectScriptCodeLensProvider } from "./providers/ObjectScriptCodeLensProvider" ;
7272import { XmlContentProvider } from "./providers/XmlContentProvider" ;
7373
74- import { AtelierAPI } from "./api" ;
74+ import { AtelierAPI , ConnectionSettings } from "./api" ;
7575import { ObjectScriptDebugAdapterDescriptorFactory } from "./debug/debugAdapterFactory" ;
7676import { ObjectScriptConfigurationProvider } from "./debug/debugConfProvider" ;
7777import { ProjectsExplorerProvider } from "./explorer/projectsExplorer" ;
@@ -155,7 +155,15 @@ const lowCodeEditorViewType = packageJson.contributes.customEditors[0].viewType;
155155
156156const _onDidChangeConnection = new vscode . EventEmitter < void > ( ) ;
157157
158- export const config = ( setting ?: string , workspaceFolderName ?: string ) : vscode . WorkspaceConfiguration | any => {
158+ type ConnConfig = Pick < ConnectionSettings , "active" | "https" | "ns" | "host" | "port" | "auth" > & {
159+ "docker-compose" ?: any ;
160+ server ?: any ;
161+ links ?: any ;
162+ } ;
163+
164+ export function config ( setting : "conn" , workspaceFolderName ?: string ) : ConnConfig ;
165+ export function config ( setting ?: string , workspaceFolderName ?: string ) : any ;
166+ export function config ( setting ?: string , workspaceFolderName ?: string ) : any {
159167 workspaceFolderName = workspaceFolderName || currentWorkspaceFolder ( ) ;
160168 if (
161169 vscode . workspace . workspaceFolders ?. length &&
@@ -181,16 +189,17 @@ export const config = (setting?: string, workspaceFolderName?: string): vscode.W
181189 const { port, hostname : host , auth, query } = url . parse ( "http://" + workspaceFolderName , true ) ;
182190 const { ns = "USER" , https = false } = query ;
183191 const [ username , password ] = ( auth || "_SYSTEM:SYS" ) . split ( ":" ) ;
192+ const authorization = serverManagerApi . defaultAuth ( ) ;
193+ authorization . resolve ( { username, accessToken : password } ) ;
184194 if ( setting == "conn" ) {
185195 return {
186196 active : true ,
187197 https,
188198 ns,
189199 host,
190- port,
191- username,
192- password,
193- } ;
200+ port : + port ,
201+ auth : authorization ,
202+ } as ConnConfig ;
194203 } else if ( setting == "export" ) {
195204 return { } ;
196205 }
@@ -199,7 +208,7 @@ export const config = (setting?: string, workspaceFolderName?: string): vscode.W
199208 }
200209 const result = vscode . workspace . getConfiguration ( prefix , workspaceFolder ?. uri ) ;
201210 return setting && setting . length ? result . get ( setting ) : result ;
202- } ;
211+ }
203212
204213let reporter : TelemetryReporter ;
205214
0 commit comments