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

recompute env dict on every command #1322

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Unreleased

- Fix direnv compatibility by loading the process.env on every command (#1322)

## 1.14.2

- Add `1.17.0` to the list of known versions of ocamllsp
Expand Down
2 changes: 1 addition & 1 deletion src-bindings/node/node.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Process = struct

let set k v = Ojs.set_prop_ascii env k ([%js.of: string] v)

include [%js: val env : string Interop.Dict.t [@@js.global "process.env"]]
smorimoto marked this conversation as resolved.
Show resolved Hide resolved
let env () = Interop.Dict.t_of_js [%js.to: string] env
end
end

Expand Down
2 changes: 1 addition & 1 deletion src-bindings/node/node.mli
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Process : sig

val set : string -> string -> unit

val env : string Interop.Dict.t
val env : unit -> string Interop.Dict.t
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/extension_instance.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ end = struct
in
Interop.Dict.union
(fun _k _v1 v2 -> Some v2)
Process.Env.env
(Process.Env.env ())
extra_env_vars
in
match command with
Expand Down