Skip to content

Commit 2bfde49

Browse files
Assigned variables to environment
1 parent 1722f46 commit 2bfde49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/extension.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ import { DocsBrowser } from './docsBrowser';
2525
import { downloadHaskellLanguageServer } from './hlsBinaries';
2626
import { directoryExists, executableExists, ExtensionLogger, resolvePathPlaceHolders } from './utils';
2727

28+
// Used for environment variables later on
29+
interface IEnvVars {
30+
[key: string]: string;
31+
}
32+
2833
// The current map of documents & folders to language servers.
2934
// It may be null to indicate that we are in the process of launching a server,
3035
// in which case don't try to launch another one for that uri
@@ -203,6 +208,11 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
203208
args = args.concat(extraArgs.split(' '));
204209
}
205210

211+
const envVars: IEnvVars = workspace.getConfiguration('haskell', uri).envVars;
212+
for (const [key, val] of Object.entries(envVars)) {
213+
process.env[key] = val;
214+
}
215+
206216
// If we're operating on a standalone file (i.e. not in a folder) then we need
207217
// to launch the server in a reasonable current directory. Otherwise the cradle
208218
// guessing logic in hie-bios will be wrong!

0 commit comments

Comments
 (0)