@@ -55,6 +55,9 @@ function functions.exec(scope)
55
55
local req_results = {}
56
56
57
57
if scope == " cursor" then
58
+ -- Load environment variables from the env file before parsing the request
59
+ env_vars .read_file (true )
60
+
58
61
local req = parser .parse (
59
62
--- @diagnostic disable-next-line param-type-mismatch
60
63
parser .look_behind_until (parser .get_node_at_cursor (), " request" )
@@ -65,8 +68,6 @@ function functions.exec(scope)
65
68
-- Set up a _rest_nvim_req_data Lua global table that holds the parsed request
66
69
-- so the values can be modified from the pre-request hooks
67
70
_G ._rest_nvim_req_data = req
68
- -- Load environment variables from the env file
69
- env_vars .read_file (true )
70
71
-- Run pre-request hooks
71
72
api .exec_pre_request_hooks ()
72
73
-- Clean the _rest_nvim_req_data global after running the pre-request hooks
@@ -98,8 +99,6 @@ function functions.exec(scope)
98
99
-- Set up a _rest_nvim_req_data Lua global table that holds the parsed request
99
100
-- so the values can be modified from the pre-request hooks
100
101
_G ._rest_nvim_req_data = req
101
- -- Load environment variables from the env file
102
- env_vars .read_file (true )
103
102
-- Run pre-request hooks
104
103
api .exec_pre_request_hooks ()
105
104
-- Clean the _rest_nvim_req_data global after running the pre-request hooks
0 commit comments