@@ -59,22 +59,25 @@ export async function serverActions(): Promise<void> {
59
59
return ;
60
60
} ) ;
61
61
}
62
+ const file = currentFile ( ) ;
63
+ const classname = file && file . name . toLowerCase ( ) . endsWith ( ".cls" ) ? file . name . slice ( 0 , - 4 ) : "" ;
64
+ const classnameEncoded = encodeURIComponent ( classname ) ;
62
65
const connInfo = `${ host } :${ port } [${ nsEncoded } ]` ;
63
66
const serverUrl = `${ https ? "https" : "http" } ://${ host } :${ port } ` ;
64
67
const portalUrl = `${ serverUrl } /csp/sys/UtilHome.csp?$NAMESPACE=${ nsEncoded } ` ;
65
- const classRef = `${ serverUrl } /csp/documatic/%25CSP.Documatic.cls?LIBRARY=${ nsEncoded } ` ;
68
+ const classRef = `${ serverUrl } /csp/documatic/%25CSP.Documatic.cls?LIBRARY=${ nsEncoded } ${
69
+ classname ? "&CLASSNAME=" + classnameEncoded : ""
70
+ } `;
66
71
const iris = workspaceState . get ( workspaceFolder + ":iris" , false ) ;
67
72
const usernameEncoded = encodeURIComponent ( username ) ;
68
73
const passwordEncoded = encodeURIComponent ( password ) ;
69
74
const auth = iris
70
75
? `&IRISUsername=${ usernameEncoded } &IRISPassword=${ passwordEncoded } `
71
76
: `&CacheUserName=${ usernameEncoded } &CachePassword=${ passwordEncoded } ` ;
72
77
let extraLinks = 0 ;
73
- const file = currentFile ( ) ;
74
- const classname = file && file . name . match ( / c l s $ / i) ? file . name : "" ;
75
78
for ( const title in links ) {
76
79
let link = String ( links [ title ] ) ;
77
- if ( classname == "" && link . includes ( "${classname}" ) ) {
80
+ if ( classname == "" && ( link . includes ( "${classname}" ) || link . includes ( "${classnameEncoded}" ) ) ) {
78
81
continue ;
79
82
}
80
83
link = link
@@ -84,7 +87,8 @@ export async function serverActions(): Promise<void> {
84
87
. replace ( "${serverAuth}" , auth )
85
88
. replace ( "${ns}" , nsEncoded )
86
89
. replace ( "${namespace}" , ns == "%SYS" ? "sys" : nsEncoded . toLowerCase ( ) )
87
- . replace ( "${classname}" , classname ) ;
90
+ . replace ( "${classname}" , classname )
91
+ . replace ( "${classnameEncoded}" , classnameEncoded ) ;
88
92
actions . push ( {
89
93
id : "extraLink" + extraLinks ++ ,
90
94
label : title ,
@@ -99,14 +103,14 @@ export async function serverActions(): Promise<void> {
99
103
} ) ;
100
104
}
101
105
actions . push ( {
102
- detail : portalUrl ,
103
106
id : "openPortal" ,
104
107
label : "Open Management Portal" ,
108
+ detail : portalUrl ,
105
109
} ) ;
106
110
actions . push ( {
107
- detail : classRef ,
108
111
id : "openClassReference" ,
109
- label : "Open Class Reference" ,
112
+ label : "Open Class Reference" + ( classname ? ` for ${ classname } ` : "" ) ,
113
+ detail : classRef ,
110
114
} ) ;
111
115
if (
112
116
! vscode . window . activeTextEditor ||
0 commit comments