Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

[RFC] Ide generation and Guidance Proposition #107

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's spelled 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
Expand All @@ -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__:

Expand Down
32 changes: 32 additions & 0 deletions app/Ide/SublimeText.hs
Original file line number Diff line number Diff line change
@@ -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) "
]
25 changes: 1 addition & 24 deletions app/MainHie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions app/PluginList.hs
Original file line number Diff line number Diff line change
@@ -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)
]
3 changes: 3 additions & 0 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ide-atom/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gitkeep
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions ide-sublime/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gitkeep