neoformat icon indicating copy to clipboard operation
neoformat copied to clipboard

`.swiftformat` config not detected

Open nguyenvukhang opened this issue 2 years ago • 0 comments

Here's a minimal example:

// main.swift
class A {
    let v: Int
    init() {
        self.v = 0
    }
}
// .swiftformat
--self init-only

With these two files in the same folder and with swiftformat installed,

  • Calling :Neoformat yields
    // main.swift
    class A {
        let v: Int
        init() {
            v = 0
        }
    }
    
  • While calling :!swiftformat %:p yields the expected outcome:
    // main.swift
    class A {
        let v: Int
        init() {
            self.v = 0
        }
    }
    

I tried poking around in formatters/swift.vim and a bit in neoformat.vim but I can't quite isolate the issue.

nguyenvukhang avatar Feb 23 '23 11:02 nguyenvukhang