git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
[psc-ide] Parse Modules on load

* psc-ide-server now takes globs as arguments, just like the compiler

commitee34e21acbf3fcd4888a53265ea6e0351ad2e90e authorChristoph Hegemann <christoph.hegemann1337@gmail.com> dateSat 11 Jun 2016, 21:19 (10 years ago) parent8063c4d
10 files changed+460−166
LICENSE+270−10 psc-ide-server/Main.hs+4−5 psc-ide-server/README.md+4−1 purescript.cabal+1 src/Language/PureScript/Ide.hs+103−81 src/Language/PureScript/Ide/CaseSplit.hs+3−2 src/Language/PureScript/Ide/Reexports.hs+1−2 src/Language/PureScript/Ide/SourceFile.hs+32−44 src/Language/PureScript/Ide/State.hs+37−18 src/Language/PureScript/Ide/Types.hs+5−3
LICENSE+270−10
@@ -46,6 +46,7 @@ PureScript uses the following Haskell library packages. Their license files foll
4646 bytestring-builder
4747 case-insensitive
4848 cereal
49+ clock
4950 conduit
5051 conduit-extra
5152 connection
@@ -56,8 +57,10 @@ PureScript uses the following Haskell library packages. Their license files foll
5657 deepseq
5758 directory
5859 dlist
60+ easy-file
5961 edit-distance
6062 exceptions
63+ fail
6164 fast-logger
6265 filepath
6366 fsnotify
@@ -82,6 +85,7 @@ PureScript uses the following Haskell library packages. Their license files foll
8285 network
8386 network-uri
8487 old-locale
88+ old-time
8589 optparse-applicative
8690 parallel
8791 parsec
@@ -91,6 +95,7 @@ PureScript uses the following Haskell library packages. Their license files foll
9195 pipes-http
9296 primitive
9397 process
98+ protolude
9499 random
95100 regex-base
96101 regex-tdfa
@@ -105,6 +110,7 @@ PureScript uses the following Haskell library packages. Their license files foll
105110 stm
106111 stm-chans
107112 streaming-commons
113+ string-conv
108114 syb
109115 tagged
110116 template-haskell
@@ -117,6 +123,7 @@ PureScript uses the following Haskell library packages. Their license files foll
117123 transformers-compat
118124 unix
119125 unix-compat
126+ unix-time
120127 unordered-containers
121128 utf8-string
122129 vector
@@ -955,6 +962,41 @@ cereal LICENSE file:
955962 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
956963 POSSIBILITY OF SUCH DAMAGE.
957964
965+clock LICENSE file:
966+
967+ Copyright (c) 2009-2012, Cetin Sert
968+ Copyright (c) 2010, Eugene Kirpichov
969+
970+ All rights reserved.
971+
972+ Redistribution and use in source and binary forms, with or without
973+ modification, are permitted provided that the following conditions are
974+ met:
975+
976+ * Redistributions of source code must retain the above copyright
977+ notice, this list of conditions and the following disclaimer.
978+
979+ * Redistributions in binary form must reproduce the above
980+ copyright notice, this list of conditions and the following
981+ disclaimer in the documentation and/or other materials provided
982+ with the distribution.
983+
984+ * The names of contributors may not be used to endorse or promote
985+ products derived from this software without specific prior
986+ written permission.
987+
988+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
989+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
990+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
991+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
992+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
993+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
994+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
995+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
996+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
997+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
998+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
999+
9581000conduit LICENSE file:
9591001
9601002 Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/
@@ -1142,16 +1184,16 @@ data-default-class LICENSE file:
11421184 may be used to endorse or promote products derived from this software
11431185 without specific prior written permission.
11441186
1145− THIS SOFTWARE IS PROVIDED BY LUKAS MAI AND CONTRIBUTORS "AS IS" AND ANY
1146− EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1187+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1188+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
11471189 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1148− DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
1149− DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1150− (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1151− LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1152− ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1153− (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1154− SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1190+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
1191+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1192+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1193+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1194+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1195+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1196+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11551197
11561198deepseq LICENSE file:
11571199
@@ -1295,6 +1337,38 @@ dlist LICENSE file:
12951337 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
12961338 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12971339
1340+easy-file LICENSE file:
1341+
1342+ Copyright (c) 2009, IIJ Innovation Institute Inc.
1343+ All rights reserved.
1344+
1345+ Redistribution and use in source and binary forms, with or without
1346+ modification, are permitted provided that the following conditions
1347+ are met:
1348+
1349+ * Redistributions of source code must retain the above copyright
1350+ notice, this list of conditions and the following disclaimer.
1351+ * Redistributions in binary form must reproduce the above copyright
1352+ notice, this list of conditions and the following disclaimer in
1353+ the documentation and/or other materials provided with the
1354+ distribution.
1355+ * Neither the name of the copyright holders nor the names of its
1356+ contributors may be used to endorse or promote products derived
1357+ from this software without specific prior written permission.
1358+
1359+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1360+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1361+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1362+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
1363+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1364+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
1365+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1366+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1367+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1368+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
1369+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1370+ POSSIBILITY OF SUCH DAMAGE.
1371+
12981372edit-distance LICENSE file:
12991373
13001374 Copyright (c) 2008-2013 Maximilian Bolingbroke
@@ -1354,6 +1428,39 @@ exceptions LICENSE file:
13541428 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
13551429 POSSIBILITY OF SUCH DAMAGE.
13561430
1431+fail LICENSE file:
1432+
1433+ Copyright (c) 2015, David Luposchainsky & Herbert Valerio Riedel
1434+
1435+ All rights reserved.
1436+
1437+ Redistribution and use in source and binary forms, with or without
1438+ modification, are permitted provided that the following conditions are met:
1439+
1440+ * Redistributions of source code must retain the above copyright
1441+ notice, this list of conditions and the following disclaimer.
1442+
1443+ * Redistributions in binary form must reproduce the above
1444+ copyright notice, this list of conditions and the following
1445+ disclaimer in the documentation and/or other materials provided
1446+ with the distribution.
1447+
1448+ * Neither the name of Herbert Valerio Riedel nor the names of other
1449+ contributors may be used to endorse or promote products derived
1450+ from this software without specific prior written permission.
1451+
1452+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1453+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1454+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1455+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1456+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1457+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1458+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1459+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1460+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1461+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1462+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1463+
13571464fast-logger LICENSE file:
13581465
13591466 Copyright (c) 2009, IIJ Innovation Institute Inc.
@@ -2122,6 +2229,72 @@ old-locale LICENSE file:
21222229
21232230 -----------------------------------------------------------------------------
21242231
2232+old-time LICENSE file:
2233+
2234+ This library (libraries/base) is derived from code from two
2235+ sources:
2236+
2237+ * Code from the GHC project which is largely (c) The University of
2238+ Glasgow, and distributable under a BSD-style license (see below),
2239+
2240+ * Code from the Haskell 98 Report which is (c) Simon Peyton Jones
2241+ and freely redistributable (but see the full license for
2242+ restrictions).
2243+
2244+ The full text of these licenses is reproduced below. Both of the
2245+ licenses are BSD-style or compatible.
2246+
2247+ -----------------------------------------------------------------------------
2248+
2249+ The Glasgow Haskell Compiler License
2250+
2251+ Copyright 2004, The University Court of the University of Glasgow.
2252+ All rights reserved.
2253+
2254+ Redistribution and use in source and binary forms, with or without
2255+ modification, are permitted provided that the following conditions are met:
2256+
2257+ - Redistributions of source code must retain the above copyright notice,
2258+ this list of conditions and the following disclaimer.
2259+
2260+ - Redistributions in binary form must reproduce the above copyright notice,
2261+ this list of conditions and the following disclaimer in the documentation
2262+ and/or other materials provided with the distribution.
2263+
2264+ - Neither name of the University nor the names of its contributors may be
2265+ used to endorse or promote products derived from this software without
2266+ specific prior written permission.
2267+
2268+ THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
2269+ GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
2270+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
2271+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
2272+ UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
2273+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2274+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2275+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2276+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2277+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2278+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2279+ DAMAGE.
2280+
2281+ -----------------------------------------------------------------------------
2282+
2283+ Code derived from the document "Report on the Programming Language
2284+ Haskell 98", is distributed under the following license:
2285+
2286+ Copyright (c) 2002 Simon Peyton Jones
2287+
2288+ The authors intend this Report to belong to the entire Haskell
2289+ community, and so we grant permission to copy and distribute it for
2290+ any purpose, provided that it is reproduced in its entirety,
2291+ including this Notice. Modified versions of this Report may also be
2292+ copied and distributed for any purpose, provided that the modified
2293+ version is clearly presented as such, and that it does not claim to
2294+ be a definition of the Haskell 98 Language.
2295+
2296+ -----------------------------------------------------------------------------
2297+
21252298optparse-applicative LICENSE file:
21262299
21272300 Copyright (c) 2012, Paolo Capriotti
@@ -2276,7 +2449,7 @@ pem LICENSE file:
22762449
22772450pipes LICENSE file:
22782451
2279− Copyright (c) 2012-2014 Gabriel Gonzalez
2452+ Copyright (c) 2012-2016 Gabriel Gonzalez
22802453 All rights reserved.
22812454
22822455 Redistribution and use in source and binary forms, with or without modification,
@@ -2427,6 +2600,28 @@ process LICENSE file:
24272600
24282601 -----------------------------------------------------------------------------
24292602
2603+protolude LICENSE file:
2604+
2605+ Copyright (c) 2016, Stephen Diehl
2606+
2607+ Permission is hereby granted, free of charge, to any person obtaining a copy
2608+ of this software and associated documentation files (the "Software"), to
2609+ deal in the Software without restriction, including without limitation the
2610+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2611+ sell copies of the Software, and to permit persons to whom the Software is
2612+ furnished to do so, subject to the following conditions:
2613+
2614+ The above copyright notice and this permission notice shall be included in
2615+ all copies or substantial portions of the Software.
2616+
2617+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2618+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2619+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2620+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2621+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2622+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2623+ IN THE SOFTWARE.
2624+
24302625random LICENSE file:
24312626
24322627 This library (libraries/base) is derived from code from two
@@ -2873,6 +3068,39 @@ streaming-commons LICENSE file:
28733068 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28743069 SOFTWARE.
28753070
3071+string-conv LICENSE file:
3072+
3073+ Copyright (c) 2012, Ozgun Ataman
3074+
3075+ All rights reserved.
3076+
3077+ Redistribution and use in source and binary forms, with or without
3078+ modification, are permitted provided that the following conditions are met:
3079+
3080+ * Redistributions of source code must retain the above copyright
3081+ notice, this list of conditions and the following disclaimer.
3082+
3083+ * Redistributions in binary form must reproduce the above
3084+ copyright notice, this list of conditions and the following
3085+ disclaimer in the documentation and/or other materials provided
3086+ with the distribution.
3087+
3088+ * Neither the name of Ozgun Ataman nor the names of other
3089+ contributors may be used to endorse or promote products derived
3090+ from this software without specific prior written permission.
3091+
3092+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3093+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3094+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3095+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3096+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3097+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3098+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3099+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3100+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3101+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3102+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3103+
28763104syb LICENSE file:
28773105
28783106 This library (libraries/syb) is derived from code from several
@@ -3289,6 +3517,38 @@ unix-compat LICENSE file:
32893517 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32903518 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32913519
3520+unix-time LICENSE file:
3521+
3522+ Copyright (c) 2009, IIJ Innovation Institute Inc.
3523+ All rights reserved.
3524+
3525+ Redistribution and use in source and binary forms, with or without
3526+ modification, are permitted provided that the following conditions
3527+ are met:
3528+
3529+ * Redistributions of source code must retain the above copyright
3530+ notice, this list of conditions and the following disclaimer.
3531+ * Redistributions in binary form must reproduce the above copyright
3532+ notice, this list of conditions and the following disclaimer in
3533+ the documentation and/or other materials provided with the
3534+ distribution.
3535+ * Neither the name of the copyright holders nor the names of its
3536+ contributors may be used to endorse or promote products derived
3537+ from this software without specific prior written permission.
3538+
3539+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3540+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3541+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
3542+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
3543+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
3544+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
3545+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
3546+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
3547+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3548+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
3549+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3550+ POSSIBILITY OF SUCH DAMAGE.
3551+
32923552unordered-containers LICENSE file:
32933553
32943554 Copyright (c) 2010, Johan Tibell
psc-ide-server/Main.hs+4−5
@@ -44,9 +44,6 @@ import System.IO.Error (isEOFError)
4444
4545import qualified Paths_purescript as Paths
4646
47−-- "Borrowed" from the Idris Compiler
48−-- Copied from upstream impl of listenOn
49−-- bound to localhost interface instead of iNADDR_ANY
5047listenOnLocalhost :: PortNumber -> IO Socket
5148listenOnLocalhost port = do
5249 proto <- getProtocolNumber "tcp"
@@ -62,6 +59,7 @@ listenOnLocalhost port = do
6259
6360data Options = Options
6461 { optionsDirectory :: Maybe FilePath
62+ , optionsGlobs :: [FilePath]
6563 , optionsOutputPath :: FilePath
6664 , optionsPort :: PortNumber
6765 , optionsNoWatch :: Bool
@@ -70,7 +68,7 @@ data Options = Options
7068
7169main :: IO ()
7270main = do
73− Options dir outputPath port noWatch debug <- execParser opts
71+ Options dir globs outputPath port noWatch debug <- execParser opts
7472 maybe (pure ()) setCurrentDirectory dir
7573 serverState <- newTVarIO emptyPscIdeState
7674 ideState <- newTVarIO emptyIdeState
@@ -86,13 +84,14 @@ main = do
8684 unless noWatch $
8785 void (forkFinally (watcher ideState fullOutputPath) print)
8886
89− let conf = Configuration {confDebug = debug, confOutputPath = outputPath}
87+ let conf = Configuration {confDebug = debug, confOutputPath = outputPath, confGlobs = globs}
9088 env = IdeEnvironment {envStateVar = serverState, ideStateVar = ideState, ideConfiguration = conf}
9189 startServer port env
9290 where
9391 parser =
9492 Options
9593 <$> optional (strOption (long "directory" `mappend` short 'd'))
94+ <*> many (argument str (metavar "Source GLOBS..."))
9695 <*> strOption (long "output-directory" `mappend` value "output/")
9796 <*> (fromIntegral <$>
9897 option auto (long "port" `mappend` short 'p' `mappend` value (4242 :: Integer)))
psc-ide-server/README.md+4−1
@@ -10,7 +10,10 @@ A tool which provides editor support for the PureScript programming language.
1010* Vim integration is available here: https://github.com/FrigoEU/psc-ide-vim.
1111
1212## Running the Server
13−Start the server by running the `psc-ide-server` executable.
13+
14+Start the server by running the `psc-ide-server [SOURCEGLOBS]` executable, where
15+`SOURCEGLOBS` are (optional) globs that match your PureScript sourcefiles.
16+
1417It supports the following options:
1518
1619- `-p / --port` specify a port. Defaults to 4242
purescript.cabal+1
@@ -106,6 +106,7 @@ library
106106 boxes >= 0.1.4 && < 0.2.0,
107107 bytestring -any,
108108 containers -any,
109+ clock -any,
109110 directory >= 1.2,
110111 dlist -any,
111112 edit-distance -any,
src/Language/PureScript/Ide.hs+103−81
@@ -14,11 +14,10 @@
1414
1515{-# LANGUAGE OverloadedStrings #-}
1616{-# LANGUAGE PackageImports #-}
17+{-# LANGUAGE TemplateHaskell #-}
1718
1819module Language.PureScript.Ide
1920 ( handleCommand
20− -- for tests
21− , printModules
2221 ) where
2322
2423import Protolude
@@ -41,67 +40,74 @@ import Language.PureScript.Ide.Types
4140import Language.PureScript.Ide.Util
4241import System.Directory
4342import System.FilePath
43+import System.FilePath.Glob
4444
4545handleCommand :: (Ide m, MonadLogger m, MonadError PscIdeError m) =>
4646 Command -> m Success
47−handleCommand (Load []) = loadAllModules
48−handleCommand (Load modules) = loadModules modules
49−handleCommand (Type search filters currentModule) =
50− findType search filters currentModule
51−handleCommand (Complete filters matcher currentModule) =
52− findCompletions filters matcher currentModule
53−handleCommand (Pursuit query Package) =
54− findPursuitPackages query
55−handleCommand (Pursuit query Identifier) =
56− findPursuitCompletions query
57−handleCommand (List LoadedModules) =
58− printModules
59−handleCommand (List AvailableModules) =
60− listAvailableModules
61−handleCommand (List (Imports fp)) =
62− importsForFile fp
63−handleCommand (CaseSplit l b e wca t) =
64− caseSplit l b e wca t
65−handleCommand (AddClause l wca) =
66− addClause l wca
67−handleCommand (Import fp outfp _ (AddImplicitImport mn)) = do
68− rs <- addImplicitImport fp mn
69− answerRequest outfp rs
70−handleCommand (Import fp outfp filters (AddImportForIdentifier ident)) = do
71− rs <- addImportForIdentifier fp ident filters
72− case rs of
73− Right rs' -> answerRequest outfp rs'
74− Left question -> pure $ CompletionResult (map completionFromMatch question)
75−handleCommand (Rebuild file) =
76− rebuildFile file
77−handleCommand Cwd =
78− TextResult . toS <$> liftIO getCurrentDirectory
79−handleCommand Reset = resetIdeState *> pure (TextResult "State has been reset.")
80−handleCommand Quit = liftIO exitSuccess
81−
82−findCompletions :: (Ide m) =>
47+handleCommand c = case c of
48+ Load [] ->
49+ findAvailableExterns >>= loadModules
50+ Load modules ->
51+ loadModules modules
52+ Type search filters currentModule ->
53+ findType search filters currentModule
54+ Complete filters matcher currentModule ->
55+ findCompletions filters matcher currentModule
56+ Pursuit query Package ->
57+ findPursuitPackages query
58+ Pursuit query Identifier ->
59+ findPursuitCompletions query
60+ List LoadedModules ->
61+ printModules
62+ List AvailableModules ->
63+ listAvailableModules
64+ List (Imports fp) ->
65+ ImportList <$> getImportsForFile fp
66+ CaseSplit l b e wca t ->
67+ caseSplit l b e wca t
68+ AddClause l wca ->
69+ addClause l wca
70+ Import fp outfp _ (AddImplicitImport mn) -> do
71+ rs <- addImplicitImport fp mn
72+ answerRequest outfp rs
73+ Import fp outfp filters (AddImportForIdentifier ident) -> do
74+ rs <- addImportForIdentifier fp ident filters
75+ case rs of
76+ Right rs' -> answerRequest outfp rs'
77+ Left question ->
78+ pure (CompletionResult (map completionFromMatch question))
79+ Rebuild file ->
80+ rebuildFile file
81+ Cwd ->
82+ TextResult . toS <$> liftIO getCurrentDirectory
83+ Reset ->
84+ resetIdeState $> TextResult "State has been reset."
85+ Quit ->
86+ liftIO exitSuccess
87+
88+findCompletions :: Ide m =>
8389 [Filter] -> Matcher -> Maybe P.ModuleName -> m Success
8490findCompletions filters matcher currentModule = do
8591 modules <- getAllModules2 currentModule
8692 pure . CompletionResult . map completionFromMatch . getCompletions filters matcher $ modules
8793
88−findType :: (Ide m) =>
94+findType :: Ide m =>
8995 Text -> [Filter] -> Maybe P.ModuleName -> m Success
9096findType search filters currentModule = do
9197 modules <- getAllModules2 currentModule
9298 pure . CompletionResult . map completionFromMatch . getExactMatches search filters $ modules
9399
94−findPursuitCompletions :: (MonadIO m) =>
100+findPursuitCompletions :: MonadIO m =>
95101 PursuitQuery -> m Success
96102findPursuitCompletions (PursuitQuery q) =
97103 PursuitResult <$> liftIO (searchPursuitForDeclarations q)
98104
99−findPursuitPackages :: (MonadIO m) =>
105+findPursuitPackages :: MonadIO m =>
100106 PursuitQuery -> m Success
101107findPursuitPackages (PursuitQuery q) =
102108 PursuitResult <$> liftIO (findPackagesForModuleIdent q)
103109
104−printModules :: (Ide m) => m Success
110+printModules :: Ide m => m Success
105111printModules = ModuleList . map runModuleNameT <$> getLoadedModulenames
106112
107113outputDirectory :: Ide m => m FilePath
@@ -131,54 +137,70 @@ addClause
131137 -> m Success
132138addClause t wca = MultilineTextResult <$> CS.addClause t wca
133139
134−importsForFile :: (MonadIO m, MonadError PscIdeError m) =>
135− FilePath -> m Success
136−importsForFile fp = do
137− imports <- getImportsForFile fp
138− pure (ImportList imports)
139−
140−-- | Takes the output directory and a filepath like "Monad.Control.Eff" and
141−-- looks up, whether that folder contains an externs.json
142−checkExternsPath :: FilePath -> FilePath -> IO (Maybe FilePath)
143−checkExternsPath oDir d
144− | d `elem` [".", ".."] = pure Nothing
145− | otherwise = do
146− let file = oDir </> d </> "externs.json"
147− ex <- doesFileExist file
148− if ex
149− then pure (Just file)
150− else pure Nothing
151−
152−findAllExterns :: (Ide m, MonadError PscIdeError m) => m [FilePath]
153−findAllExterns = do
140+-- | Finds all the externs.json files inside the output folder and returns the
141+-- corresponding Modulenames
142+findAvailableExterns :: (Ide m, MonadError PscIdeError m) => m [P.ModuleName]
143+findAvailableExterns = do
154144 oDir <- outputDirectory
155145 unlessM (liftIO (doesDirectoryExist oDir))
156146 (throwError (GeneralError "Couldn't locate your output directory."))
157147 liftIO $ do
158− dirs <- getDirectoryContents oDir
159− externPaths <- traverse (checkExternsPath oDir) dirs
160− pure (catMaybes externPaths)
161−
148+ directories <- getDirectoryContents oDir
149+ moduleNames <- filterM (checkExternsPath oDir) directories
150+ pure (P.moduleNameFromString <$> moduleNames)
151+ where
152+ -- | Takes the output directory and a filepath like "Monad.Control.Eff" and
153+ -- looks up, whether that folder contains an externs.json
154+ checkExternsPath :: FilePath -> FilePath -> IO Bool
155+ checkExternsPath oDir d
156+ | d `elem` [".", ".."] = pure False
157+ | otherwise = do
158+ let file = oDir </> d </> "externs.json"
159+ doesFileExist file
160+
161+-- | Finds all matches for the globs specified at the commandline
162+findAllSourceFiles :: Ide m => m [FilePath]
163+findAllSourceFiles = do
164+ globs <- confGlobs . ideConfiguration <$> ask
165+ liftIO (concatMapM glob globs)
166+
167+-- | Looks up the ExternsFiles for the given Modulenames and loads them into the
168+-- server state. Then proceeds to parse all the specified sourcefiles and
169+-- inserts their ASTs into the state. Finally kicks off an async worker, which
170+-- populates Stage 2 and 3 of the state.
162171loadModules
163172 :: (Ide m, MonadError PscIdeError m, MonadLogger m)
164173 => [P.ModuleName]
165174 -> m Success
166−loadModules mns = do
175+loadModules moduleNames = do
176+ -- We resolve all the modulenames to externs files and load these into memory.
167177 oDir <- outputDirectory
168− let efPaths = map (\mn -> oDir </> P.runModuleName mn </> "externs.json") mns
178+ let efPaths =
179+ map (\mn -> oDir </> P.runModuleName mn </> "externs.json") moduleNames
169180 efiles <- traverse readExternFile efPaths
170181 traverse_ insertExterns efiles
171− --TODO Get rid of this once ModuleOld is gone
172− traverse_ insertModule efiles
173− populateStage2
174− pure (TextResult ("Loaded " <> foldMap runModuleNameT mns <> "."))
175−
176−loadAllModules :: (Ide m, MonadError PscIdeError m) => m Success
177−loadAllModules = do
178− exts <- traverse readExternFile =<< findAllExterns
179− traverse_ insertExterns exts
180− --TODO Get rid of this once ModuleOld is gone
181− traverse_ insertModule exts
182+
183+ -- We parse all source files, log eventual parse failures if the debug flag
184+ -- was set and insert the succesful parses into the state.
185+ (failures, allModules) <-
186+ partitionEithers <$> (traverse parseModule =<< findAllSourceFiles)
187+ unless (null failures) $
188+ $(logDebug) ("Failed to parse: " <> show failures)
189+ traverse_ insertModule allModules
190+
191+ -- Because we still need the "old" module format to resolve reexports in the
192+ -- worker thread, we insert it into the state aswell.
193+ -- TODO Get rid of this once ModuleOld is gone
194+ traverse_ insertModuleOld efiles
195+
196+ -- Finally we kick off the worker with @async@ and return the number of
197+ -- successfully parsed modules.
182198 env <- ask
183− _ <- liftIO $ async (runStdoutLoggingT (runReaderT populateStage2 env))
184− pure (TextResult "All modules loaded.")
199+ let runLogger =
200+ runStdoutLoggingT
201+ . filterLogger (\_ _ -> confDebug (ideConfiguration env))
202+ -- populateStage2 returns Unit for now, so it's fine to discard this result.
203+ -- We might want to block on this in a benchmarking situation.
204+ _ <- liftIO (async (runLogger (runReaderT populateStage2 env)))
205+ pure (TextResult ("Loaded " <> show (length efiles) <> " modules and "
206+ <> show (length allModules) <> " source files."))
src/Language/PureScript/Ide/CaseSplit.hs+3−2
@@ -36,6 +36,7 @@ import Language.PureScript.Ide.Types
3636import Language.PureScript.Ide.Util
3737
3838import Text.Parsec as Parsec
39+import qualified Text.PrettyPrint.Boxes as Box
3940
4041type Constructor = (P.ProperName 'P.ConstructorName, [P.Type])
4142
@@ -135,8 +136,8 @@ parseTypeDeclaration' s =
135136 Right (P.TypeDeclaration i t) -> pure (i, t)
136137 Right _ -> throwError (GeneralError "Found a non-type-declaration")
137138 Left err ->
138− throwError (GeneralError ("Parsing the typesignature failed with: "
139− <> show err))
139+ throwError (GeneralError ("Parsing the type signature failed with: "
140+ <> toS (Box.render (P.prettyPrintParseError err))))
140141
141142splitFunctionType :: P.Type -> [P.Type]
142143splitFunctionType t = fromMaybe [] arguments
src/Language/PureScript/Ide/Reexports.hs+1−2
@@ -28,7 +28,6 @@ import Protolude
2828
2929import Data.List (union)
3030import qualified Data.Map as Map
31−import qualified Data.Text as T
3231import Language.PureScript.Ide.Types
3332import Language.PureScript.Ide.Externs
3433import qualified Language.PureScript as P
@@ -94,5 +93,5 @@ resolveReexports modules m =
9493 then replaced
9594 else resolveReexports modules replaced
9695
97−resolveReexports2 :: Map T.Text [ExternDecl] -> ModuleOld -> Module
96+resolveReexports2 :: Map Text [ExternDecl] -> ModuleOld -> Module
9897resolveReexports2 decls = convertModule . resolveReexports decls
src/Language/PureScript/Ide/SourceFile.hs+32−44
@@ -14,7 +14,12 @@
1414
1515{-# LANGUAGE OverloadedStrings #-}
1616
17−module Language.PureScript.Ide.SourceFile where
17+module Language.PureScript.Ide.SourceFile
18+ ( parseModule
19+ , getImportsForFile
20+ -- SOON...
21+ , getDeclPosition
22+ ) where
1823
1924import Protolude
2025
@@ -24,26 +29,18 @@ import Language.PureScript.Ide.Util
2429import Language.PureScript.Ide.Externs (unwrapPositioned,
2530 unwrapPositionedRef)
2631import Language.PureScript.Ide.Types
27−import System.Directory
2832import System.FilePath
2933import System.IO.UTF8 (readUTF8File)
3034
31−parseModuleFromFile :: (MonadIO m, MonadError PscIdeError m) =>
32− FilePath -> m P.Module
33−parseModuleFromFile fp = do
34− exists <- liftIO (doesFileExist fp)
35− if exists
36− then do
37− content <- liftIO (readUTF8File fp)
38− let m = do tokens <- P.lex fp content
39− P.runTokenParser "" P.parseModule tokens
40− either (throwError . (`ParseError` "File could not be parsed.")) pure m
41− else throwError (NotFound "File does not exist.")
42−
43−-- data Module = Module SourceSpan [Comment] ModuleName [Declaration] (Maybe [DeclarationRef])
44−
45−getDeclarations :: P.Module -> [P.Declaration]
46−getDeclarations (P.Module _ _ _ declarations _) = declarations
35+parseModule
36+ :: (MonadIO m)
37+ => FilePath
38+ -> m (Either FilePath (FilePath, P.Module) )
39+parseModule path = do
40+ contents <- liftIO (readUTF8File path)
41+ case P.parseModuleFromFile identity (path, contents) of
42+ Left _ -> pure (Left path)
43+ Right m -> pure (Right m)
4744
4845getImports :: P.Module -> [(P.ModuleName, P.ImportDeclarationType, Maybe P.ModuleName)]
4946getImports (P.Module _ _ _ declarations _) =
@@ -55,26 +52,21 @@ getImports (P.Module _ _ _ declarations _) =
5552getImportsForFile :: (MonadIO m, MonadError PscIdeError m) =>
5653 FilePath -> m [ModuleImport]
5754getImportsForFile fp = do
58− module' <- parseModuleFromFile fp
59− let imports = getImports module'
60− pure (mkModuleImport . unwrapPositionedImport <$> imports)
61− where
62− mkModuleImport (mn, importType', qualifier) =
63− ModuleImport
64− (runModuleNameT mn)
65− importType'
66− (runModuleNameT <$> qualifier)
67− unwrapPositionedImport (mn, it, q) = (mn, unwrapImportType it, q)
68− unwrapImportType (P.Explicit decls) = P.Explicit (map unwrapPositionedRef decls)
69− unwrapImportType (P.Hiding decls) = P.Hiding (map unwrapPositionedRef decls)
70− unwrapImportType P.Implicit = P.Implicit
71−
72−getPositionedImports :: P.Module -> [P.Declaration]
73−getPositionedImports (P.Module _ _ _ declarations _) =
74− mapMaybe isImport declarations
75− where
76− isImport i@(P.PositionedDeclaration _ _ P.ImportDeclaration{}) = Just i
77− isImport _ = Nothing
55+ moduleE <- parseModule fp
56+ case moduleE of
57+ Left _ -> throwError (GeneralError "Failed to parse sourcefile.")
58+ Right (_, module') ->
59+ pure (mkModuleImport . unwrapPositionedImport <$> getImports module')
60+ where
61+ mkModuleImport (mn, importType', qualifier) =
62+ ModuleImport
63+ (runModuleNameT mn)
64+ importType'
65+ (runModuleNameT <$> qualifier)
66+ unwrapPositionedImport (mn, it, q) = (mn, unwrapImportType it, q)
67+ unwrapImportType (P.Explicit decls) = P.Explicit (map unwrapPositionedRef decls)
68+ unwrapImportType (P.Hiding decls) = P.Hiding (map unwrapPositionedRef decls)
69+ unwrapImportType P.Implicit = P.Implicit
7870
7971getDeclPosition :: P.Module -> Text -> Maybe P.SourceSpan
8072getDeclPosition m ident = getFirst (foldMap (match ident) decls)
@@ -102,9 +94,5 @@ getDeclPosition m ident = getFirst (foldMap (match ident) decls)
10294 properEqual x q = runProperNameT x == q
10395 identEqual x q = runIdentT x == q
10496
105−goToDefinition :: Text -> FilePath -> IO (Maybe P.SourceSpan)
106−goToDefinition q fp = do
107− m <- runExceptT (parseModuleFromFile fp)
108− case m of
109− Right module' -> pure (getDeclPosition module' q)
110− Left _ -> pure Nothing
97+ getDeclarations :: P.Module -> [P.Declaration]
98+ getDeclarations (P.Module _ _ _ declarations _) = declarations
src/Language/PureScript/Ide/State.hs+37−18
@@ -19,10 +19,12 @@
1919module Language.PureScript.Ide.State
2020 ( getLoadedModulenames
2121 , getExternFiles
22− , insertModule
22+ , insertModuleOld
2323 , resetIdeState
2424 , cacheRebuild
2525 , insertExterns
26+ , insertModule
27+ , insertModuleSTM
2628 , insertExternsSTM
2729 , getAllModules2
2830 , getStage1
@@ -34,18 +36,19 @@ module Language.PureScript.Ide.State
3436 ) where
3537
3638import Protolude
39+import qualified Prelude
3740
3841import Control.Concurrent.STM
3942import "monad-logger" Control.Monad.Logger
4043import qualified Data.Map.Lazy as M
41−import qualified Data.Text as T
42−import Data.Time (getCurrentTime, diffUTCTime)
4344import Language.PureScript.Externs
4445import Language.PureScript.Ide.Externs
4546import Language.PureScript.Ide.Reexports
4647import Language.PureScript.Ide.Types
4748import Language.PureScript.Ide.Util
4849import qualified Language.PureScript as P
50+import System.Clock
51+import System.FilePath
4952
5053-- | Resets all State inside psc-ide
5154resetIdeState :: Ide m => m ()
@@ -68,16 +71,16 @@ getExternFiles = s1Externs <$> getStage1
6871-- | Inserts an @ExternsFile@ into the PscIdeState. Also converts the
6972-- ExternsFile into psc-ide's internal Declaration format
7073-- TODO: should be removed when the "old" Declaration format gets removed
71−insertModule :: Ide m => ExternsFile -> m ()
72−insertModule externsFile = do
74+insertModuleOld :: Ide m => ExternsFile -> m ()
75+insertModuleOld externsFile = do
7376 stateVar <- envStateVar <$> ask
74− liftIO . atomically $ insertModuleSTM stateVar externsFile
77+ liftIO . atomically $ insertModuleOldSTM stateVar externsFile
7578
76−-- | STM version of insertModule
77−insertModuleSTM :: TVar PscIdeState -> ExternsFile -> STM ()
78−insertModuleSTM st ef = modifyTVar st (insertModule' ef)
79+-- | STM version of insertModuleOld
80+insertModuleOldSTM :: TVar PscIdeState -> ExternsFile -> STM ()
81+insertModuleOldSTM st ef = modifyTVar st (insertModule' ef)
7982
80−-- | Pure version of insertModule
83+-- | Pure version of insertModuleOld
8184insertModule' :: ExternsFile -> PscIdeState -> PscIdeState
8285insertModule' ef state =
8386 state
@@ -85,6 +88,22 @@ insertModule' ef state =
8588 in M.insert mn decls (pscIdeStateModules state)
8689 }
8790
91+-- | Insert a Module into Stage1 of the State
92+insertModule :: Ide m => (FilePath, P.Module) -> m ()
93+insertModule module' = do
94+ stateVar <- ideStateVar <$> ask
95+ liftIO . atomically $ insertModuleSTM stateVar module'
96+
97+-- | STM version of insertModule
98+insertModuleSTM :: TVar IdeState -> (FilePath, P.Module) -> STM ()
99+insertModuleSTM ref (fp, module') =
100+ modifyTVar ref $ \x ->
101+ x { ideStage1 = (ideStage1 x) {
102+ s1Modules = M.insert
103+ (P.getModuleName module')
104+ (module', fp)
105+ (s1Modules (ideStage1 x))}}
106+
88107-- | Retrieves Stage1 from the State.
89108-- This includes loaded Externfiles
90109-- (TODO: as soon as we actually parse the modules) aswell as the parsed modules
@@ -131,17 +150,17 @@ setStage2STM ref s2 = do
131150-- cache
132151getAllModules2 :: Ide m => Maybe P.ModuleName -> m [(P.ModuleName, [IdeDeclaration])]
133152getAllModules2 mmoduleName = do
134− modules <- s2Modules <$> getStage2
153+ declarations <- s2Declarations <$> getStage2
135154 rebuild <- cachedRebuild
136155 case mmoduleName of
137− Nothing -> pure (M.toList modules)
156+ Nothing -> pure (M.toList declarations)
138157 Just moduleName ->
139158 case rebuild of
140159 Just (cachedModulename, ef)
141160 | cachedModulename == moduleName ->
142161 pure . M.toList $
143− M.insert moduleName (snd . convertModule . convertExterns $ ef) modules
144− _ -> pure (M.toList modules)
162+ M.insert moduleName (snd . convertModule . convertExterns $ ef) declarations
163+ _ -> pure (M.toList declarations)
145164
146165-- | Adds an ExternsFile into psc-ide's State Stage1. This does not populate the
147166-- following Stages, which needs to be done after all the necessary Exterms have
@@ -175,11 +194,11 @@ populateStage2 :: (Ide m, MonadLogger m) => m ()
175194populateStage2 = do
176195 st <- ideStateVar <$> ask
177196 duration <- liftIO $ do
178− start <- getCurrentTime
197+ start <- getTime Monotonic
179198 atomically (populateStage2STM st)
180− end <- getCurrentTime
181− pure (diffUTCTime end start)
182− $(logDebug) $ "Finished populating Stage2 in " <> T.pack (show duration)
199+ end <- getTime Monotonic
200+ pure (Prelude.show (diffTimeSpec start end))
201+ $(logDebug) $ "Finished populating Stage2 in " <> toS duration
183202
184203-- | STM version of populateStage2
185204populateStage2STM :: TVar IdeState -> STM ()
src/Language/PureScript/Ide/Types.hs+5−3
@@ -12,7 +12,7 @@
1212-- Type definitions for psc-ide
1313-----------------------------------------------------------------------------
1414
15−{-# LANGUAGE OverloadedStrings #-}
15+{-# LANGUAGE OverloadedStrings #-}
1616
1717module Language.PureScript.Ide.Types where
1818
@@ -74,6 +74,7 @@ data Configuration =
7474 Configuration
7575 { confOutputPath :: FilePath
7676 , confDebug :: Bool
77+ , confGlobs :: [FilePath]
7778 }
7879
7980data IdeEnvironment =
@@ -102,17 +103,18 @@ emptyIdeState :: IdeState
102103emptyIdeState = IdeState emptyStage1 emptyStage2
103104
104105emptyStage1 :: Stage1
105−emptyStage1 = Stage1 M.empty
106+emptyStage1 = Stage1 M.empty M.empty
106107
107108emptyStage2 :: Stage2
108109emptyStage2 = Stage2 M.empty Nothing
109110
110111data Stage1 = Stage1
111112 { s1Externs :: M.Map P.ModuleName P.ExternsFile
113+ , s1Modules :: M.Map P.ModuleName (P.Module, FilePath)
112114 }
113115
114116data Stage2 = Stage2
115− { s2Modules :: M.Map P.ModuleName [IdeDeclaration]
117+ { s2Declarations :: M.Map P.ModuleName [IdeDeclaration]
116118 , s2CachedRebuild :: Maybe (P.ModuleName, P.ExternsFile)
117119 }
118120