nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.66k stars 623 forks source link

Computed property `set` is being formatted to `self.set` #1599

Closed qvacua closed 6 months ago

qvacua commented 7 months ago

When I swiftformat the file MainWindow.swift(https://github.com/qvacua/vimr/blob/1b9545df2bbcace8f3bed4dc8907c14c3aa8f182/VimR/VimR/MainWindow.swift), the set of the computed property activateAsciiImInInsertMode gets formatted to self.set, i.e., the following

var activateAsciiImInInsertMode: Bool {
  get { self.neoVimView.activateAsciiImInNormalMode }
  set { self.neoVimView.activateAsciiImInNormalMode = newValue }
}

gets formatted to

var activateAsciiImInInsertMode: Bool {
  get { self.neoVimView.activateAsciiImInNormalMode }
  self.set { self.neoVimView.activateAsciiImInNormalMode = newValue }
}

using the config https://github.com/qvacua/vimr/blob/master/.swiftformat. I'm using the version 0.52.11 installed via Brew and Swift 5.9.

I'm afraid I could not work out a minimal reproducible example.

muradtries commented 6 months ago

I'm having exact the same issue as you described

nicklockwood commented 6 months ago

@qvacua @muradtries fixed in 0.53.0