Skip to content

Commit

Permalink
recompute env dict on every command (#1322)
Browse files Browse the repository at this point in the history
* recompute env dict on every command

* changelog
  • Loading branch information
EduardoRFS committed Jan 5, 2024
1 parent 0bbcdb3 commit 69df56f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
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"]]
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

0 comments on commit 69df56f

Please sign in to comment.