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

Context-aware "use" completions #336

Merged
merged 3 commits into from
Aug 23, 2023
Merged

Context-aware "use" completions #336

merged 3 commits into from
Aug 23, 2023

Commits on Aug 16, 2023

  1. Conext-aware "use" completions

    When using `use`, we would complete any module, even those without
    `__using__` macros defined.
    
    This PR filters any suggestions inside a `use` directive to ensure
    that any suggested modules (or a submodule) contain a __using__ macro
    of arity 1.
    
    One thing that cropped up is that not all modules are loaded when
    queried, so I had to use `:code.all_available` to generate the module
    list. This wasn't super duper fast, so I had to put a cache in front
    of it, which is the large part of this PR.
    
    Another oddity is that I couldn't just send anonymous functions as
    predicates, so I had to come up with a way to implement filtering
    logic across distribution, so I did a matchspec-like thingy, which was
    a bit ugly, so I made some syntax to make it look like function captures.
    scohen committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    8760b80 View commit details
    Browse the repository at this point in the history
  2. used proper syntax

    scohen committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    427cade View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2023

  1. Configuration menu
    Copy the full SHA
    23d544d View commit details
    Browse the repository at this point in the history