code: func traversalStr(traversal hcl.Traversal) string {
  	// This is a specialized subset of traversal rendering tailored to
  	// producing helpful contextual messages in diagnostics. It is not
  	// comprehensive nor intended to be used for other purposes.
  
  	var buf bytes.Buffer
  	for _, step := range traversal {
  		switch tStep := step.(type) {
  		case hcl.TraverseRoot:
  			buf.WriteString(tStep.Name)
  		case hcl.TraverseAttr:
  			buf.WriteByte('.')
  			buf.WriteString(tStep.Name)
  		case hcl.TraverseIndex:
  			buf.WriteByte('[')
  			if keyTy := tStep.Key.Type(); keyTy.IsPrimitiveType() {
  				buf.WriteString(compactValueStr(tStep.Key))
  			} else {
  				// We'll just use a placeholder for more complex values,
  				// since otherwise our result could grow ridiculously long.
  				buf.WriteString("...")
  			}
  			buf.WriteByte(']')
  		}
  	}
  	return buf.String()
  }
docs: // traversalStr produces a representation of an HCL traversal that is compact,
  // resembles HCL native syntax, and is suitable for display in the UI.