11import * as vscode from "vscode" ;
22import { config , workspaceState , checkConnection } from "../extension" ;
3- import { currentWorkspaceFolder , terminalWithDocker } from "../utils" ;
3+ import { currentWorkspaceFolder , terminalWithDocker , currentFile } from "../utils" ;
44
55export async function serverActions ( ) : Promise < void > {
66 const { active, host, ns, https, port : defaultPort , username, password : defaultPassword , links } = config ( "conn" ) ;
@@ -19,10 +19,18 @@ export async function serverActions(): Promise<void> {
1919 ? `&IRISUsername=${ usernameEncoded } &IRISPassword=${ passwordEncoded } `
2020 : `&CacheUserName=${ usernameEncoded } &CachePassword=${ passwordEncoded } ` ;
2121 const extraLinks = [ ] ;
22+ const file = currentFile ( ) ;
23+ const classname = file && file . name . match ( / c l s $ / i) ? file . name : "" ;
2224 for ( const title in links ) {
23- const link = String ( links [ title ] )
25+ let link = String ( links [ title ] ) ;
26+ if ( classname == "" && link . includes ( "${classname}" ) ) {
27+ continue ;
28+ }
29+ link = link
2430 . replace ( "${host}" , host )
25- . replace ( "${port}" , port ) ;
31+ . replace ( "${port}" , port )
32+ . replace ( "${namespace}" , ns == "%SYS" ? "sys" : nsEncoded . toLowerCase ( ) )
33+ . replace ( "${classname}" , classname ) ;
2634 extraLinks . push ( {
2735 id : "extraLink" + extraLinks . length ,
2836 label : title ,
0 commit comments