Skip to content

Commit

Permalink
attempt to close all state scopes even if build fails
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Oct 24, 2023
1 parent 901e18d commit 46117cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion lib/elixir_sense/core/metadata_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/elixir_sense/core/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46117cd

Please sign in to comment.