Skip to content

Commit 476e1dc

Browse files
committed
Log environment variables on extension activation
1 parent 30f6cbc commit 476e1dc

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

integration/vscode/ada/src/extension.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,23 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
111111
// for the Ada and Gpr language servers, and this one is a general channel
112112
// for non-LSP features of the extension.
113113
mainLogChannel = vscode.window.createOutputChannel('Ada Extension');
114+
mainLogChannel.appendLine('Starting Ada extension');
114115

115116
context.subscriptions.push(
116117
vscode.commands.registerCommand('ada.showExtensionOutput', () => mainLogChannel.show())
117118
);
118119

120+
// Log the environment that the extension (and all VS Code) will be using
121+
const customEnv = getEvaluatedCustomEnv();
122+
123+
if (customEnv && Object.keys(customEnv).length > 0) {
124+
mainLogChannel.appendLine('Setting environment variables:');
125+
for (const varName in customEnv) {
126+
const varValue: string = customEnv[varName];
127+
mainLogChannel.appendLine(`${varName}=${varValue}`);
128+
}
129+
}
130+
119131
// Create the GPR language client and start it.
120132
const gprClient = createClient(
121133
context,
@@ -159,6 +171,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
159171
);
160172
await Promise.all([alsClient.onReady(), gprClient.onReady()]);
161173
await checkSrcDirectories(alsClient);
174+
mainLogChannel.appendLine('Started Ada extension');
162175
}
163176

164177
function createClient(

integration/vscode/ada/src/helpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ export function getCustomEnv() {
120120
env_config_name += '.linux';
121121
}
122122

123-
const custom_env = vscode.workspace.getConfiguration().get<[string]>(env_config_name);
123+
const custom_env = vscode.workspace
124+
.getConfiguration()
125+
.get<{ [name: string]: string }>(env_config_name);
124126

125127
return custom_env;
126128
}

0 commit comments

Comments
 (0)