Skip to content

Commit

Permalink
expand struct and record fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Aug 13, 2024
1 parent dcd2bda commit 0b805ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/elixir_sense/core/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,8 @@ defmodule ElixirSense.Core.Compiler do
"#{inspect(module)}, defstruct can only be called once per module"
end

{fields, state, env} = expand(fields, state, env)

fields =
case fields do
fs when is_list(fs) ->
Expand Down Expand Up @@ -1251,13 +1253,14 @@ defmodule ElixirSense.Core.Compiler do
meta,
Record,
call,
[name, _] = args,
[_name, _fields] = args,
_callback,
state,
env = %{module: module}
)
when call in [:defrecord, :defrecordp] and module != nil do
range = extract_range(meta)
{[name, _fields] = args, state, env} = expand(args, state, env)

type =
case call do
Expand Down

0 comments on commit 0b805ad

Please sign in to comment.