Skip to content

Commit

Permalink
Trace env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
jneira committed Nov 3, 2021
1 parent 257e5ae commit 3b2c9cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function findManualExecutable(logger: Logger, uri: Uri, folder?: WorkspaceFolder
if (!executableExists(exePath)) {
let msg = `serverExecutablePath is set to ${exePath}`;
if (directoryExists(exePath)) {
msg += ' but it is a directory and the config option should point to the executable full path';
msg += ' but it is a directory and the config option should point to the executable file full path';
} else {
msg += " but it doesn't exist and it is not on the PATH";
}
Expand All @@ -121,6 +121,7 @@ function findManualExecutable(logger: Logger, uri: Uri, folder?: WorkspaceFolder
function findLocalServer(context: ExtensionContext, logger: Logger, uri: Uri, folder?: WorkspaceFolder): string | null {
const exes: string[] = ['haskell-language-server-wrapper', 'haskell-language-server'];
logger.info(`Searching for server executables ${exes.join(',')} in $PATH`);
logger.info(`$PATH environment variable: ${process.env.PATH}`);
for (const exe of exes) {
if (executableExists(exe)) {
logger.info(`Found server executable in $PATH: ${exe}`);
Expand Down Expand Up @@ -169,6 +170,11 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold

const logger: Logger = new ExtensionLogger('client', clientLogLevel, outputChannel);

logger.info('Environment variables:');
Object.entries(process.env).forEach(([key, value]: [string, string | undefined]) => {
logger.info(` ${key}: ${value}`);
});

let serverExecutable;
try {
// Try and find local installations first
Expand Down

0 comments on commit 3b2c9cf

Please sign in to comment.