Resolves what is under the cursor (Composer.LSP.Cursor) as a run
would: the recipe's aliases are expanded, and the cookbook owning the
buffer's file is the context unqualified references are looked up in
first. Shared by hover and goto-definition.
Results:
{:step, meta}- a step reference{:recipe, recipe}- a{:use, ...}target, or the recipe whose name key is under the cursor, as a loaded%Composer.Recipe{}{:hex, package, :explicit | :fallthrough}- ahex:reference, or an unqualified name no cookbook has as a step{:alias, name, target}- a cookbook alias name{:error, reason}- a reference that does not resolvenil- nothing to resolve (a recipe key)
Summary
Functions
The cookbooks a lookup resolves against: the snapshot's code cookbooks and local, built from its directory (which may not exist).
Replaces an aliased cookbook part of written with the cookbook it
names in aliases (%{"lab" => "composer_lab"}).
Resolves cursor, a hit in the buffer of the file at path, against
the cookbooks of snapshot (Composer.LSP.Workspace.snapshot/1).
Types
@type result() :: {:step, Composer.Step.Meta.t()} | {:recipe, Composer.Recipe.t()} | {:hex, String.t(), :explicit | :fallthrough} | {:alias, String.t(), String.t() | nil} | {:error, term()} | nil
Functions
@spec cookbooks(map()) :: [Composer.Cookbook.t()]
The cookbooks a lookup resolves against: the snapshot's code cookbooks and local, built from its directory (which may not exist).
Replaces an aliased cookbook part of written with the cookbook it
names in aliases (%{"lab" => "composer_lab"}).
@spec resolve(Composer.LSP.Cursor.t() | nil, Path.t(), map()) :: result()
Resolves cursor, a hit in the buffer of the file at path, against
the cookbooks of snapshot (Composer.LSP.Workspace.snapshot/1).