Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix suggestions when using typespecs returning a remote type #282

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Fix suggestions when using typespecs returning a remote type #282

merged 1 commit into from
Nov 27, 2023

Commits on Nov 20, 2023

  1. Fix suggestions when using typespecs returning a remote type

    As shown in the following code:
    
    ```
      defmodule Mod do
        @SPEC fun() :: NaiveDateTime.t()
        def fun(), do: NaiveDateTime.new(1, 2)
    
        def some do
          var = fun()
          var.h
          #    ^  suggestion here
        end
      end
    ```
    
    It should be able to suggest from NaiveDateTime.
    
    This wasn't working before because the `__aliases__` weren't being
    handled:
    
    ```
    iex(1)> Code.string_to_quoted("@SPEC fun() :: NaiveDateTime.t()")
    {:ok,
     {:@, [line: 1],
      [
        {:spec, [line: 1],
         [
           {:"::", [line: 1],
            [
              {:fun, [line: 1], []},
              {{:., [line: 1], [{:__aliases__, [line: 1], [:NaiveDateTime]}, :t]},
               [line: 1], []}
            ]}
         ]}
      ]}}
    ```
    sarahkw committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    fa36a96 View commit details
    Browse the repository at this point in the history