Fix issue with debug mode on code-server (fixes #279)

issue/311
Kelvin Schoofs 3 years ago
parent bfae800a5a
commit 05e1b6995f

@ -15,6 +15,14 @@
"outFiles": [ "outFiles": [
"${workspaceRoot}/out/src/**/*.js" "${workspaceRoot}/out/src/**/*.js"
], ],
"env": {
"VSCODE_SSHFS_DEBUG": "TRUE"
},
"windows": {
"env": {
"VSCODE_SSHFS_DEBUG": "TRUE"
}
}
// "preLaunchTask": "npm:watch" // "preLaunchTask": "npm:watch"
} }
] ]

@ -29,7 +29,7 @@ interface CommandHandler {
export function activate(context: vscode.ExtensionContext) { export function activate(context: vscode.ExtensionContext) {
Logging.info(`Extension activated, version ${getVersion()}, mode ${context.extensionMode}`); 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 // 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. // their configs, or at least reconfigure already existing workspaces with new URIs.

@ -9,7 +9,12 @@ export function setDebug(debug: boolean) {
console.warn(`[vscode-sshfs] Debug mode set to ${debug}`); console.warn(`[vscode-sshfs] Debug mode set to ${debug}`);
DEBUG = debug; DEBUG = debug;
if (!debug) return; 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'); const outputChannel = vscode.window.createOutputChannel('SSH FS');

Loading…
Cancel
Save