{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/haskell-ide/issues/1","labels_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1/comments","events_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1/events","html_url":"https://github.com/haskell/haskell-ide/issues/1","id":112786162,"number":1,"title":"Do plugins the same way as GHC","user":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-10-22T11:47:34Z","updated_at":"2015-10-26T18:49:57Z","closed_at":null,"body":"I'm thinking that a good way to implement plugins is by emulating ghc's plugin system, perhaps even calling functions from it.  Based on a quick look at the [DynamicLoading module](https://github.com/ghc/ghc/blob/master/compiler/main/DynamicLoading.hs), it seems like it'd be a good approach to just copy+modify the loadPlugin function. \r\n\r\nIt makes sense to have something similar to the [Plugin datatype](https://github.com/ghc/ghc/blob/master/compiler/main/Plugins.hs), and have a field per \"callback\".  Perhaps this is getting into details too early, but maybe these callbacks should be wrapped in Maybes, like the aptly named [Hooks datatype](https://downloads.haskell.org/~ghc/latest/docs/html/libraries/ghc-7.10.2/src/Hooks.html#Hooks). It's informative to know which things a particular plugin hooks into."},"comment":{"url":"https://api.github.com/repos/haskell/haskell-ide/issues/comments/151246039","html_url":"https://github.com/haskell/haskell-ide/issues/1#issuecomment-151246039","issue_url":"https://api.github.com/repos/haskell/haskell-ide/issues/1","id":151246039,"user":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T18:49:57Z","updated_at":"2015-10-26T18:49:57Z","body":"> This might be good to take as a very early approach to clarify what interfaces are needed, and then to break it out to the plugin architecture.\r\n\r\nAgreed!  I'm thinking this approach might be the main way to do it for quite a while.  I should probably explain why the current plugins approach is error-prone:\r\n\r\nThe issue is that you'll need to build your haskell-ide plugins with the haskell-ide package version which corresponds to your installed executable.  For example, if you've built a locally modified version, this means you need to know to do one of the following:\r\n\r\n* Add the plugin to the haskell-ide stack.yaml.  Alternatively, have a stack.yaml in a directory above, which includes haskell-ide - even then it seems iffy whether the results will match up).\r\n\r\n* Either reuse the cabal sandbox or use add-source (I think, not too experienced with that side of cabal sandboxes)."}}