You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: file.go
    path of file: ./repos/terraform/internal/stacks/stackconfig
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1

package stackconfig

import (
	"fmt"
	"strings"

	"github.com/hashicorp/go-slug/sourceaddrs"
	"github.com/hashicorp/hcl/v2"
	"github.com/hashicorp/hcl/v2/hclsyntax"
	hcljson "github.com/hashicorp/hcl/v2/json"
	"github.com/hashicorp/terraform/internal/tfdiags"
)

const initialLanguageEdition = "TFStack2023"

// File represents the content of a single .tfstack.hcl or .tfstack.json file
// before it's been me
    
func ParseFileSource(src []byte, fileAddr sourceaddrs.FinalSource) (*File, tfdiags.Diagnostics) {
	var diags tfdiags.Diagnostics

	filename := sourceaddrs.FinalSourceFilename(fileAddr)

	var body hcl.Body
	switch validFilenameSuffix(filename) {
	case ".tfstack.hcl":
		hclFile, hclDiags := hclsyntax.ParseConfig(src, fileAddr.String(), hcl.InitialPos)
		diags = diags.Append(hclDiags)
		if diags.HasErrors() {
			return nil, diags
		}
		body = hclFile.Body
	case ".tfstack.json":
		hclFile, hclDiags := hcljson.Parse(src, fileAddr.String())
		diags = diags.Append(hclDiags)
		if diags.HasErrors() {
			return nil, diags
		}
		body = hclFile.Body
	default:
		diags = diags.Append(tfdiags.Sourceless(
			tfdiags.Error,
			"Unsupported file type",
			fmt.Sprintf(
				"Cannot load %s as a stack configuration file: filename must have either a .tfstack.hcl or .tfstack.json suffix.",
				fileAddr,
			),
		))
		return nil, diags
	}

	ret, moreDiags := DecodeFileBody(body, fileAddr)
	diags = diags.Append(moreDiags)
	return ret, diags
}