diff --git a/.vscode/launch.json b/.vscode/launch.json index 68b066c..96229ff 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,7 +15,15 @@ "outFiles": [ "${workspaceRoot}/out/src/**/*.js" ], + "env": { + "VSCODE_SSHFS_DEBUG": "TRUE" + }, + "windows": { + "env": { + "VSCODE_SSHFS_DEBUG": "TRUE" + } + } // "preLaunchTask": "npm:watch" } ] -} +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 719fa5f..388a481 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -29,7 +29,7 @@ interface CommandHandler { export function activate(context: vscode.ExtensionContext) { Logging.info(`Extension activated, version ${getVersion()}, mode ${context.extensionMode}`); - setDebug(context.extensionMode !== vscode.ExtensionMode.Production && !process.env.VSCODE_SSHFS_PRODUCTION); + setDebug(process.env.VSCODE_SSHFS_DEBUG?.toLowerCase() === 'true'); // Likely that we'll have a breaking change in the future that requires users to check // their configs, or at least reconfigure already existing workspaces with new URIs. diff --git a/src/logging.ts b/src/logging.ts index 416907f..fbcc093 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -9,7 +9,12 @@ export function setDebug(debug: boolean) { console.warn(`[vscode-sshfs] Debug mode set to ${debug}`); DEBUG = debug; if (!debug) return; - import('source-map-support/register').catch(e => console.warn('Could not register source-map-support:', e)); + try { require('../.pnp.cjs').setup(); } catch (e) { + console.warn('Could not set up .pnp.cjs:', e); + } + try { require('source-map-support').install(); } catch (e) { + console.warn('Could not install source-map-support:', e); + } } const outputChannel = vscode.window.createOutputChannel('SSH FS');