Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/elixir_sense/core/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ defmodule ElixirSense.Core.Compiler do
|> State.add_call_to_line({as, nil, nil}, meta, :alias_expansion_as)
|> State.add_call_to_line({alias, nil, nil}, meta, :alias_expansion)

{:compile_env, _app, _path, _return} ->
# emitted by Application.compile_env/4 when a macro such as dbg/2 reads config
acc

_ ->
Logger.warning("Unhandled trace event: #{inspect(event)}")
acc
Expand Down
14 changes: 14 additions & 0 deletions test/elixir_sense/core/metadata_builder_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7257,6 +7257,20 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
assert %{{SomeMod, :my_fun, 0} => _} = state.mods_funs_to_positions
end

test "does not warn on compile_env trace events" do
log =
ExUnit.CaptureLog.capture_log([level: :warning], fn ->
"""
defmodule SomeMod do
def fun(a), do: dbg(a)
end
"""
|> string_to_state
end)

refute log =~ "Unhandled trace event"
end

defmodule SomeCompiledMod do
defmacro go do
quote do
Expand Down