{"action":"created","issue":{"url":"https://api.github.com/repos/kazu-yamamoto/ghc-mod/issues/482","labels_url":"https://api.github.com/repos/kazu-yamamoto/ghc-mod/issues/482/labels{/name}","comments_url":"https://api.github.com/repos/kazu-yamamoto/ghc-mod/issues/482/comments","events_url":"https://api.github.com/repos/kazu-yamamoto/ghc-mod/issues/482/events","html_url":"https://github.com/kazu-yamamoto/ghc-mod/issues/482","id":82105879,"number":482,"title":"Temporary files with cabal project","user":{"login":"lierdakil","id":7275622,"avatar_url":"https://avatars.githubusercontent.com/u/7275622?v=3","gravatar_id":"","url":"https://api.github.com/users/lierdakil","html_url":"https://github.com/lierdakil","followers_url":"https://api.github.com/users/lierdakil/followers","following_url":"https://api.github.com/users/lierdakil/following{/other_user}","gists_url":"https://api.github.com/users/lierdakil/gists{/gist_id}","starred_url":"https://api.github.com/users/lierdakil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lierdakil/subscriptions","organizations_url":"https://api.github.com/users/lierdakil/orgs","repos_url":"https://api.github.com/users/lierdakil/repos","events_url":"https://api.github.com/users/lierdakil/events{/privacy}","received_events_url":"https://api.github.com/users/lierdakil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-28T20:14:50Z","updated_at":"2015-05-28T21:27:17Z","closed_at":null,"body":"Hello. Thank you for ghc-mod, this is invaluable tool for me.\r\n\r\nHowever, recent changes in `master` make my life a little bit harder.\r\n\r\nI'm using ghc-mod as a backend for https://github.com/atom-haskell/ide-haskell package for Atom editor. Until recently, it was possible to run ghc-mod commands on a file currently being edited (i.e. one with unsaved changes), by writing whole buffer to temporary file and running ghc-mod/ghc-modi command on that.\r\n\r\nThat does not work with `master` version though, which breaks the workflow I have now.\r\n\r\nJust to be clear, I'm talking about `cabal` projects.\r\n\r\nAs far as I understand, ghc-mod now follows `cabal` project definition more closely, so it ignores cabal project settings for files not included in said project (with `other-modules`, I reckon). This is a reasonable convention, but I would prefer there was some way to override that, for example by supplying filename and contents separately, f.ex. `ghc-mod check <filename> <contents-file>`. Any syntax will do.\r\n\r\nAnother option would be to supply file contents on stdin, but honestly, I doubt it's possible with ghc-modi, so it's not really a good option.\r\n\r\nI can spend some time on implementing this, I just want to make sure it won't be rejected outright and understand what to implement in the first place.\r\n\r\nThank you again for your work."},"comment":{"url":"https://api.github.com/repos/kazu-yamamoto/ghc-mod/issues/comments/106605022","html_url":"https://github.com/kazu-yamamoto/ghc-mod/issues/482#issuecomment-106605022","issue_url":"https://api.github.com/repos/kazu-yamamoto/ghc-mod/issues/482","id":106605022,"user":{"login":"DanielG","id":199218,"avatar_url":"https://avatars.githubusercontent.com/u/199218?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielG","html_url":"https://github.com/DanielG","followers_url":"https://api.github.com/users/DanielG/followers","following_url":"https://api.github.com/users/DanielG/following{/other_user}","gists_url":"https://api.github.com/users/DanielG/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielG/subscriptions","organizations_url":"https://api.github.com/users/DanielG/orgs","repos_url":"https://api.github.com/users/DanielG/repos","events_url":"https://api.github.com/users/DanielG/events{/privacy}","received_events_url":"https://api.github.com/users/DanielG/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T21:27:17Z","updated_at":"2015-05-28T21:27:17Z","body":"I'm not sure ghc's API allows for something like `MemoryFile` so before passing it to ghc we'd still have to write it out into a temporary file anyways :/\r\n\r\nOne other nasty little detail. GHC's log messages will include the path of your temporary file and you'd have to somehow replace that with the original file name unless you handle that in the frontend?"}}