diff --git a/lib/elixir_sense/core/metadata_builder.ex b/lib/elixir_sense/core/metadata_builder.ex index 4ab93f3b..b0f18d2b 100644 --- a/lib/elixir_sense/core/metadata_builder.ex +++ b/lib/elixir_sense/core/metadata_builder.ex @@ -66,7 +66,30 @@ defmodule ElixirSense.Core.MetadataBuilder do ) ) - state + vars_info_per_scope_id = + try do + update_vars_info_per_scope_id(state) + rescue + _ -> + state.vars_info_per_scope_id + end + + %{ + state + | attributes: [], + scope_attributes: [], + behaviours: [], + aliases: [], + imports: [], + requires: [], + scope_ids: [], + vars: [], + scope_vars: [], + vars_info_per_scope_id: vars_info_per_scope_id, + namespace: [], + scopes: [], + protocols: [] + } end end diff --git a/lib/elixir_sense/core/state.ex b/lib/elixir_sense/core/state.ex index bc44e0e7..263f1acd 100644 --- a/lib/elixir_sense/core/state.ex +++ b/lib/elixir_sense/core/state.ex @@ -878,7 +878,7 @@ defmodule ElixirSense.Core.State do } end - defp update_vars_info_per_scope_id(state) do + def update_vars_info_per_scope_id(state) do [scope_id | _other_scope_ids] = state.scope_ids [current_scope_vars | other_scope_vars] = state.scope_vars