@@ -19,7 +19,6 @@ import {
1919} from "../utils" ;
2020import { mainCommandMenu , mainSourceControlMenu } from "./studio" ;
2121import { AtelierAPI } from "../api" ;
22- import { getCSPToken } from "../utils/getCSPToken" ;
2322import { isfsConfig } from "../utils/FileProviderUtil" ;
2423
2524type ServerAction = { detail : string ; id : string ; label : string ; rawLink ?: string } ;
@@ -224,11 +223,11 @@ export async function serverActions(): Promise<void> {
224223 }
225224 switch ( action . id ) {
226225 case "openPortal" : {
227- vscode . env . openExternal ( vscode . Uri . parse ( `${ serverUrl } ${ portalPath } ` ) ) ;
226+ vscode . commands . executeCommand ( "workbench.action.browser.open" , `${ serverUrl } ${ portalPath } ` ) ;
228227 break ;
229228 }
230229 case "openClassReference" : {
231- vscode . env . openExternal ( vscode . Uri . parse ( `${ serverUrl } ${ classRef } ` ) ) ;
230+ vscode . commands . executeCommand ( "workbench.action.browser.open" , `${ serverUrl } ${ classRef } ` ) ;
232231 break ;
233232 }
234233 case "openStudioAddin" : {
@@ -248,15 +247,12 @@ export async function serverActions(): Promise<void> {
248247 } ) ;
249248 if ( addin ) {
250249 sendStudioAddinTelemetryEvent ( addin . label ) ;
251- const token = await getCSPToken ( api , addin . id ) ;
252250 let params = `Namespace=${ nsEncoded } ` ;
253251 params += `&User=${ encodeURIComponent ( username ) } ` ;
254- if ( project !== "" ) {
252+ if ( project != "" ) {
255253 params += `&Project=${ encodeURIComponent ( project ) } ` ;
256254 }
257- params += `&CSPCHD=${ token } ` ;
258- params += "&CSPSHARE=1" ;
259- vscode . env . openExternal ( vscode . Uri . parse ( `${ serverUrl } ${ addin . id } ?${ params } ` ) ) ;
255+ vscode . commands . executeCommand ( "workbench.action.browser.open" , `${ serverUrl } ${ addin . id } ?${ params } ` ) ;
260256 }
261257 }
262258 break ;
@@ -278,16 +274,7 @@ export async function serverActions(): Promise<void> {
278274 break ;
279275 }
280276 default : {
281- let url = vscode . Uri . parse ( action . detail ) ;
282- if ( action . rawLink ?. startsWith ( "${serverUrl}" ) ) {
283- const token = await getCSPToken ( api , url . path ) ;
284- if ( token . length > 0 ) {
285- url = url . with ( {
286- query : url . query . length ? `${ url . query } &CSPCHD=${ token } ` : `CSPCHD=${ token } ` ,
287- } ) ;
288- }
289- }
290- vscode . env . openExternal ( url ) ;
277+ vscode . commands . executeCommand ( "workbench.action.browser.open" , action . detail ) ;
291278 }
292279 }
293280 } ) ;
0 commit comments