feature-not-a-bug / vim-fourmolu

A vim plugin that supports formatting Haskell with fourmolu when saving a file
MIT License
1 stars 1 forks source link

Error when using fourmolu #6

Open xave opened 1 year ago

xave commented 1 year ago

Error

Error detected while processing BufWrite Autocommands for "*.hs"..function vim_fourmolu#FourmoluWriteRun[15]
..BufWrite Autocommands for "*.hs"..function vim_fourmolu#FourmoluWriteRun[9]
..vim_fourmolu#FourmoluFmt: .........

Line 16
General Problem

Setup

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jan 01 1980 00:00:00) macOS version - arm64

vimrc has:

let g:fourmolu_write = 1

fourmolu is in the $PATH and functions properly when called.

Expected Behavior: Format on save. Actual behavior: Errors only

feature-not-a-bug commented 1 year ago

The General Problem line seems to be emitted by fourmolu so it's being invoked. Can you try running vim with logging to see if there's any problems in the execution? And what happens if you call FourmoluFmt manually?

vim -Vvimlog.txt vimtest.hs against the test code from https://fourmolu.github.io/ would be a good baseline.

xave commented 1 year ago

I'll try that.

xave commented 1 year ago

Steps: create /tmp/vimTest.hs with test code as mentioned

vimrc:

let g:fourmolu_write = 1
let g:fourmolu_executable = "fourmolu"

fourmolu executable is on $PATH

Result:

same error as initially presented