diff --git a/README.md b/README.md index 85d8d5404..4f2bd056a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -# haskell-ide-engine -[![Available on Hackage][badge-hackage]][hackage] -[![License BSD3][badge-license]][license] -[![Build Status][badge-travis]][travis] +# haskell-ide-engine (HIE) + +[![Available on Hackage][badge-hackage]][hackage] [![License BSD3][badge-license]][license] [![Build Status][badge-travis]][travis] [badge-travis]: https://travis-ci.org/haskell/haskell-ide-engine.png?branch=master [travis]: https://travis-ci.org/haskell/haskell-ide-engine @@ -11,9 +10,26 @@ [license]: https://github.com/haskell/haskell-ide-engine/blob/master/LICENSE -This project aims to be the __universal IDE interface__ to __all haskell tools__, proving a __full-featured and easy to query ide-backend__. +This project aims to be the __universal IDE interface__ to __all haskell tools__, proving a __full-featured and easy to query haskell ide-backend__. + +------------- + +### There is __3 things__ you can do to help: + +1. Integrate your tool to HIE like this : [/hie-example-plugin2/Haskell/Ide/ExamplePlugin2.hs](/hie-example-plugin2/Haskell/Ide/ExamplePlugin2.hs) +2. Generate IDE Bindings (see [/app/Ide/SublimeText.hs](/app/Ide/SublimeText.hs)) +3. Discuss the project with us + - Register in our [google group mailing list](https://groups.google.com/forum/#!forum/haskell-ide) + - Join our IRC channel at `#haskell-ide-engine` on `freenode`. + - Fork this repo and hack as much as you can. + - Ask @alanz or @hvr to join the project. + + +--------- + +:heart: Haskell tooling dream is near, we need your help ! :heart: -Features: (planned) +### Features: (planned) - [ ] cabal / stack project `Configuration` and `Compilation` - [ ] Errors Checking, Warnings, Linter, Dead code detection @@ -38,21 +54,9 @@ This project doesn't start from scratch: 2. Check the [list of existing tools / features ](/docs/Tools.md) 3. See more [other tools / ide for inspiration](/docs/Inspirations.md) -## It's time to join the project ! - -:heart: Haskell tooling dream is near, we need your help ! :heart: - - - Register in our [google group mailing list](https://groups.google.com/forum/#!forum/haskell-ide) - - Join our IRC channel at `#haskell-ide-engine` on `freenode`. - - Fork this repo and hack as much as you can. - - Ask @alanz or @hvr to join the project. - -------------- - - ## Architecture -1. __BIOS layer__: +1. __BIOS layer__: Ghc Mod ghc-mod stays an AGPL project, and is used for its "awesome sauce" in terms of the BIOS functions that it does so well. This interface is @@ -62,8 +66,7 @@ This project doesn't start from scratch: 2. __Plugin layer__: - A layer providing a point to integrate tools and existing functions, probably - including ghci. + A layer providing a point to integrate tools and existing functions (ghci, hlint, etc.). 3. __IDE interfacing layer__: diff --git a/app/Ide/SublimeText.hs b/app/Ide/SublimeText.hs new file mode 100644 index 000000000..839284128 --- /dev/null +++ b/app/Ide/SublimeText.hs @@ -0,0 +1,32 @@ +module Ide.SublimeText where + +import PluginList (plugins) +import qualified Data.Map as M + +-- | Generate sublime text plugin in $REPOSITORY_ROOT/plugin-sublime folder +generate :: IO () +generate = do + let func = M.assocs plugins + -- TODO + writeFile "plugin-sublime/haskell-ide.py" $ unlines + putStrLn "done" + return () + +tempCode = unlines + [ "import sublime, sublimeplugin " + , " " + , "# Extends TextCommand so that run() receives a View to modify. " + , "class DuplicateCommand(sublimeplugin.TextCommand): " + , " def run(self, view, args): " + , " # Walk through each region in the selection " + , " for region in view.sel(): " + , " # Only interested in empty regions, otherwise they may span multiple " + , " # lines, which doesn't make sense for this command. " + , " if region.empty(): " + , " # Expand the region to the full line it resides on, excluding the newline " + , " line = view.line(region) " + , " # Extract the string for the line, and add a newline " + , " lineContents = view.substr(line) + '\n' " + , " # Add the text at the beginning of the line " + , " view.insert(line.begin(), lineContents) " + ] diff --git a/app/MainHie.hs b/app/MainHie.hs index 78d842f72..0c2d83f98 100644 --- a/app/MainHie.hs +++ b/app/MainHie.hs @@ -30,30 +30,7 @@ import qualified Paths_haskell_ide_engine as Meta import System.Directory import System.Environment --- --------------------------------------------------------------------- --- plugins - -import Haskell.Ide.Engine.BasePlugin -import Haskell.Ide.ExamplePlugin2 -import Haskell.Ide.GhcModPlugin -import Haskell.Ide.HaRePlugin - --- --------------------------------------------------------------------- - --- | This will be read from a configuration, eventually -plugins :: Plugins -plugins = Map.fromList - [ - -- Note: statically including known plugins. In future this map could be set - -- up via a config file of some kind. - ("eg2", example2Descriptor) - , ("ghcmod", ghcmodDescriptor) - , ("hare", hareDescriptor) - -- The base plugin, able to answer questions about the IDE Engine environment. - , ("base", baseDescriptor) - ] - --- --------------------------------------------------------------------- +import PluginList (plugins) main :: IO () main = do diff --git a/app/PluginList.hs b/app/PluginList.hs new file mode 100644 index 000000000..9c4ea148c --- /dev/null +++ b/app/PluginList.hs @@ -0,0 +1,23 @@ +module PluginList + ( plugins + ) where + +import Haskell.Ide.Engine.BasePlugin +import Haskell.Ide.ExamplePlugin2 +import Haskell.Ide.GhcModPlugin +import Haskell.Ide.HaRePlugin + +-- --------------------------------------------------------------------- + +-- | This will be read from a configuration, eventually +plugins :: Plugins +plugins = Map.fromList + [ + -- Note: statically including known plugins. In future this map could be set + -- up via a config file of some kind. + ("eg2", example2Descriptor) + , ("ghcmod", ghcmodDescriptor) + , ("hare", hareDescriptor) + -- The base plugin, able to answer questions about the IDE Engine environment. + , ("base", baseDescriptor) + ] diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index 5eee87275..5bb44b0d6 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -63,6 +63,9 @@ library executable hie hs-source-dirs: app main-is: MainHie.hs + other-modules: + PluginList + Ide.SublimeText other-modules: Paths_haskell_ide_engine build-depends: base , Cabal >= 1.22 diff --git a/ide-atom/.gitkeep b/ide-atom/.gitkeep new file mode 100644 index 000000000..e1664421e --- /dev/null +++ b/ide-atom/.gitkeep @@ -0,0 +1 @@ +.gitkeep diff --git a/elisp/hie.el b/ide-emacs/hie.el similarity index 100% rename from elisp/hie.el rename to ide-emacs/hie.el diff --git a/elisp/tests/hie-tests.el b/ide-emacs/tests/hie-tests.el similarity index 100% rename from elisp/tests/hie-tests.el rename to ide-emacs/tests/hie-tests.el diff --git a/ide-sublime/.gitkeep b/ide-sublime/.gitkeep new file mode 100644 index 000000000..e1664421e --- /dev/null +++ b/ide-sublime/.gitkeep @@ -0,0 +1 @@ +.gitkeep