@@ -32,6 +32,7 @@ export async function serverActions(): Promise<void> {
32
32
const { links } = config ( "conn" ) ;
33
33
const nsEncoded = encodeURIComponent ( ns ) ;
34
34
const actions : ServerAction [ ] = [ ] ;
35
+ const wsUri = uriOfWorkspaceFolder ( ) ;
35
36
if ( ! api . externalServer ) {
36
37
actions . push ( {
37
38
detail : ( active ? "Disable" : "Enable" ) + " current connection" ,
@@ -47,7 +48,6 @@ export async function serverActions(): Promise<void> {
47
48
} ) ;
48
49
49
50
// Switching namespace makes only sense for non-ISFS folders
50
- const wsUri = uriOfWorkspaceFolder ( ) ;
51
51
if ( wsUri && notIsfs ( wsUri ) ) {
52
52
actions . push ( {
53
53
id : "switchNamespace" ,
@@ -137,7 +137,7 @@ export async function serverActions(): Promise<void> {
137
137
const classRef = `/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${ nsEncoded } ${
138
138
classname ? "&CLASSNAME=" + classnameEncoded : ""
139
139
} `;
140
- const project = new URLSearchParams ( uriOfWorkspaceFolder ( ) ?. query ) . get ( "project" ) || "" ;
140
+ const project = new URLSearchParams ( wsUri ?. query ) . get ( "project" ) || "" ;
141
141
let extraLinks = 0 ;
142
142
for ( const title in links ) {
143
143
const rawLink = String ( links [ title ] ) ;
@@ -193,7 +193,7 @@ export async function serverActions(): Promise<void> {
193
193
detail : "Select a Studio Add-in to open" ,
194
194
} ) ;
195
195
if (
196
- ! vscode . window . activeTextEditor ||
196
+ ( ! vscode . window . activeTextEditor && wsUri && notIsfs ( wsUri ) ) ||
197
197
vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_SCHEMA ||
198
198
vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_READONLY_SCHEMA
199
199
) {
0 commit comments