internal/lsp: model embedded files as packages
Now that we can read a yaml or json file as if it were a CUE file, the
next step is to allow the lsp to model such files as packages.
The existing modpkgload machinery does not attempt to discover the
import graph for embeddings: it focuses purely on the import graph of
package imports. So the LSP must build and maintain the graph for
embeddings. Like with imported packages, we focus only on the upstream
relationship. So just as loading a .cue file will load its required
imports, now, loading a .cue file will load its embedded files
(packages).
This CL does not add any features to the LSP evaluator - that comes
next. This CL is only about modelling embedded files as packages,
and building and maintaining the import graph.
Signed-off-by: Matthew Sackman <matthew@cue.works>
Change-Id: I6dde6584f406850b696298467d1c46b1ae1ebcfe
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1230266
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>