I provide code completion for Elixir source fragments.
Given a code prefix string (everything from the last separator to
the cursor), I call Code.Fragment.cursor_context/1 to understand
what the user is typing and return matching completions from the
runtime.
Public API
complete/1— complete with no bindingscomplete/2— complete with bindings from an Eval sessioncomplete/3— complete with bindings and full source context
Module names come from GtBridge.Analysis.LoadedModules, which is
maintained by module events and also sees modules an application
declares but has not yet loaded.
Summary
Functions
I return a list of completion strings for code_prefix,
including variable names from bindings.
Functions
@spec complete(String.t(), Code.binding(), String.t() | nil, Macro.Env.t(), [ {atom(), arity()} ]) :: [ String.t() ]
I return a list of completion strings for code_prefix,
including variable names from bindings.
The optional third argument source is the full source text up to
the cursor. When provided, it is passed through to sub-completers
that may need surrounding context (e.g. struct field completion).
locals are the session module's own functions (defps included),
offered alongside the imported ones.