Support for Elm and Haskell dependencies

This commit is contained in:
Alan Hamlett 2018-03-14 23:54:32 -07:00
parent 882dc7e4b2
commit f38b026e6a
5 changed files with 169 additions and 0 deletions

View file

@ -0,0 +1,21 @@
module Index exposing (..) -- where
import Color exposing (Color, darkGrey)
import Dict
import TempFontAwesome as FA
import Html exposing (..)
import Html.Attributes exposing (..)
import Markdown
import String
-- MAIN
main =
Html.programWithFlags
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
}

View file

@ -0,0 +1,20 @@
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE OverloadedStrings #-}
module Socket (watchFile) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Exception (SomeException, catch)
import qualified Data.ByteString.Char8 as BS
import qualified Network.WebSockets as WS
import qualified System.FSNotify.Devel as Notify
import qualified System.FSNotify as Notify
watchFile :: FilePath -> WS.PendingConnection -> IO ()
watchFile watchedFile pendingConnection =
do connection <- WS.acceptRequest pendingConnection
Notify.withManager $ \mgmt ->
do stop <- Notify.treeExtAny mgmt "." ".elm" print
tend connection
stop

View file

@ -476,3 +476,31 @@ class DependenciesTestCase(TestCase):
expected_lines=18,
entity='haxe.hx',
)
def test_haskell_dependencies_detected(self):
self.shared(
expected_dependencies=[
'Control',
'Data',
'Network',
'System',
],
expected_language='Haskell',
expected_lines=20,
entity='haskell.hs',
)
def test_elm_dependencies_detected(self):
self.shared(
expected_dependencies=[
'Color',
'Dict',
'TempFontAwesome',
'Html',
'Markdown',
'String',
],
expected_language='Elm',
expected_lines=21,
entity='elm.elm',
)