code: func (l *Loader) LoadConfig(rootDir string) (*configs.Config, hcl.Diagnostics) {
  	rootMod, diags := l.parser.LoadConfigDir(rootDir)
  	if rootMod == nil {
  		return nil, diags
  	}
  
  	cfg, cDiags := configs.BuildConfig(rootMod, configs.ModuleWalkerFunc(l.moduleWalkerLoad))
  	diags = append(diags, cDiags...)
  
  	return cfg, diags
  }
docs: // LoadConfig reads the Terraform module in the given directory and uses it as the
  // root module to build the static module tree that represents a configuration,
  // assuming that all required descendent modules have already been installed.
  //
  // If error diagnostics are returned, the returned configuration may be either
  // nil or incomplete. In the latter case, cautious static analysis is possible
  // in spite of the errors.
  //
  // LoadConfig performs the basic syntax and uniqueness validations that are
  // required to process the individual modules, and also detects