reports icon indicating copy to clipboard operation
reports copied to clipboard

FB16871429: Swift Package file creation lacks filename prompt and generates incorrect file headers

Open samhenrigold opened this issue 8 months ago • 0 comments

Submission Date

2025-03-14

Status

Open

Area

Xcode

Operating System Version

macOS 15.4.1, Xcode 16.2 (16C5032a)

Type

Incorrect/Unexpected Behavior

Description

When creating new Swift files in Swift Packages (File > New File > Swift File), Xcode:

  1. Doesn't show the filename prompt dialog, automatically naming it "File.swift"
  2. Creates a header comment that always says "File.swift" regardless of renaming
  3. Omits package name and copyright information in the header

This requires manually editing both the filename and header every time, unlike in regular Xcode projects where proper dialogs and headers are generated.

Relevant links (all suggest creating a new template, which seems like cracking eggs with a sledgehammer) https://forums.swift.org/t/swift-package-manager-project-dont-generate-filename-and-boilerplates/49625 https://stackoverflow.com/questions/72068103/why-doesnt-swift-package-manager-ask-for-a-filename https://stackoverflow.com/questions/72472384/xcode-does-not-allow-me-to-specify-file-name-when-adding-in-spm

Keywords

No response

Prerequisites

  • [x] The title follows the format FB<number>: <title>
  • [x] I will keep this issue updated with Apple's responses

samhenrigold avatar Apr 24 '25 14:04 samhenrigold