vscode-apple-swift-format icon indicating copy to clipboard operation
vscode-apple-swift-format copied to clipboard

Parameter Packs get messed up

Open adam-rocska opened this issue 7 months ago • 2 comments

Swift 5.9 feature: https://github.com/apple/swift-evolution/blob/main/proposals/0393-parameter-packs.md Also see its related release notes: https://www.swift.org/blog/swift-5.9-released/

Given a code as follows:

import Beton

extension Store {
  public static func composite<each Store>(
    _ stores: repeat each Store

the plugin removes the space between each Storable and repeat each Storable, yielding the following incorrect result:

import Beton

extension Store {
  public static func composite<eachStore>(
    _ stores: repeateachStore

The real swift-format tool from Apple doesn't do this. Tested both with the homebrew and the Swift Package Manager installed editions. Only the VSCode plugin does this.

adam-rocska avatar Nov 05 '23 16:11 adam-rocska

Huh, that's weird. In theory using the extension should have no impact on the quality of formatting. Eventually it picked up the wrong version of the formatted from an unexpected path?

vknabel avatar Dec 09 '23 10:12 vknabel

Doesn't seem so. I'm more than happy to share a screen recording or even share screens and poke around on Facetime.

I'd gladly even fix the bug if I would have any ideas 😅

adam-rocska avatar Dec 09 '23 12:12 adam-rocska