Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace environment variables #495

Merged
merged 2 commits into from
Nov 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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 @@ -126,6 +126,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 @@ -174,6 +175,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