mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-24 23:09:23 +08:00
Simplify alias expansion (#2518)
This commit is contained in:
parent
2756606f5c
commit
ce9779fc49
1 changed files with 2 additions and 6 deletions
|
@ -537,12 +537,8 @@ defmodule Livebook.Intellisense.IdentifierMatcher do
|
|||
|> expand_alias(ctx)
|
||||
end
|
||||
|
||||
defp expand_alias([name | rest], ctx) do
|
||||
case Macro.Env.fetch_alias(ctx.intellisense_context.env, name) do
|
||||
{:ok, name} when rest == [] -> name
|
||||
{:ok, name} -> Module.concat([name | rest])
|
||||
:error -> Module.concat([name | rest])
|
||||
end
|
||||
defp expand_alias([_ | _] = parts, ctx) do
|
||||
Macro.expand({:__aliases__, [], parts}, ctx.intellisense_context.env)
|
||||
end
|
||||
|
||||
defp match_env_alias(hint, ctx) do
|
||||
|
|
Loading…
Reference in a new issue