mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: add lexical scope to DSL for imports
This commit is contained in:
parent
fdc427f20f
commit
0e373f69a6
1 changed files with 79 additions and 74 deletions
|
@ -632,6 +632,8 @@ defmodule Ash.Dsl.Extension do
|
|||
arg_values = unquote(args)
|
||||
|
||||
quote do
|
||||
# This `try do` block scopes the imports/unimports properly
|
||||
try do
|
||||
section_path = unquote(section_path)
|
||||
entity_name = unquote(entity_name)
|
||||
extension = unquote(extension)
|
||||
|
@ -726,6 +728,9 @@ defmodule Ash.Dsl.Extension do
|
|||
{__MODULE__, :ash, section_path ++ unquote(nested_entity_path)},
|
||||
new_config
|
||||
)
|
||||
rescue
|
||||
e -> reraise e, __STACKTRACE__
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
|
Loading…
Reference in a new issue