Skip to content

Commit

Permalink
cue/load: remove directory argument from addFiles
Browse files Browse the repository at this point in the history
The argument isn't used, so remove it.

For #3144
For #3147

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I4d8c101f1523a89b54bf82a24c21226fe7176d72
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194763
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
rogpeppe committed May 15, 2024
1 parent 612837a commit 6804717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cue/load/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (l *loader) importPkg(pos token.Pos, p *build.Instance) []*build.Instance {
return all
}

l.addFiles(cfg.ModuleRoot, p)
l.addFiles(p)
_ = p.Complete()
}
slices.SortFunc(all, func(a, b *build.Instance) int {
Expand Down
4 changes: 2 additions & 2 deletions cue/load/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ func (l *loader) cueFilesPackage(files []*build.File) *build.Instance {
// }

pkg.User = true
l.addFiles(l.cfg.Dir, pkg)
l.addFiles(pkg)

_ = pkg.Complete()
pkg.DisplayPath = "command-line-arguments"

return pkg
}

func (l *loader) addFiles(dir string, p *build.Instance) {
func (l *loader) addFiles(p *build.Instance) {
for _, bf := range p.BuildFiles {
syntax, ok := l.fileCachedSyntaxFiles[bf.Filename]
if !ok {
Expand Down

0 comments on commit 6804717

Please sign in to comment.