ghcid icon indicating copy to clipboard operation
ghcid copied to clipboard

quickfix location can't be set to arbitrary directory

Open xave opened this issue 3 years ago • 4 comments

In a production codebase, it can be the case that one is working in multiple directories. Changes in a file in one directory could cause errors in many others across the codebase. At the moment, the quickfix file via the -o quickfix option can only be written to the directory in which ghcid is run.

It would be ideal to be able to place this file anywhere, such as ~/.quickfix. Then vim can always catch the quickfix file no matter where you were when you generated it or when you opened vim by simply configuring the vimrc with the custom location.

xave avatar Oct 31 '22 22:10 xave

If you write -o ~/.quickfix what happens? I don't foresee any reason for it not writing it whereever you ask? (but I haven't looked at this code in a while)

ndmitchell avatar Nov 06 '22 13:11 ndmitchell

No file is written if you prepend a dot to it or if you provide a path to it.

This works:

quickfix foobar

This does not work:

.quickfix ~/.quickfix /any/other/path/quickfix

xave avatar Nov 06 '22 20:11 xave

All I do is call writeFile on it - https://github.com/ndmitchell/ghcid/blob/master/src/Ghcid.hs#L383-L387 - I have no idea why that wouldn't work. I guess this is a Linux machine? I only have a Windows to test on right now, but it seems to work fine there.

ndmitchell avatar Nov 06 '22 21:11 ndmitchell

I guess this is a Linux machine?

Yes. I am on macOS.

xave avatar Nov 07 '22 00:11 xave